/* [SkyDrive Primary Stylesheet] Written by Antigravity */
/* Short explanation: High-end, modern cloud drive design system featuring dark theme, glassmorphism,
   fluid responsive grid/list layouts, vibrant category accents, micro-animations, and interactive modals. */

:root {
    /* Color Palette */
    --bg-base: #090d16;
    --bg-surface: #101626;
    --bg-surface-elevated: #182035;
    --bg-card: rgba(22, 30, 50, 0.75);
    --bg-card-hover: rgba(30, 41, 68, 0.85);
    --bg-glass: rgba(16, 22, 38, 0.75);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(99, 102, 241, 0.35);
    --border-strong: rgba(255, 255, 255, 0.15);

    /* Accents & Brand */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.3);
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    --card-gradient: linear-gradient(145deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%);

    /* Category Badges */
    --cat-folder: #38bdf8;
    --cat-image: #c084fc;
    --cat-video: #22d3ee;
    --cat-audio: #fbbf24;
    --cat-doc: #60a5fa;
    --cat-code: #34d399;
    --cat-archive: #f97316;
    --cat-other: #94a3b8;

    /* Text Colors */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-faint: #64748b;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;

    /* Typography */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Layout & Shadows */
    --header-height: 68px;
    --sidebar-width: 240px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px -5px rgba(99, 102, 241, 0.25);
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Global */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
    font-family: inherit;
    color: inherit;
}

/* [Application Root & Screen Management] Written by Antigravity */
/* Short explanation: Establishes full viewport sizing and manages display state between authentication and main workspace. */
#app {
    width: 100vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-base);
    overflow-x: hidden;
}

.screen {
    display: none;
    width: 100%;
    min-height: 100vh;
}
.screen.active {
    display: flex;
}

/* ========================================== */
/* Authentication Screen                      */
/* ========================================== */
#auth-screen {
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 20%, rgba(99, 102, 241, 0.15), transparent 70%),
                radial-gradient(circle at 80% 80%, rgba(217, 70, 239, 0.1), transparent 50%),
                var(--bg-base);
    padding: 24px;
}

.auth-card-backdrop {
    width: 100%;
    max-width: 440px;
    background: var(--card-gradient);
    border-radius: var(--radius-lg);
    padding: 1px;
    box-shadow: var(--shadow-soft), var(--shadow-glow);
}

.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    backdrop-filter: blur(16px);
}

.brand {
    text-align: center;
    margin-bottom: 28px;
}

.logo-badge {
    font-size: 42px;
    line-height: 1;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.4));
}

.brand h1 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 6px;
}

.brand .subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

.tabs {
    display: flex;
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 24px;
    border: 1px solid var(--border-subtle);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.tab-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 14px;
    color: var(--text-main);
    transition: var(--transition-fast);
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.alert-error {
    margin-top: 14px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    color: #fca5a5;
    font-size: 13px;
    text-align: center;
}

.features-pill-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.pill-item {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    padding: 4px 10px;
    border-radius: 20px;
}

/* ========================================== */
/* Dashboard Screen Layout                    */
/* ========================================== */
#dashboard-screen {
    display: none;
    width: 100%;
    flex: 1;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-base);
}
#dashboard-screen.active {
    display: flex;
}

/* Top Navigation Bar */
.app-header {
    height: var(--header-height);
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-subtle);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1;
    max-width: 600px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.brand-icon {
    font-size: 24px;
    line-height: 1;
}

.brand-name {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.3px;
}

.search-container {
    position: relative;
    flex: 1;
}

.search-container .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.6;
    pointer-events: none;
}

.search-container input {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 9px 36px 9px 36px;
    font-size: 13px;
    color: var(--text-main);
    transition: var(--transition-fast);
    outline: none;
}

