/* ==========================================================================
   Modern Cloud Web File Explorer - Premium Dark & Glassmorphism Design System
   ========================================================================== */

:root {
    --bg-main: #070b14;
    --bg-secondary: #0d1527;
    --bg-card: rgba(15, 23, 42, 0.75);
    --bg-card-hover: rgba(30, 41, 59, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(99, 102, 241, 0.6);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-indigo: #6366f1;
    --accent-indigo-light: #818cf8;
    --accent-indigo-glow: rgba(99, 102, 241, 0.35);
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px var(--accent-indigo-glow);
    
    --font-sans: 'Pretendard', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'Fira Code', 'JetBrains Mono', Consolas, monospace;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.6);
}
::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.4);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-indigo);
}

/* Background Glowing Orbs */
.app-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.25;
}
.bg-glow-1 {
    width: 500px;
    height: 500px;
    top: -100px;
    left: -100px;
    background: radial-gradient(circle, #4f46e5, transparent 70%);
}
.bg-glow-2 {
    width: 600px;
    height: 600px;
    bottom: -150px;
    right: -150px;
    background: radial-gradient(circle, #06b6d4, transparent 70%);
}
.bg-glow-3 {
    width: 400px;
    height: 400px;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, #8b5cf6, transparent 70%);
    opacity: 0.15;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* ==========================================================================
   1. LOGIN VIEW
   ========================================================================== */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(7, 11, 20, 0.85);
    backdrop-filter: blur(20px);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 40px 32px;
    position: relative;
    z-index: 10;
    border: 1px solid rgba(99, 102, 241, 0.25);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: scaleIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.login-icon-box {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(6, 182, 212, 0.2));
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-indigo-light);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.login-icon-box svg {
    width: 32px;
    height: 32px;
}

.login-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.badge-readonly-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 9999px;
}

.login-form .input-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    width: 100%;
    padding: 14px 44px 14px 16px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 1rem;
    font-family: var(--font-sans);
    letter-spacing: 2px;
    transition: all 0.2s ease;
}

.password-input-wrapper input:focus {
    outline: none;
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
    background: rgba(15, 23, 42, 0.95);
}

.btn-icon-addon {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.2s;
}
.btn-icon-addon:hover {
    color: var(--text-primary);
}
.btn-icon-addon svg {
    width: 20px;
    height: 20px;
}

.error-banner {
    padding: 10px 14px;
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #fda4af;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 16px;
    text-align: center;
}

.btn-primary-glow {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--accent-indigo), #4f46e5);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    transition: all 0.2s ease;
}
.btn-primary-glow:hover {
    background: linear-gradient(135deg, var(--accent-indigo-light), var(--accent-indigo));
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.6);
    transform: translateY(-1px);
}
.btn-primary-glow svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}
.btn-primary-glow:hover svg {
    transform: translateX(4px);
}

.login-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   2. MAIN EXPLORER VIEW & HEADER
   ========================================================================== */
.explorer-view {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 16px 24px;
    gap: 16px;
}

