:root {
    /* Light Theme Palette */
    --bg-base: #f4f6fa;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --bg-surface: #ffffff;
    --bg-hover: rgba(66, 133, 244, 0.08);
    --bg-input: #f0f2f5;
    
    --note-card: white;
    --note-shadow
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --border-color: rgba(226, 232, 240, 0.8);
    --border-glass: rgba(255, 255, 255, 0.5);
    
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    --accent-glow: rgba(79, 70, 229, 0.25);
    
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.06);
    --shadow-glass: 0 8px 32px rgba(31, 38, 135, 0.07);
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 999px;
}

body.dark-theme {
    /* Dark Theme Palette */
    --bg-base: #0f172a;
    --bg-glass: rgba(30, 41, 59, 0.7);
    --bg-surface: #1e293b;
    --bg-hover: rgba(255, 255, 255, 0.05);
    --bg-input: #0f172a;
    
    --note-card: #1E293B;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border-color: rgba(51, 65, 85, 0.8);
    --border-glass: rgba(255, 255, 255, 0.05);
    
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #2dd4bf 100%);
    --accent-glow: rgba(99, 102, 241, 0.3);
    
    --danger: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.1);
    
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.3);
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow: hidden;
}

/* Glassmorphism Utilities */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-glass);
}

/* Typography & Icons */
.gradient-icon {
    background: var(--icon-gradient, var(--accent-gradient));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* File Type Icon Colors */
.icon-folder { --icon-gradient: linear-gradient(135deg, #FDE047 0%, #F59E0B 100%); }
.icon-image { --icon-gradient: linear-gradient(135deg, #38BDF8 0%, #0284C7 100%); }
.icon-video { --icon-gradient: linear-gradient(135deg, #C084FC 0%, #7E22CE 100%); }
.icon-audio { --icon-gradient: linear-gradient(135deg, #FB7185 0%, #E11D48 100%); }
.icon-document { --icon-gradient: linear-gradient(135deg, #D8B4E2 0%, #A569BD 100%); }
.icon-note { --icon-gradient: linear-gradient(135deg, #4ade80 0%, #16a34a 100%); }

/* Base Buttons */
.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-btn:hover, .icon-btn.active {
    background: var(--bg-hover);
    color: var(--accent);
}

.btn-gradient {
    background: var(--accent-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 15px var(--accent-glow);
    transition: all 0.3s ease;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

/* Login Page */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-image: 
        radial-gradient(circle at 15% 50%, var(--accent-glow), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(6, 182, 212, 0.15), transparent 25%);
}

.theme-toggle-wrapper {
    position: absolute;
    top: 24px;
    right: 24px;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 48px;
    border-radius: var(--radius-lg);
    text-align: center;
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

.login-logo .material-icons-round {
    font-size: 64px;
    margin-bottom: 16px;
}

.login-container h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group .material-icons-round {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--accent-glow);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.error-toast {
    color: var(--danger);
    background: var(--danger-bg);
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* App Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 280px;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    z-index: 50;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-content {
    padding: 0 16px 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.new-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 32px;
    cursor: pointer;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-links li {
    display: flex;
    align-items: center;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-links li.active {
    background: var(--bg-hover);
    color: var(--accent);
}

.nav-links li:not(.active):hover {
    background: rgba(100, 116, 139, 0.05);
    color: var(--text-primary);
}

.nav-links li span:not(.material-icons-round), .nav-links li a span:not(.material-icons-round) {
    padding: 14px 16px 14px 0;
    flex: 1;
}

.nav-links li .material-icons-round {
    padding: 14px 16px;
}

.nav-spacer {
    flex: 1;
    pointer-events: none;
}

.logout-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-image: 
        radial-gradient(circle at 100% 0%, rgba(6, 182, 212, 0.05), transparent 30%),
        radial-gradient(circle at 0% 100%, var(--accent-glow), transparent 30%);
}

.topbar {
    position: relative;
    z-index: 1000;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
    gap: 16px;
}

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

.mobile-brand {
    display: none;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 20px;
    color: var(--text-primary);
}

.mobile-brand img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.mobile-menu-btn {
    display: none;
}

.search-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    padding: 0 20px;
    width: 100%;
    max-width: 560px;
    height: 48px;
    transition: all 0.3s ease;
}

.search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg-surface);
}

.search-bar .material-icons-round {
    color: var(--text-muted);
}

.search-bar input {
    border: none;
    background: transparent;
    width: 100%;
    padding: 8px 12px;
    font-size: 16px;
    color: var(--text-primary);
    outline: none;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.view-toggle {
    display: flex;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    padding: 4px;
}

/* Breadcrumbs */
.breadcrumbs-container {
    padding: 24px 32px 8px;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-secondary);
}

.breadcrumbs span[data-path] {
    cursor: pointer;
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.breadcrumbs span[data-path]:hover {
    background: var(--bg-hover);
}

/* Files Area */
.files-container {
    flex: 1;
    padding: 16px 32px 32px;
    overflow-y: auto;
    position: relative;
}

.drop-overlay {
    position: absolute;
    top: 16px; left: 32px; right: 32px; bottom: 32px;
    z-index: 10;
    border: 2px dashed var(--accent);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-glow);
}

.drop-content {
    text-align: center;
    pointer-events: none;
}

/* Grid View */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    align-content: start;
}

.file-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.file-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.file-item .material-icons-round {
    font-size: 56px;
    color: var(--accent);
    transition: transform 0.2s;
}

.file-item:hover .material-icons-round {
    transform: scale(1.05);
}

.file-item.dir .material-icons-round {
    color: var(--text-muted);
}

.file-name {
    font-weight: 500;
    font-size: 15px;
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* List View */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-list .file-item {
    flex-direction: row;
    padding: 12px 20px;
    justify-content: flex-start;
    height: auto;
}

.file-list .file-item:hover {
    transform: translateX(4px);
}

.file-list .file-item .material-icons-round {
    font-size: 28px;
}

.file-list .file-name {
    text-align: left;
}

/* Context Menu */
.context-menu {
    position: fixed;
    border-radius: var(--radius-md);
    padding: 8px;
    min-width: 180px;
    z-index: 1000;
    transform-origin: top left;
    animation: scaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleIn {
    0% { opacity: 0; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

.menu-item {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s;
}

.menu-item:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.menu-item.delete {
    color: var(--danger);
}

.menu-item.delete:hover {
    background: var(--danger-bg);
}

/* Loading */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.hidden {
    display: none !important;
}

/* Mobile Responsiveness */
.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .mobile-brand {
        display: flex;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        box-shadow: var(--shadow-glass);
    }

    .sidebar.open {
        transform: translateX(280px);
    }

    .sidebar-overlay.show {
        opacity: 1;
        pointer-events: auto;
    }

    .search-wrapper {
        position: absolute;
        top: 72px;
        left: 0; right: 0;
        padding: 12px 24px;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border-color);
        display: none;
        z-index: 30;
    }

    .search-wrapper.show {
        display: flex;
        animation: slideDown 0.2s ease-out;
    }

    @keyframes slideDown {
        0% { opacity: 0; transform: translateY(-10px); }
        100% { opacity: 1; transform: translateY(0); }
    }

    .breadcrumbs-container {
        padding: 16px 24px 8px;
    }
    
    .files-container {
        padding: 16px 24px 24px;
    }
}

/* Dropdown */
.new-dropdown-wrapper {
    position: relative;
}

.new-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 220px;
    border-radius: var(--radius-md);
    padding: 8px;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
    font-weight: 500;
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

/* Storage Bar */
.storage-info {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.storage-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.storage-used {
    height: 100%;
    background: var(--accent);
    border-radius: var(--radius-full);
    transition: width 0.5s ease, background-color 0.3s;
}

#storageText {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Preview Modal */
.preview-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.preview-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
}

.preview-container {
    position: relative;
    width: 90%;
    max-width: 1000px;
    height: 85vh;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Fullscreen PDF Mode */
.preview-modal.pdf-mode .preview-container {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

.preview-modal.pdf-mode .preview-header {
    background: rgba(32, 33, 36, 1);
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.preview-modal.pdf-mode .preview-header .icon-btn {
    color: #fff;
}

.preview-modal.pdf-mode .preview-header .icon-btn:hover {
    background: rgba(255,255,255,0.1);
}

.preview-modal.pdf-mode .preview-content {
    padding: 0;
}

.preview-modal.pdf-mode .preview-content iframe {
    border-radius: 0;
    background: #525659;
}

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

.preview-header h3 {
    font-weight: 600;
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.preview-actions {
    display: flex;
    gap: 8px;
}

.preview-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg-base);
    overflow: auto;
}

.preview-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.preview-content video, .preview-content audio {
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--radius-sm);
    outline: none;
}

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

/* Upload Progress */
.upload-progress-container {
    position: fixed;
    z-index: 3000;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 16px;
    width: 320px;
    box-shadow: var(--shadow-glass);
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: slideUpFade 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Desktop */
@media (min-width: 769px) {
    .upload-progress-container {
        bottom: 24px;
        right: 24px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .upload-progress-container {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        bottom: auto;
        right: auto;
        width: 85%;
        max-width: 320px;
    }
    
    @keyframes slideUpFadeMobile {
        0% { opacity: 0; transform: translate(-50%, -40%); }
        100% { opacity: 1; transform: translate(-50%, -50%); }
    }
    
    .upload-progress-container {
        animation: slideUpFadeMobile 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
}

.upload-progress-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.upload-progress-header .material-icons-round {
    color: var(--accent);
}

.upload-progress-bar-bg {
    width: 100%;
    height: 8px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    transition: width 0.2s ease-out;
}

.upload-progress-text {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: right;
    font-weight: 500;
}

/* Custom Media Player */
.custom-player-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.custom-player-wrapper.audio {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
}

.custom-media {
    width: 100%;
    max-height: 70vh;
    display: block;
    object-fit: contain;
}

.custom-player-wrapper.audio .custom-media {
    display: none;
}

.custom-controls {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 12px 16px;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    transition: opacity 0.3s, transform 0.3s;
}

.custom-player-wrapper.audio .custom-controls {
    position: relative;
    background: transparent;
    padding: 16px;
}

.custom-player-wrapper.video:not(:hover) .custom-controls {
    opacity: 0;
    transform: translateY(10px);
}

.progress-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    margin-bottom: 12px;
    cursor: pointer;
    position: relative;
}

.custom-player-wrapper.audio .progress-container {
    background: var(--bg-input);
}

.progress-filled {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    width: 0%;
    position: relative;
}

.progress-filled::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-container:hover .progress-filled::after {
    opacity: 1;
}

.controls-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
}

.custom-player-wrapper.audio .controls-main {
    color: var(--text-primary);
}

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

.control-btn {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    transition: color 0.2s, transform 0.2s;
}

.control-btn:hover {
    color: var(--accent);
    transform: scale(1.1);
}

.time-display {
    font-size: 13px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    opacity: 0.9;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
}

.custom-player-wrapper.audio .volume-slider {
    background: var(--bg-input);
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

.custom-player-wrapper.audio .volume-slider::-webkit-slider-thumb {
    background: var(--accent);
}

/* File Hover Details */
.file-item {
    position: relative;
    overflow: hidden;
}

.file-hover-details {
    position: absolute;
    bottom: 8px;
    left: 12px;
    right: 12px;
    font-size: 11px;
    color: var(--text-secondary);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    font-weight: 500;
}

.file-item:hover .file-hover-details {
    transform: translateY(0);
    opacity: 1;
}

/* Info Panel UI */
.preview-body-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

.preview-info-panel {
    width: 320px;
    background: var(--bg-surface);
    border-left: 1px solid var(--border-color);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 24px;
    gap: 24px;
    transition: transform 0.3s ease, margin-right 0.3s ease;
}

.info-thumbnail-wrapper {
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-base);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.info-thumbnail-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.info-thumbnail-wrapper .placeholder-icon {
    font-size: 64px;
    color: var(--text-muted);
}

.info-details-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-detail-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.info-detail-value {
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-all;
}

/* Custom Dialog Modal */
.dialog-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.custom-dialog {
    width: 90%;
    max-width: 400px;
    padding: 24px;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: scaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-dialog h3 {
    font-size: 20px;
    font-weight: 600;
}

.custom-dialog p {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.5;
}

.custom-dialog input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
}

.custom-dialog input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--bg-hover);
    color: var(--text-primary);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--border-color);
}

.dialog-actions .btn-primary {
    width: auto;
    padding: 10px 20px;
}

/* Rich Text Editor */
.editor-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.editor-wrapper .ql-toolbar {
    background: var(--bg-surface);
    border: none;
    border-bottom: 1px solid var(--border-color);
}
.editor-wrapper .ql-container {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    background: var(--bg-base);
    border: none;
}
.editor-wrapper .ql-editor {
    background: var(--bg-surface);
    width: 100%;
    max-width: 850px;
    margin: 24px auto;
    padding: 48px;
    box-shadow: var(--shadow-sm);
    min-height: 800px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.6;
}
.editor-wrapper .ql-stroke { stroke: var(--text-secondary); }
.editor-wrapper .ql-fill { fill: var(--text-secondary); }
.editor-wrapper .ql-picker { color: var(--text-secondary); }


/* Advanced Audio Player */
.adv-audio-player {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: #0f172a;
    color: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    font-family: 'Outfit', sans-serif;
}
.adv-audio-bg {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-size: cover;
    background-position: center;
    filter: blur(80px) opacity(0.4);
    z-index: 0;
    transition: background-image 1s ease;
}
.adv-audio-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 2vh 3vw;
    box-sizing: border-box;
    overflow: hidden;
}
.adv-audio-top {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2vh;
    min-height: 0;
}
.adv-album-art {
    width: 200px;
    height: 200px;
    max-width: 25vh;
    max-height: 25vh;
    aspect-ratio: 1/1;
    border-radius: 50%;
    background: #1e293b;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 0 8px #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    animation: spin 10s linear infinite;
    animation-play-state: paused;
}
.adv-album-art.playing {
    animation-play-state: running;
}
@keyframes spin {
    100% { transform: rotate(360deg); }
}
.adv-album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.adv-album-art .material-icons-round {
    font-size: 80px;
    color: rgba(255,255,255,0.2);
}
.adv-album-art::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background: #0f172a;
    border-radius: 50%;
    border: 2px solid #334155;
}
.adv-audio-info {
    text-align: center;
}
.adv-audio-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.adv-audio-artist {
    font-size: 16px;
    color: #94a3b8;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.adv-audio-visualizer {
    width: 100%;
    height: 40px;
    margin-top: 1vh;
    margin-bottom: 1vh;
    flex-shrink: 0;
}
.adv-audio-controls {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
    flex-shrink: 0;
}
.adv-timeline {
    display: flex;
    align-items: center;
    gap: 15px;
}
.adv-time {
    font-size: 13px;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
    min-width: 45px;
}
.adv-progress-container {
    flex: 1;
    height: 16px;
    background: transparent;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
}
.adv-progress-container::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}
.adv-progress-filled {
    height: 6px;
    background: var(--accent);
    border-radius: 3px;
    width: 0%;
    position: relative;
    pointer-events: none;
    z-index: 1;
}
.adv-progress-filled::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}
.adv-buttons {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.adv-buttons-left, .adv-buttons-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.adv-buttons-center {
    display: flex;
    align-items: center;
    gap: 20px;
}
.adv-btn {
    background: transparent;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.adv-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.adv-btn.active {
    color: var(--accent);
}
.adv-play-btn {
    width: 60px;
    height: 60px;
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 4px 15px var(--accent-glow);
}
.adv-play-btn:hover {
    transform: scale(1.05);
    background: var(--accent-gradient);
}
.adv-play-btn .material-icons-round {
    font-size: 32px;
}
.adv-volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 120px;
}
.adv-volume-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    outline: none;
}
.adv-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}
.adv-speed-btn {
    font-size: 14px;
    font-weight: 600;
    width: 40px;
}


/* --- Acrobite Notes --- */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    padding: 16px;
    align-items: start;
}

.note-card {
    background: var(--note-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    max-height: 250px;
    overflow: hidden;
    position: relative;
}

.note-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
    border-color: rgba(255,255,255,0.2);
}

.note-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-card-preview {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
}

.note-card-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 12px;
    text-align: right;
    opacity: 0.7;
}

/* Override Quill editor styles for dark glass theme */
#noteQuillEditor {
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
}
.ql-toolbar.ql-snow {
    border: none !important;
    border-bottom: 1px solid var(--glass-border) !important;
    background: rgba(255,255,255,0.05);
    border-radius: 12px 12px 0 0;
}
.ql-container.ql-snow {
    border: none !important;
}
.ql-snow .ql-stroke {
    stroke: var(--text-primary) !important;
}
.ql-snow .ql-fill, .ql-snow .ql-stroke.ql-fill {
    fill: var(--text-primary) !important;
}
.ql-snow .ql-picker {
    color: var(--text-primary) !important;
}