.search-container input:focus {
    border-color: var(--primary);
    background: var(--bg-surface-elevated);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* View Mode Switcher */
.view-toggle-group {
    display: flex;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.icon-toggle-btn {
    background: transparent;
    border: none;
    padding: 6px 8px;
    color: var(--text-muted);
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.icon-toggle-btn.active, .icon-toggle-btn:hover {
    color: var(--text-main);
    background: var(--bg-surface-elevated);
}
.icon-toggle-btn.active {
    color: var(--primary);
}

/* Common Buttons */
.primary-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
    box-shadow: 0 2px 8px var(--primary-glow);
}
.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}
.primary-btn.sm {
    padding: 6px 14px;
    font-size: 12px;
}
.primary-btn.wide-btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
}

.secondary-btn {
    background: var(--bg-surface-elevated);
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}
.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.ghost-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}
.ghost-btn:hover {
    color: var(--text-main);
    border-color: var(--border-strong);
}

/* User Profile Badge */
.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 4px 12px 4px 4px;
    border-radius: 30px;
}

.user-avatar-initial {
    width: 30px;
    height: 30px;
    background: var(--primary-gradient);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.signout-btn {
    background: transparent;
    border: none;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: var(--transition-fast);
}
.signout-btn:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* [Dashboard Body Layout] Written by Antigravity */
/* Short explanation: Establishes a horizontal flex layout with full width for sidebar and explorer workspace. */
.dashboard-body {
    display: flex;
    flex-direction: row;
    flex: 1;
    width: 100%;
    overflow: hidden;
    height: calc(100vh - var(--header-height));
    box-sizing: border-box;
}

/* [Sidebar Navigation] Written by Antigravity */
/* Short explanation: Fixed 250px vertical sidebar housing storage categories and storage meter widget. */
.sidebar {
    width: 250px;
    min-width: 250px;
    max-width: 250px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 16px;
    flex-shrink: 0;
    overflow-y: auto;
    box-sizing: border-box;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-faint);
    padding: 8px 12px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: 1px solid transparent;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: var(--transition-fast);
    width: 100%;
    box-sizing: border-box;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-color: var(--border-subtle);
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.18);
    color: #c7d2fe;
    font-weight: 600;
    border-color: rgba(99, 102, 241, 0.35);
}

.nav-icon {
    font-size: 16px;
    line-height: 1;
}

/* Storage Meter Widget */
.storage-meter-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 20px;
}

.meter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.meter-title {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.meter-val {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.meter-bar-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.meter-bar-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 10px;
    transition: width 0.4s ease;
}

.meter-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-faint);
}

.meter-refresh-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 11px;
    transition: var(--transition-fast);
}
.meter-refresh-btn:hover {
    color: var(--text-main);
    transform: rotate(90deg);
}

/* [Main Explorer Pane Layout] Written by Antigravity */
/* Short explanation: Fluid workspace taking remaining horizontal width with vertical scrolling and padding. */
.explorer-pane {
    flex: 1;
    width: calc(100% - 250px);
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
    background: var(--bg-base);
    padding: 24px 32px;
    box-sizing: border-box;
}

/* [Drag & Drop Overlay] Written by Antigravity */
/* Short explanation: Hidden by default and only activates as a fullscreen floating drop target during active drag events. */
.drag-overlay {
    display: none !important;
    position: absolute;
    inset: 16px;
    background: rgba(16, 22, 38, 0.95);
    border: 2px dashed var(--primary);
    border-radius: var(--radius-lg);
    z-index: 90;
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-sizing: border-box;
}

.drag-overlay.active {
    display: flex !important;
    animation: pulseBorder 1.5s infinite;
}

