:root {
    --bg-color: #202124;
    --card-bg: #292a2d;
    --primary-color: #8ab4f8;
    --google-blue: #1a73e8;
    --text-color: #e8eaed;
    --secondary-text: #bdc1c6;
    --border-color: #444746;
    --hover-bg: #35363a;
    --danger-color: #f28b82;
    --bright-danger: #d93025;
    --success-color: #81c995;
    --input-bg: #303134;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 20px;
    color: var(--text-color);
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    padding: 24px;
    margin-bottom: 24px;
}

/* Auth / Login Page */
.auth-card {
    max-width: 400px;
    margin: 100px auto;
    text-align: left;
    padding: 40px;
}

.auth-card h1 { text-align: center; margin-bottom: 30px; font-size: 24px; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 8px; font-size: 14px; color: var(--secondary-text); }

input[type="text"], input[type="password"] {
    width: 100%;
    padding: 12px;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    box-sizing: border-box;
    outline: none;
    font-size: 15px;
}

.auth-card button {
    background-color: var(--google-blue);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    width: 100%;
    margin-top: 20px;
}

/* Hyperlinks */
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary-color); }

/* Header & Logout - SLIM version */
.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.logout-link {
    color: var(--secondary-text);
    background-color: transparent;
    font-size: 12px;
    font-weight: 400;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}
.logout-link:hover { 
    background-color: rgba(242, 139, 130, 0.1); 
    color: var(--danger-color);
    border-color: var(--danger-color);
    text-decoration: none; 
}

.breadcrumb {
    margin-bottom: 24px;
    padding: 12px 16px;
    background: var(--input-bg);
    border-radius: 6px;
    font-size: 14px;
    color: var(--secondary-text);
}

/* Table Styling */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border-color); }
th { background: var(--hover-bg); color: var(--secondary-text); font-weight: 500; font-size: 12px; text-transform: uppercase; }
tr:hover { background-color: rgba(255,255,255,0.02); }

.item-info { display: flex; align-items: center; gap: 12px; }
.folder-link { font-weight: 500; color: var(--text-color); cursor: pointer; }
.folder-link:hover { color: var(--primary-color); text-decoration: underline; }
.file-link { font-weight: 400; color: var(--text-color); }

/* Action Buttons */
.actions { display: flex; gap: 6px; align-items: center; }
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 12px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: filter 0.2s;
    white-space: nowrap;
}
.btn-action:hover { filter: brightness(1.2); }

.btn-rename { width: 75px; background-color: #5f6368; color: white; }
.btn-get { width: 75px; background-color: var(--google-blue); color: white; }
.btn-del { width: 75px; background-color: #c53929; color: white; }

/* Context Menu */
.context-menu {
    display: none;
    position: fixed !important;
    z-index: 99999 !important;
    background: #2d2e31;
    border: 1px solid #444;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
    padding: 6px 0;
    min-width: 160px;
}
.context-menu-item { padding: 10px 20px; cursor: pointer; font-size: 14px; color: var(--text-color); transition: background 0.1s; }
.context-menu-item:hover { background: #3c4043; color: var(--primary-color); }

/* Gallery View - Fixed "empty space" issue */
.gallery-container { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); 
    gap: 32px !important; /* 간격 확실히 띄움 */
    align-items: start; 
}
.gallery-item { 
    background: var(--input-bg); 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    overflow: hidden; 
    transition: border-color 0.2s; 
    display: flex; 
    flex-direction: column;
    height: fit-content; 
}
.gallery-item:hover { border-color: var(--primary-color); }
.thumbnail-wrapper { position: relative; width: 100%; padding-top: 56.25%; background: #333; overflow: hidden; }
.thumbnail-wrapper img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.play-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 40px; color: rgba(255,255,255,0.7); pointer-events: none; }
.item-title { 
    padding: 12px; 
    font-size: 13px; 
    color: var(--text-color); 
    white-space: normal; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; 
    line-height: 1.4;
}

/* Upload & Search */
.search-section { margin-bottom: 40px; }
.upload-controls { display: flex; align-items: center; background-color: var(--input-bg); border: 1px solid var(--border-color); border-radius: 8px; padding: 5px 5px 5px 15px; gap: 10px; }
.upload-controls input[type="file"] { flex-grow: 1; background: transparent; border: none; color: var(--secondary-text); font-size: 14px; }
.upload-controls button { width: auto; padding: 10px 24px; background-color: var(--google-blue); color: white; border-radius: 6px; border: none; cursor: pointer; font-size: 14px; }
.search-form { display: flex; align-items: center; gap: 10px; }
.search-input-wrapper { position: relative; flex-grow: 1; }
.search-input-wrapper i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--secondary-text); font-style: normal; }
.search-input { width: 100%; padding: 10px 12px 10px 42px !important; background: var(--input-bg) !important; border: 1px solid var(--border-color) !important; border-radius: 8px !important; color: white !important; }
.search-btn { width: auto !important; padding: 10px 24px !important; background: var(--google-blue) !important; color: white !important; border-radius: 8px !important; font-weight: 500 !important; border: none !important; cursor: pointer; }

@media (max-width: 600px) {
    .gallery-container { grid-template-columns: repeat(2, 1fr); gap: 12px !important; }
    .btn-action { min-width: 65px; height: 28px; font-size: 11px; }
}