.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-radius: var(--radius-lg);
    gap: 16px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-branding {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-badge {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}
.logo-badge svg {
    width: 22px;
    height: 22px;
}

.branding-text .title {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}
.branding-text .subtitle {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.badge-readonly-header {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 9999px;
}
.badge-readonly-header svg {
    width: 14px;
    height: 14px;
}

/* Nav Center: Search Bar */
.nav-center {
    flex: 1;
    max-width: 520px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box .search-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 10px 75px 10px 42px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 0.9rem;
    font-family: var(--font-sans);
    transition: all 0.2s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-indigo);
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-kbd {
    position: absolute;
    right: 12px;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.clear-search-btn {
    position: absolute;
    right: 64px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 2px 6px;
}
.clear-search-btn:hover {
    color: #fff;
}

/* Nav Right: Actions */
.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-control, .btn-view-toggle, .btn-logout {
    height: 38px;
    padding: 0 12px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-control svg, .btn-view-toggle svg, .btn-logout svg {
    width: 18px;
    height: 18px;
}

.btn-control:hover, .btn-view-toggle:hover {
    background: rgba(51, 65, 85, 0.8);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.15);
}

.view-toggle-group {
    display: flex;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 2px;
    gap: 2px;
}

.view-toggle-group .btn-view-toggle {
    border: none;
    background: transparent;
    padding: 0 8px;
    height: 32px;
    border-radius: 6px;
}

.view-toggle-group .btn-view-toggle.active {
    background: var(--accent-indigo);
    color: #fff;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
}

.btn-logout {
    background: rgba(244, 63, 94, 0.1);
    border-color: rgba(244, 63, 94, 0.25);
    color: #fb7185;
}
.btn-logout:hover {
    background: rgba(244, 63, 94, 0.25);
    color: #fff;
    border-color: rgba(244, 63, 94, 0.4);
}

/* ==========================================================================
   3. TOOLBAR (BREADCRUMBS & FILTERS)
   ========================================================================== */
.toolbar-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.breadcrumb-container {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    gap: 10px;
    overflow-x: auto;
}

.btn-icon-back, .btn-copy-path {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}
.btn-icon-back:hover:not(:disabled), .btn-copy-path:hover {
    background: rgba(51, 65, 85, 0.8);
    color: #fff;
}
.btn-icon-back:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.btn-icon-back svg, .btn-copy-path svg {
    width: 16px;
    height: 16px;
}

.breadcrumbs-list {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 6px;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow-x: auto;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.breadcrumb-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.breadcrumb-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.breadcrumb-item.active .breadcrumb-link {
    color: var(--accent-indigo-light);
    font-weight: 600;
    background: rgba(99, 102, 241, 0.12);
}
.breadcrumb-sep {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Filters Bar */
.filters-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.chip {
    padding: 6px 14px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.chip:hover {
    background: rgba(30, 41, 59, 0.8);
    color: #fff;
}
.chip.active {
    background: var(--accent-indigo);
    color: #fff;
    border-color: var(--accent-indigo);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-label {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.select-modern {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 6px 12px;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.2s;
}
.select-modern:focus {
    outline: none;
    border-color: var(--accent-indigo);
}
.select-modern option {
    background: #0f172a;
    color: #fff;
}

/* ==========================================================================
   4. CONTENT MAIN (GRID & LIST VIEWS)
   ========================================================================== */
.content-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    gap: 16px;
    color: var(--text-secondary);
}

.loading-ring {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--accent-indigo);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}
.empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}
.empty-state h3 {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 6px;
}

/* 4.1 Grid View */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
}

.file-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
    position: relative;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.file-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), 0 0 15px rgba(99, 102, 241, 0.15);
}

.file-card.is-dir {
    border-left: 3px solid var(--accent-indigo);
}

.file-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-icon-box {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.file-category-badge {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

.cat-folder { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.cat-code { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }
.cat-image { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
.cat-text { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.cat-document { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.cat-media { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.cat-archive { background: rgba(16, 185, 129, 0.15); color: #34d399; }

.file-card-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-card-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: #fff;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}

.file-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.file-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-card-action {
    flex: 1;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    transition: all 0.18s ease;
}
.btn-card-action:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #fff;
    border-color: var(--accent-indigo);
}
.btn-card-action svg {
    width: 14px;
    height: 14px;
}

/* 4.2 List / Table View */
.file-table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

.file-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.file-table th {
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    user-select: none;
}
.file-table th:hover {
    color: #fff;
}

.file-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    vertical-align: middle;
}

.file-table tr {
    transition: background-color 0.15s ease;
    cursor: pointer;
}
.file-table tr:hover td {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
}

.table-cell-name {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-weight: 500;
}
.table-file-icon {
    font-size: 1.2rem;
}

.table-cell-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-table-action {
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}
.btn-table-action:hover {
    background: var(--accent-indigo);
    color: #fff;
    border-color: var(--accent-indigo);
}
.btn-table-action svg {
    width: 13px;
    height: 13px;
}

/* ==========================================================================
   5. STATUS BAR
   ========================================================================== */
.status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.status-left, .status-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.success-pill {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.2);
}

.status-path {
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

/* ==========================================================================
   6. MODAL SYSTEM (VIEWERS & INFO)
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(3, 7, 18, 0.88);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    transition: opacity 0.25s ease;
}

.modal-window {
    width: 100%;
    max-width: 1050px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #0d1527;
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: var(--shadow-lg), 0 0 35px rgba(0, 0, 0, 0.7);
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid var(--border-color);
    gap: 16px;
}

.modal-title-box {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.modal-file-icon {
    font-size: 1.5rem;
}
.modal-title-text h3 {
    font-size: 1.05rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.modal-meta-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

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

.btn-modal-action {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-modal-action:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: var(--accent-indigo);
    color: #fff;
}
.btn-modal-action svg {
    width: 15px;
    height: 15px;
}

.btn-download {
    background: linear-gradient(135deg, var(--accent-indigo), #4f46e5);
    border: none;
}
.btn-download:hover {
    background: linear-gradient(135deg, var(--accent-indigo-light), var(--accent-indigo));
}

.btn-modal-close {
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.2s;
}
.btn-modal-close:hover {
    background: rgba(244, 63, 94, 0.2);
    border-color: var(--accent-rose);
    color: #fff;
}

.modal-body {
    flex: 1;
    overflow: auto;
    position: relative;
    padding: 0;
    max-height: calc(90vh - 70px);
}

/* Code Viewer Styles */
.viewer-container {
    width: 100%;
    min-height: 250px;
}

#modalCodeContainer pre {
    margin: 0;
    padding: 16px 20px;
    background: #090d16 !important;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    line-height: 1.6;
    overflow-x: auto;
}

#modalCodeContainer.word-wrap pre {
    white-space: pre-wrap !important;
    word-break: break-all;
}

/* Markdown Viewer Styles */
.markdown-body {
    padding: 28px 32px;
    background: #090d16;
    color: #e2e8f0;
    line-height: 1.7;
}
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    color: #fff;
    margin-top: 24px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
}
.markdown-body p, .markdown-body ul, .markdown-body ol {
    margin-bottom: 16px;
}
.markdown-body pre {
    background: #0f172a;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    margin-bottom: 16px;
}
.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}
.markdown-body th, .markdown-body td {
    border: 1px solid var(--border-color);
    padding: 8px 12px;
}
.markdown-body th {
    background: rgba(255, 255, 255, 0.05);
}

/* Image Viewer Styles */
.image-viewer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: #060911;
    min-height: 350px;
}
.image-viewer img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    object-fit: contain;
}

/* Media Viewer Styles */
.media-viewer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: #060911;
}
.media-viewer video {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-md);
    background: #000;
}
.media-viewer audio {
    width: 100%;
    max-width: 500px;
}