@keyframes pulseBorder {
    0%, 100% { border-color: var(--primary); box-shadow: 0 0 20px rgba(99, 102, 241, 0.3); }
    50% { border-color: #a855f7; box-shadow: 0 0 35px rgba(168, 85, 247, 0.5); }
}

.drag-overlay-content {
    text-align: center;
}

.drag-icon {
    font-size: 54px;
    margin-bottom: 12px;
}

.drag-overlay-content h3 {
    font-family: var(--font-heading);
    font-size: 22px;
    margin-bottom: 6px;
}

.drag-overlay-content p {
    font-size: 14px;
    color: var(--text-muted);
}

/* Explorer Toolbar */
.explorer-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.breadcrumb-container {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.crumb-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.crumb-btn:hover {
    background: var(--bg-surface-elevated);
    color: var(--text-main);
}

.crumb-btn.active {
    color: var(--text-main);
    font-weight: 700;
}

.crumb-sep {
    color: var(--text-faint);
    font-size: 12px;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.item-count-badge {
    font-size: 12px;
    color: var(--text-faint);
    font-weight: 500;
}

.sort-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.sort-selector-wrapper select {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 12px;
    color: var(--text-main);
    outline: none;
    cursor: pointer;
}

.action-icon-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition-fast);
}
.action-icon-btn:hover {
    color: var(--text-main);
    background: var(--bg-surface-elevated);
}

.search-banner {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 13px;
    color: #c7d2fe;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.search-banner-close {
    background: none;
    border: none;
    color: #c7d2fe;
    text-decoration: underline;
    cursor: pointer;
    font-size: 12px;
}

/* ========================================== */
/* Grid View                                  */
/* ========================================== */
.items-container.view-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
    align-content: start;
}

.item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-smooth);
    cursor: pointer;
    position: relative;
    user-select: none;
    min-height: 140px;
    backdrop-filter: blur(8px);
}

.item-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.4);
}

.item-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.item-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: rgba(255, 255, 255, 0.05);
}

.item-icon-box.folder { background: rgba(56, 189, 248, 0.12); color: var(--cat-folder); }
.item-icon-box.image { background: rgba(192, 132, 252, 0.12); color: var(--cat-image); }
.item-icon-box.video { background: rgba(34, 211, 238, 0.12); color: var(--cat-video); }
.item-icon-box.audio { background: rgba(251, 191, 36, 0.12); color: var(--cat-audio); }
.item-icon-box.document { background: rgba(96, 165, 250, 0.12); color: var(--cat-doc); }
.item-icon-box.code { background: rgba(52, 211, 153, 0.12); color: var(--cat-code); }
.item-icon-box.archive { background: rgba(249, 115, 22, 0.12); color: var(--cat-archive); }

/* Thumbnail preview for images */
.item-thumbnail-preview {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
    background: rgba(0, 0, 0, 0.3);
}

.item-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-faint);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 14px;
    transition: var(--transition-fast);
}
.item-menu-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

.item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

.item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

/* ========================================== */
/* List View                                  */
/* ========================================== */
.items-container.view-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.list-table-header {
    display: grid;
    grid-template-columns: 36px 3fr 1fr 1fr 1.5fr 120px;
    align-items: center;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-faint);
    border-bottom: 1px solid var(--border-subtle);
}

.list-row {
    display: grid;
    grid-template-columns: 36px 3fr 1fr 1fr 1.5fr 120px;
    align-items: center;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid transparent;
    transition: var(--transition-fast);
    cursor: pointer;
    font-size: 13px;
}

.list-row:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-subtle);
}

.list-icon {
    font-size: 18px;
    line-height: 1;
}

.list-name {
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 12px;
}

.list-category {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: capitalize;
}

.list-size, .list-date {
    color: var(--text-muted);
    font-size: 12px;
}

.list-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}

.list-action-btn {
    background: transparent;
    border: none;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13px;
    transition: var(--transition-fast);
}
.list-action-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}
.list-action-btn.delete:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Empty State */
.empty-folder-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 14px;
    opacity: 0.6;
}

.empty-folder-state h4 {
    font-family: var(--font-heading);
    font-size: 18px;
    color: var(--text-main);
    margin-bottom: 6px;
}

.empty-folder-state p {
    font-size: 13px;
    margin-bottom: 20px;
}

