/* =============================================
   DIMAR CLOUD - Global Design System
   =============================================
   Dark theme with blue/purple gradient accents,
   glassmorphism cards, and smooth animations.
   ============================================= */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ─────────────────────────── */
:root {
    /* Colors */
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2035;
    --bg-card: rgba(26, 32, 53, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-primary: #6C63FF;
    --accent-secondary: #7C3AED;
    --accent-gradient: linear-gradient(135deg, #6C63FF 0%, #7C3AED 50%, #A855F7 100%);
    --accent-gradient-hover: linear-gradient(135deg, #7C73FF 0%, #8C4AFD 50%, #B865FF 100%);
    
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 255, 255, 0.15);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(108, 99, 255, 0.3);
    
    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Spacing */
    --sidebar-width: 260px;
    --header-height: 70px;
}

/* ── Reset & Base ──────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background animated gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(108, 99, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(124, 58, 237, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(168, 85, 247, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    outline: none;
}

/* ── Scrollbar ─────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* ── Utility Classes ───────────────────────── */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
}

.glass:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-color-hover);
}

/* ── Button Styles ─────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}

.btn-primary:hover {
    background: var(--accent-gradient-hover);
    box-shadow: 0 6px 20px rgba(108, 99, 255, 0.4);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
    border-color: var(--border-color-hover);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.4);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.btn-icon.sm {
    width: 34px;
    height: 34px;
}

/* ── Dashboard Layout ──────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ── Sidebar ───────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-normal);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo .logo-icon {
    width: 42px;
    height: 42px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    box-shadow: var(--shadow-glow);
}

.sidebar-logo .logo-text {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-logo .logo-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    margin-bottom: 2px;
}

.nav-item i {
    font-size: 18px;
    width: 22px;
    text-align: center;
}

.nav-item:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(108, 99, 255, 0.12);
    color: var(--accent-primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent-gradient);
    border-radius: 0 4px 4px 0;
}

.nav-item .badge {
    margin-left: auto;
    background: rgba(108, 99, 255, 0.2);
    color: var(--accent-primary);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

/* Sidebar Storage */
.sidebar-storage {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.storage-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.storage-info .label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.storage-info .value {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.storage-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 8px;
}

.storage-bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
    min-width: 2%;
}

.storage-percent {
    font-size: 11px;
    color: var(--text-muted);
}

/* ── Main Content ──────────────────────────── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.main-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 18px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.menu-toggle:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.search-box {
    position: relative;
    width: 380px;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.header-btn:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
    border-color: var(--border-color-hover);
}

.user-menu {
    position: relative;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
}

.user-avatar:hover {
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-fast);
    z-index: 200;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
}

.user-dropdown-header .name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.user-dropdown-header .email {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.user-dropdown-item:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.user-dropdown-item.danger {
    color: var(--danger);
}

.user-dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.user-dropdown-item i {
    width: 18px;
    text-align: center;
    font-size: 15px;
}

/* ── Page Content ──────────────────────────── */
.page-content {
    flex: 1;
    padding: 32px;
}

.page-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

/* ── Stats Cards ───────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.stat-card.images::before { background: var(--info); }
.stat-card.videos::before { background: var(--danger); }
.stat-card.documents::before { background: var(--warning); }
.stat-card.audio::before { background: var(--success); }
.stat-card.total::before { background: var(--accent-gradient); }

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-color-hover);
}

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 14px;
}

.stat-card.images .stat-icon { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.stat-card.videos .stat-icon { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.stat-card.documents .stat-icon { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.stat-card.audio .stat-icon { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.stat-card.total .stat-icon { background: rgba(108, 99, 255, 0.15); color: var(--accent-primary); }

.stat-card .stat-value {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* ── Upload Area ───────────────────────────── */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    margin-bottom: 32px;
    position: relative;
    background: var(--bg-glass);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--accent-primary);
    background: rgba(108, 99, 255, 0.05);
    box-shadow: 0 0 30px rgba(108, 99, 255, 0.1);
}

.upload-area.dragover {
    transform: scale(1.01);
}

.upload-area .upload-icon {
    width: 72px;
    height: 72px;
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: white;
    margin: 0 auto 20px;
    box-shadow: var(--shadow-glow);
    transition: transform var(--transition-normal);
}

.upload-area:hover .upload-icon {
    transform: scale(1.05) translateY(-2px);
}

.upload-area .upload-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.upload-area .upload-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.upload-area .upload-formats {
    font-size: 12px;
    color: var(--text-muted);
}