/* PDF Viewer */
.pdf-viewer iframe {
    width: 100%;
    height: 75vh;
    border: none;
}

/* Unsupported Container */
.unsupported-viewer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}
.unsupported-box {
    text-align: center;
    max-width: 440px;
}
.unsupported-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
}
.unsupported-box h4 {
    font-size: 1.15rem;
    color: #fff;
    margin-bottom: 8px;
}
.unsupported-box p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Info Modal */
.info-window {
    max-width: 540px;
}
.info-body {
    padding: 20px;
}
.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.info-table th {
    text-align: left;
    padding: 10px 12px;
    color: var(--text-muted);
    width: 35%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.info-table td {
    padding: 10px 12px;
    color: #fff;
    font-family: var(--font-mono);
    word-break: break-all;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   7. TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 18px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--accent-indigo);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 0.85rem;
    box-shadow: var(--shadow-lg), 0 0 15px rgba(99, 102, 241, 0.3);
    animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

/* ==========================================================================
   8. ANIMATIONS & UTILITIES
   ========================================================================== */
.hidden {
    display: none !important;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.94) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

.shake {
    animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .explorer-view {
        padding: 10px;
    }
    .top-nav {
        flex-direction: column;
        align-items: stretch;
    }
    .nav-left, .nav-right {
        justify-content: space-between;
    }
    .nav-center {
        max-width: 100%;
    }
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    .modal-backdrop {
        padding: 10px;
    }
}