/* Loading state */
.loading-spinner-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Context / Dropdown Menu */
.context-menu-dropdown {
    position: absolute;
    right: 10px;
    top: 36px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-soft);
    padding: 6px 0;
    min-width: 140px;
    z-index: 50;
    display: flex;
    flex-direction: column;
}

.context-menu-item {
    background: transparent;
    border: none;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-align: left;
    transition: var(--transition-fast);
}

.context-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
}
.context-menu-item.danger {
    color: #fca5a5;
}
.context-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* ========================================== */
/* Modals & Overlays                          */
/* ========================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-dialog {
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleUp {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-surface-elevated);
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    overflow: hidden;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition-fast);
}
.modal-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-strong);
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 16px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: var(--transition-fast);
}
.modal-close-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 20px;
}

.modal-body label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.modal-body input {
    width: 100%;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-main);
    outline: none;
    transition: var(--transition-fast);
}
.modal-body input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-surface-elevated);
}

/* Size Variants */
.sm-dialog {
    width: 100%;
    max-width: 420px;
}

/* Media Dialog */
.media-dialog {
    width: 90vw;
    max-width: 900px;
    max-height: 85vh;
}

.modal-content-area {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    background: #060910;
    min-height: 350px;
    max-height: calc(85vh - 70px);
}

.preview-image {
    max-width: 100%;
    max-height: calc(85vh - 120px);
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.preview-video {
    max-width: 100%;
    max-height: calc(85vh - 120px);
    border-radius: var(--radius-sm);
    outline: none;
}

.preview-audio-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px 20px;
    width: 100%;
    max-width: 500px;
}

.preview-audio-icon {
    font-size: 64px;
    animation: bounce 2s infinite ease-in-out;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.preview-audio-player {
    width: 100%;
    border-radius: 30px;
    outline: none;
}

.preview-pdf-iframe {
    width: 100%;
    height: 70vh;
    border: none;
    border-radius: var(--radius-sm);
}

/* Editor Dialog */
.editor-dialog {
    width: 90vw;
    max-width: 950px;
    height: 80vh;
}

.editor-filename-input {
    background: transparent;
    border: 1px solid transparent;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    padding: 4px 8px;
    border-radius: 4px;
    outline: none;
}
.editor-filename-input:focus {
    background: var(--bg-surface);
    border-color: var(--border-strong);
}

.status-pill {
    font-size: 11px;
    font-weight: 600;
    color: var(--success);
    background: rgba(16, 185, 129, 0.15);
    padding: 2px 8px;
    border-radius: 12px;
}
.status-pill.unsaved {
    color: var(--accent-amber);
    background: rgba(245, 158, 11, 0.15);
}

.editor-body {
    flex: 1;
    overflow: hidden;
    display: flex;
}

.editor-body textarea {
    width: 100%;
    height: 100%;
    background: #080c14;
    color: #e2e8f0;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    padding: 18px 20px;
    border: none;
    outline: none;
    resize: none;
}

.editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    background: var(--bg-surface-elevated);
    border-top: 1px solid var(--border-subtle);
    font-size: 12px;
    color: var(--text-faint);
}

/* Upload Progress Drawer */
.upload-drawer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 340px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft), var(--shadow-glow);
    z-index: 150;
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.upload-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-surface);
}

.upload-drawer-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}

.drawer-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
}

.upload-drawer-body {
    padding: 14px 16px;
}

.upload-progress-bar-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.upload-progress-bar-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 10px;
    transition: width 0.2s ease;
}

.upload-progress-details {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

#upload-current-file {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .header-left {
        max-width: 260px;
    }
    .app-header {
        padding: 0 14px;
    }
    .explorer-pane {
        padding: 14px;
    }
    .items-container.view-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    .list-table-header, .list-row {
        grid-template-columns: 32px 2fr 1fr 60px;
    }
    .list-date, .list-category {
        display: none;
    }
}