.upload-area input[type="file"] {
    display: none;
}

/* Upload Progress */
.upload-progress-container {
    margin-bottom: 24px;
    display: none;
}

.upload-progress-container.show {
    display: block;
}

.upload-progress-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.upload-progress-item .file-icon {
    font-size: 22px;
    color: var(--accent-primary);
}

.upload-progress-item .file-info {
    flex: 1;
    min-width: 0;
}

.upload-progress-item .file-name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-progress-item .progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: 6px;
}

.upload-progress-item .progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.upload-progress-item .progress-text {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 40px;
    text-align: right;
}

.upload-progress-item .progress-status {
    font-size: 16px;
}

.upload-progress-item .progress-status.success { color: var(--success); }
.upload-progress-item .progress-status.error { color: var(--danger); }

/* ── File Grid ─────────────────────────────── */
.files-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.files-header .files-title {
    font-size: 18px;
    font-weight: 700;
}

.files-header .files-count {
    font-size: 13px;
    color: var(--text-muted);
    margin-left: 8px;
}

.view-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.view-toggle button {
    width: 34px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.view-toggle button.active {
    background: var(--accent-primary);
    color: white;
}

.view-toggle button:hover:not(.active) {
    color: var(--text-primary);
}

/* Grid View */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.file-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    group: true;
}

.file-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-color-hover);
}

.file-card .file-preview {
    width: 100%;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    position: relative;
    overflow: hidden;
}

.file-card .file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-card .file-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-card .file-preview .file-type-icon {
    font-size: 42px;
    color: var(--text-muted);
    opacity: 0.5;
}

.file-card .file-preview .file-ext-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
    backdrop-filter: blur(4px);
}

.file-card .file-actions-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.file-card:hover .file-actions-overlay {
    opacity: 1;
}

.file-action-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 15px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.file-action-btn:hover {
    background: var(--accent-primary);
    transform: scale(1.1);
}

.file-action-btn.delete:hover {
    background: var(--danger);
}

.file-card .file-details {
    padding: 14px;
}

.file-card .file-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

.file-card .file-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

/* List View */
.files-grid.list-view {
    grid-template-columns: 1fr;
    gap: 4px;
}

.files-grid.list-view .file-card {
    display: flex;
    align-items: center;
    border-radius: var(--radius-sm);
}

.files-grid.list-view .file-card:hover {
    transform: none;
}

.files-grid.list-view .file-preview {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: var(--radius-sm);
}

.files-grid.list-view .file-preview .file-type-icon {
    font-size: 22px;
}

.files-grid.list-view .file-preview .file-ext-badge {
    display: none;
}

.files-grid.list-view .file-details {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.files-grid.list-view .file-name {
    flex: 1;
    margin-bottom: 0;
}

.files-grid.list-view .file-meta {
    gap: 24px;
}

.files-grid.list-view .file-actions-overlay {
    position: relative;
    background: none;
    opacity: 1;
    right: 0;
    left: auto;
    top: auto;
    bottom: auto;
    width: auto;
    padding-right: 8px;
}

.files-grid.list-view .file-action-btn {
    background: transparent;
    color: var(--text-muted);
}

.files-grid.list-view .file-action-btn:hover {
    color: var(--accent-primary);
    background: rgba(108, 99, 255, 0.1);
}

.files-grid.list-view .file-action-btn.delete:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* ── Empty State ───────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .empty-icon {
    font-size: 64px;
    color: var(--text-muted);
    opacity: 0.3;
    margin-bottom: 20px;
}

.empty-state .empty-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.empty-state .empty-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

/* ── Preview Modal ─────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.modal-content img,
.modal-content video {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-md);
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 18px;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--danger);
}

.modal-filename {
    position: absolute;
    bottom: -36px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ── Loading Spinner ───────────────────────── */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.page-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
}

/* ── Sidebar Mobile Overlay ────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

/* ── Toast Notifications ───────────────────── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── Animations ────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

.animate-fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* ── Responsive ────────────────────────────── */
@media (max-width: 1024px) {
    .search-box {
        width: 280px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .main-header {
        padding: 0 16px;
    }
    
    .search-box {
        display: none;
    }
    
    .page-content {
        padding: 20px 16px;
    }
    
    .page-title {
        font-size: 22px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .upload-area {
        padding: 32px 20px;
    }
    
    .files-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .files-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .file-card .file-preview {
        height: 100px;
    }
}
