/* ================================================
   MediaHa - Liquid Glass Design System
   ================================================ */

/* ================================================
   Auth / Login Page
   ================================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    position: relative;
    z-index: 1;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur-strong);
    -webkit-backdrop-filter: var(--glass-blur-strong);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow-lg);
    padding: var(--space-xl);
    color: var(--color-text);
}

.auth-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.auth-logo {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-primary) 0%, #818cf8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.08em;
    font-size: 0.85rem;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

.auth-title {
    margin: 0;
    font-size: var(--font-size-2xl);
    font-weight: 700;
}

.auth-subtitle {
    margin: 2px 0 0 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.auth-error {
    min-height: 1.2em;
    font-size: var(--font-size-sm);
    color: var(--error-text);
}

.auth-submit {
    width: 100%;
    margin-top: var(--space-sm);
}

.auth-hint {
    margin-top: var(--space-sm);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* Music Player Styles */
.music-player-container {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-lg);
}

.now-playing-section {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.music-cover-large {
    width: 180px;
    height: 180px;
    border-radius: var(--radius-xl);
    object-fit: cover;
    background: var(--glass-bg);
    box-shadow: var(--glass-shadow-lg);
    border: 1px solid var(--glass-border);
}

.now-playing-info {
    flex: 1;
}

.music-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 var(--space-xs);
    color: var(--color-text);
}

.music-artist {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    margin: 0;
}

.music-progress-container {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.music-time {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    min-width: 45px;
    font-variant-numeric: tabular-nums;
}

.music-progress-bar {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--color-border);
    border-radius: 3px;
    cursor: pointer;
}

.music-progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--color-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.4);
    transition: transform 0.15s ease;
}

.music-progress-bar::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.music-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.music-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: 50%;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.music-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.music-btn.active {
    color: var(--color-primary);
    opacity: 1;
}

.music-btn.active-one {
    color: var(--color-primary);
    opacity: 1;
}

.music-btn-large {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, #818cf8 100%);
    color: white;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.music-btn-large:hover {
    background: linear-gradient(135deg, var(--color-primary-hover) 0%, var(--color-primary) 100%);
    transform: scale(1.05);
}

.music-volume-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.music-volume-icon {
    font-size: 24px;
    font-family: 'Material Icons';
    font-weight: normal;
}

.music-volume-slider {
    width: 120px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--color-border);
    border-radius: 2px;
    cursor: pointer;
}

.music-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--color-primary);
    border-radius: 50%;
    cursor: pointer;
}

.music-o3ics-container {
    height: 200px;
    overflow-y: auto;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.music-o3ics {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.music-o3ics .o3ic-line {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 1rem;
    color: var(--color-text-secondary);
    transition: all 0.3s ease;
    text-align: center;
}

.music-o3ics .o3ic-line.active {
    background: var(--color-primary);
    color: white;
    font-weight: 600;
    transform: scale(1.05);
}

.music-o3ics .no-o3ics {
    text-align: center;
    color: var(--color-text-muted);
    font-style: italic;
}

.playlist-section {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.playlist-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 var(--space-md);
    color: var(--color-text);
}

.playlist-container {
    max-height: 300px;
    overflow-y: auto;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.playlist-item:hover {
    background: var(--color-surface);
}

.playlist-item.active {
    background: var(--color-primary-light);
    border-left: 3px solid var(--color-primary);
}

.playlist-item-index {
    width: 24px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.playlist-item-title {
    flex: 1;
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item-artist {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

/* Mini Player Widget */
.mini-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(30, 41, 59, 0.72);
    backdrop-filter: var(--glass-blur-strong);
    -webkit-backdrop-filter: var(--glass-blur-strong);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: var(--space-md) var(--space-xl);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    z-index: 1000;
}

.mini-player.hidden {
    display: none;
}

/* Mini Player Toggle Button (floating) */
.mini-player-toggle-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.9) 0%, rgba(129, 140, 248, 0.85) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.35);
    cursor: pointer;
    font-size: 22px;
    box-shadow: var(--glass-shadow-lg), 0 8px 24px rgba(99, 102, 241, 0.4);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mini-player-toggle-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5);
}

.mini-player-toggle-btn:active {
    transform: translateY(0) scale(0.98);
}

.mini-player-toggle-btn.hidden {
    display: none;
}

.mini-player.hidden {
    display: none;
}

.mini-player-content {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    max-width: 900px;
    margin: 0 auto;
}

.mini-cover {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    object-fit: cover;
    background: var(--hover-bg);
}

.mini-info {
    flex: 1;
    min-width: 0;
}

.mini-title {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-artist {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-controls {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.mini-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: 50%;
    transition: all 0.2s ease;
    opacity: 0.9;
}

.mini-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.mini-btn-play {
    font-size: 1.5rem;
}

.mini-progress-container {
    flex: 1;
    max-width: 200px;
}

.mini-progress-bar {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
}

.mini-progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

.mini-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    cursor: pointer;
    padding: var(--space-xs);
    transition: color 0.2s ease;
}

.mini-close:hover {
    color: white;
}

/* Responsive Mini Player */
@media (max-width: 600px) {
    .mini-player {
        padding: var(--space-sm) var(--space-md);
    }

    .mini-player-content {
        gap: var(--space-sm);
    }

    .mini-cover {
        width: 40px;
        height: 40px;
    }

    .mini-progress-container {
        display: none;
    }

    .mini-info {
        max-width: 100px;
    }
}

/* CSS Variables - Liquid Glass Design Tokens */
:root {
    /* Accent */
    --color-primary: #6366f1;
    --color-primary-hover: #4f46e5;
    --color-primary-light: rgba(99, 102, 241, 0.25);
    --color-secondary: #22d3ee;
    --color-success: #34d399;
    --color-warning: #fbbf24;
    --color-error: #f87171;

    /* Mesh background */
    --mesh-1: #c7d2fe;
    --mesh-2: #ddd6fe;
    --mesh-3: #e0f2fe;
    --mesh-4: #fce7f3;

    /* Text */
    --color-bg: transparent;
    --color-surface: rgba(255, 255, 255, 0.55);
    --color-surface-elevated: rgba(255, 255, 255, 0.72);
    --color-text: #0f172a;
    --color-text-secondary: #475569;
    --color-text-muted: #64748b;
    --color-border: rgba(255, 255, 255, 0.45);
    --color-border-light: rgba(255, 255, 255, 0.25);

    /* Liquid glass */
    --glass-bg: rgba(255, 255, 255, 0.5);
    --glass-bg-strong: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.55);
    --glass-border-subtle: rgba(255, 255, 255, 0.3);
    --glass-blur: blur(20px) saturate(180%);
    --glass-blur-strong: blur(32px) saturate(200%);
    --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.65);
    --glass-shadow-lg: 0 24px 64px rgba(31, 38, 135, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.75);

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-bg: rgba(255, 255, 255, 0.42);
    --sidebar-active: rgba(99, 102, 241, 0.22);

    /* Modals */
    --modal-overlay: rgba(15, 23, 42, 0.45);
    --modal-bg: rgba(255, 255, 255, 0.75);
    --modal-header-bg: rgba(255, 255, 255, 0.35);

    /* Interactive */
    --hover-bg: rgba(99, 102, 241, 0.12);
    --active-bg: rgba(99, 102, 241, 0.2);

    /* Inputs */
    --input-bg: rgba(255, 255, 255, 0.55);
    --input-border: rgba(255, 255, 255, 0.5);
    --input-focus: var(--color-primary);

    /* Context Menu */
    --context-menu-bg: rgba(255, 255, 255, 0.82);
    --context-menu-hover: var(--color-primary);
    --context-menu-hover-text: #ffffff;

    /* Status */
    --info-bg: rgba(255, 255, 255, 0.4);
    --success-bg: rgba(52, 211, 153, 0.2);
    --success-text: #047857;
    --error-bg: rgba(248, 113, 113, 0.2);
    --error-text: #b91c1c;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    
    /* Radii */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    
    /* Z-index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal-backdrop: 300;
    --z-modal: 400;
    --z-tooltip: 500;
}

/* Dark Theme */
[data-theme="dark"] {
    --mesh-1: #312e81;
    --mesh-2: #1e1b4b;
    --mesh-3: #0c4a6e;
    --mesh-4: #831843;

    --color-surface: rgba(30, 41, 59, 0.55);
    --color-surface-elevated: rgba(51, 65, 85, 0.65);
    --color-text: #f1f5f9;
    --color-text-secondary: #cbd5e1;
    --color-text-muted: #94a3b8;
    --color-border: rgba(255, 255, 255, 0.12);
    --color-border-light: rgba(255, 255, 255, 0.06);

    --glass-bg: rgba(30, 41, 59, 0.45);
    --glass-bg-strong: rgba(51, 65, 85, 0.65);
    --glass-border: rgba(255, 255, 255, 0.14);
    --glass-border-subtle: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    --glass-shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);

    --sidebar-bg: rgba(15, 23, 42, 0.55);
    --sidebar-active: rgba(99, 102, 241, 0.28);

    --modal-overlay: rgba(0, 0, 0, 0.55);
    --modal-bg: rgba(30, 41, 59, 0.82);
    --modal-header-bg: rgba(51, 65, 85, 0.4);

    --hover-bg: rgba(99, 102, 241, 0.18);
    --active-bg: rgba(99, 102, 241, 0.3);

    --input-bg: rgba(15, 23, 42, 0.6);
    --input-border: rgba(255, 255, 255, 0.15);

    --context-menu-bg: rgba(30, 41, 59, 0.88);

    --info-bg: rgba(255, 255, 255, 0.06);
    --success-bg: rgba(52, 211, 153, 0.15);
    --success-text: #6ee7b7;
    --error-bg: rgba(248, 113, 113, 0.15);
    --error-text: #fca5a5;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.4);
    --shadow-md: 0 4px 12px rgb(0 0 0 / 0.35);
    --shadow-lg: 0 12px 24px rgb(0 0 0 / 0.4);
    --shadow-xl: 0 24px 48px rgb(0 0 0 / 0.5);
}

/* ================================================
   Base Styles
   ================================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: #e8ecf4;
    color: var(--color-text);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    transition: color var(--transition-slow);
    line-height: 1.5;
    position: relative;
    overflow-x: hidden;
}

/* Animated mesh background */
.liquid-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background:
        radial-gradient(ellipse 80% 60% at 10% 20%, var(--mesh-1) 0%, transparent 50%),
        radial-gradient(ellipse 70% 50% at 90% 10%, var(--mesh-2) 0%, transparent 45%),
        radial-gradient(ellipse 60% 70% at 70% 80%, var(--mesh-3) 0%, transparent 50%),
        radial-gradient(ellipse 50% 50% at 20% 90%, var(--mesh-4) 0%, transparent 45%),
        linear-gradient(160deg, #e2e8f0 0%, #f1f5f9 50%, #e0e7ff 100%);
}

[data-theme="dark"] .liquid-bg {
    background:
        radial-gradient(ellipse 80% 60% at 10% 20%, var(--mesh-1) 0%, transparent 50%),
        radial-gradient(ellipse 70% 50% at 90% 10%, var(--mesh-2) 0%, transparent 45%),
        radial-gradient(ellipse 60% 70% at 70% 80%, var(--mesh-3) 0%, transparent 50%),
        radial-gradient(ellipse 50% 50% at 20% 90%, var(--mesh-4) 0%, transparent 45%),
        linear-gradient(160deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}

.liquid-bg::before {
    content: '';
    position: absolute;
    width: 120%;
    height: 120%;
    top: -10%;
    left: -10%;
    background: inherit;
    filter: blur(60px);
    opacity: 0.85;
    animation: meshDrift 25s ease-in-out infinite alternate;
}

@keyframes meshDrift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(3%, 2%) scale(1.05); }
}

/* App Layout */
#app {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ================================================
   Sidebar
   ================================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: var(--z-sticky);
    transition: transform var(--transition-slow), background-color var(--transition-slow);
}

.sidebar-header {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--color-border-light);
}

.sidebar-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
    letter-spacing: -0.025em;
}

.sidebar-subtitle {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
}

.sidebar-nav {
    flex: 1;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.sidebar-nav li {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.sidebar-nav li:hover {
    background: var(--hover-bg);
    color: var(--color-text);
}

.sidebar-nav li.active {
    background: var(--sidebar-active);
    color: var(--color-primary);
    border: 1px solid var(--glass-border-subtle);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.sidebar-nav li .nav-icon {
    font-size: 24px;
    width: 28px;
    height: 24px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Material Icons';
    font-weight: normal;
}

/* Theme Toggle */
.theme-toggle {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    color: var(--color-text);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: var(--font-size-lg);
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.theme-toggle:hover {
    background: var(--glass-bg-strong);
    transform: scale(1.05);
}

/* ================================================
   Main Content Area
   ================================================ */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--space-xl);
    transition: margin var(--transition-slow);
}

.page-header {
    margin-bottom: var(--space-xl);
}

.page-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 var(--space-sm) 0;
    letter-spacing: -0.025em;
}

.page-subtitle {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
}

/* ================================================
   File Browser
   ================================================ */
.breadcrumb {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-lg);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-md);
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.breadcrumb .crumb {
    color: var(--color-primary);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.breadcrumb .crumb:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

.breadcrumb .crumb-separator {
    color: var(--color-text-muted);
}

.file-browser {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    min-height: 60vh;
    max-height: 75vh;
    overflow-y: auto;
    box-shadow: var(--glass-shadow);
}

.file-item {
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    transition: background var(--transition-fast);
    user-select: none;
}

.file-item:last-child {
    border-bottom: none;
}

.file-item:hover {
    background: var(--hover-bg);
}

.file-item.selected {
    background: var(--active-bg);
}

.file-item .icon {
    font-size: var(--font-size-xl);
    width: 32px;
    text-align: center;
    flex-shrink: 0;
}

.file-item .item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.file-item .item-meta {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* ================================================
   Buttons
   ================================================ */
.btn {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: var(--font-size-sm);
    cursor: pointer;
    border: none;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, #818cf8 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-primary-hover) 0%, var(--color-primary) 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.btn-secondary {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    color: var(--color-text);
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-secondary:hover {
    background: var(--glass-bg-strong);
}

.btn-success {
    background: var(--color-success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.enhance-status {
    font-size: 12px;
    color: var(--color-success);
    padding: 4px 8px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 4px;
}

/* Enhance Preview Styles */
.enhance-preview-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.enhance-item {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--glass-shadow);
}

.enhance-item-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.enhance-item-label {
    font-weight: 600;
    color: var(--color-text);
}

.enhance-source-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    background: var(--color-primary);
    color: white;
    opacity: 0;
    transition: opacity 0.2s;
}

.enhance-source-badge.visible {
    opacity: 1;
}

.enhance-source-badge.itunes {
    background: #FC3C44;
}

.enhance-source-badge.lrclib {
    background: #6366f1;
}

.enhance-source-badge.local {
    background: var(--color-success);
}

/* Refresh enhance button */
.refresh-enhance-btn {
    margin-left: auto;
    padding: 4px;
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.refresh-enhance-btn:hover {
    background: var(--hover-bg);
    color: var(--color-primary);
}

.refresh-enhance-btn .material-icons {
    font-size: 16px;
}

.refresh-enhance-btn.loading .material-icons {
    animation: spin 1s linear infinite;
}

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

.enhance-compare {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}

.enhance-compare-cover {
    justify-content: center;
}

.enhance-original,
.enhance-new {
    flex: 1;
    padding: var(--space-sm);
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    text-align: center;
}

.enhance-label {
    display: block;
    font-size: 11px;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
}

.enhance-value {
    color: var(--color-text);
    word-break: break-word;
}

.enhance-arrow {
    color: var(--color-primary);
    font-size: 18px;
    font-weight: bold;
}

.enhance-cover-preview {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin: 0 auto;
    display: none;
    position: relative;
    z-index: 1;
}

.enhance-cover-preview.has-image {
    display: block;
    border: none;
}

.enhance-cover-placeholder {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    margin: 0 auto;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    color: var(--text-muted);
    font-size: 24px;
}

.enhance-cover-placeholder.show {
    display: flex;
}

/* Cover Source Selector */
.cover-source-selector {
    margin-bottom: var(--space-sm);
}

.cover-source-options {
    display: flex;
    gap: var(--space-xs);
    justify-content: center;
    flex-wrap: wrap;
}

.cover-source-btn {
    font-size: 11px;
    padding: 2px 8px;
}

.cover-source-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Cover Options Container */
.cover-options-container {
    margin-top: var(--space-sm);
    padding: var(--space-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.cover-options-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
    text-align: center;
}

.cover-options-list {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    flex-wrap: wrap;
}

.cover-option-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.cover-option-item:hover {
    background: var(--hover-bg);
}

.cover-option-item.selected {
    background: rgba(79, 70, 229, 0.2);
}

.cover-option-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
}

.cover-option-item.selected .cover-option-thumb {
    border-color: var(--color-primary);
}

.cover-option-source {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Lyrics Source Selector */
.o3ics-source-selector {
    margin-bottom: var(--space-sm);
}

.o3ics-source-options {
    display: flex;
    gap: var(--space-xs);
    justify-content: center;
    flex-wrap: wrap;
}

.o3ics-source-btn {
    font-size: 11px;
    padding: 2px 8px;
}

.o3ics-source-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Lyrics Options Container */
.o3ics-options-container {
    margin-top: var(--space-sm);
    padding: var(--space-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    max-height: 150px;
    overflow-y: auto;
}

.o3ics-options-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
    text-align: center;
}

.o3ics-options-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.o3ics-option-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 4px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 11px;
}

.o3ics-option-item:hover {
    background: var(--hover-bg);
}

.o3ics-option-item.selected {
    background: rgba(79, 70, 229, 0.2);
}

.o3ics-option-source {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    min-width: 60px;
}

.o3ics-option-preview {
    flex: 1;
    font-size: 10px;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.enhance-original,
.enhance-new {
    position: relative;
}

.enhance-lrc-preview {
    max-height: 60px;
    overflow: hidden;
    font-size: 12px;
    color: var(--color-text-secondary);
    white-space: pre-wrap;
    text-align: left;
}

.enhance-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
}

.enhance-actions .btn {
    flex: 1;
    max-width: 150px;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--color-text);
}

.btn-outline:hover {
    background: var(--hover-bg);
}

.btn-danger {
    background: var(--color-error);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
}

.btn-ghost:hover {
    background: var(--hover-bg);
    color: var(--color-text);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-full);
}

/* ================================================
   Forms
   ================================================ */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--color-text);
    margin-bottom: var(--space-xs);
}

.form-input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    background: var(--input-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--color-text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    font-family: inherit;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.form-input:focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Modern Form Styles */
.modern-form {
    display: grid;
    gap: var(--space-md);
    max-width: 600px;
}

.form-group-modern {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-label-modern {
    font-weight: 600;
    color: var(--color-text);
    font-size: var(--font-size-sm);
}

.form-control-modern {
    padding: 10px 12px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    background: var(--input-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--color-text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
    font-family: inherit;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.form-control-modern:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.form-actions-modern {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.btn-run-modern {
    padding: var(--space-md) var(--space-lg);
    font-size: var(--font-size-lg);
    border-radius: var(--radius-lg);
    font-weight: 600;
    background: var(--color-success);
    color: white;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-run-modern:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-save-modern {
    padding: var(--space-md) var(--space-lg);
    font-size: var(--font-size-lg);
    border-radius: var(--radius-lg);
    font-weight: 600;
    background: var(--color-primary);
    color: white;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-save-modern:hover {
    background: var(--color-primary-hover);
}

/* ================================================
   Modals
   ================================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--modal-overlay);
    z-index: var(--z-modal-backdrop);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
}

.modal {
    background: var(--modal-bg);
    backdrop-filter: var(--glass-blur-strong);
    -webkit-backdrop-filter: var(--glass-blur-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow-lg);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: var(--space-md) var(--space-lg);
    background: var(--modal-header-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-lg);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--hover-bg);
    color: var(--color-text);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
}

.modal-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
}

/* Preview Modal Specific */
#preview-modal {
    position: fixed;
    top: 5%;
    left: 5%;
    right: 5%;
    bottom: 5%;
    background: var(--modal-bg);
    backdrop-filter: var(--glass-blur-strong);
    -webkit-backdrop-filter: var(--glass-blur-strong);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow-lg);
    z-index: var(--z-modal);
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-xl);
    overflow: hidden;
}

#preview-modal.hidden {
    display: none;
}

/* Image Preview Modal */
#image-preview-modal {
    position: fixed;
    top: 5%;
    left: 5%;
    right: 5%;
    bottom: 5%;
    background: var(--modal-bg);
    backdrop-filter: var(--glass-blur-strong);
    -webkit-backdrop-filter: var(--glass-blur-strong);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow-lg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-xl);
    overflow: hidden;
}

#image-preview-modal.hidden {
    display: none;
}

#image-preview-header {
    padding: var(--space-md);
    background: var(--modal-header-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
}

#image-preview-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    overflow: auto;
}

#image-preview-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-md);
}

.enhance-cover-preview.clickable {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.enhance-cover-preview.clickable:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

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

#preview-content {
    flex: 1;
    overflow: hidden;
    background: var(--color-bg);
}

/* Video Modal */
#video-modal {
    position: fixed;
    top: 5%;
    left: 5%;
    right: 5%;
    bottom: 5%;
    background: var(--modal-bg);
    backdrop-filter: var(--glass-blur-strong);
    -webkit-backdrop-filter: var(--glass-blur-strong);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow-lg);
    z-index: var(--z-modal);
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-xl);
    overflow: hidden;
}

#video-modal.hidden {
    display: none;
}

#video-header {
    padding: var(--space-md);
    background: var(--modal-header-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
}

#video-content {
    flex: 1;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#video-player {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
}

#video-actions {
    padding: var(--space-md);
    background: var(--modal-header-bg);
    text-align: center;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

/* MP3 Modal */
#mp3-modal {
    position: fixed;
    top: 5%;
    left: 5%;
    right: 5%;
    bottom: 5%;
    background: var(--modal-bg);
    backdrop-filter: var(--glass-blur-strong);
    -webkit-backdrop-filter: var(--glass-blur-strong);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow-lg);
    z-index: var(--z-modal);
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-xl);
    overflow: hidden;
}

#mp3-modal.hidden {
    display: none;
}

#mp3-header {
    padding: var(--space-md);
    background: var(--modal-header-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
}

#mp3-content {
    flex: 1;
    overflow-y: auto;
    background: transparent;
    padding: var(--space-lg);
}

/* MP3 Player Layout */
#mp3-top-layout {
    display: flex;
    flex-direction: row;
    gap: var(--space-xl);
    align-items: stretch;
    margin-bottom: var(--space-lg);
    min-height: 250px;
    max-height: 300px;
}

#mp3-cover {
    flex: 0 0 350px;
    max-width: 350px;
    width: 100%;
    object-fit: contain;
    border-radius: var(--radius-lg);
    background: transparent;
    display: none;
}

#mp3-o3ics {
    flex: 1;
    height: 300px;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    word-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
    padding: var(--space-md);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    text-align: center;
    font-size: var(--font-size-lg);
    line-height: 1.8;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

#mp3-o3ics.synced p {
    margin: 10px 0;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0.5;
    transform: scale(0.95);
    transform-origin: center;
}

#mp3-o3ics.synced p.active {
    opacity: 1;
    font-size: 1.6em;
    font-weight: 700;
    color: #00e5ff;
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
    transform: scale(1.1);
}

#mp3-audio {
    width: 100%;
    margin-top: var(--space-md);
    height: 50px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

#mp3-audio::-webkit-media-controls-panel {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
}

#mp3-audio::-webkit-media-controls-play-button,
#mp3-audio::-webkit-media-controls-mute-button,
#mp3-audio::-webkit-media-controls-timeline-container,
#mp3-audio::-webkit-media-controls-current-time-display,
#mp3-audio::-webkit-media-controls-time-remaining-display,
#mp3-audio::-webkit-media-controls-timeline,
#mp3-audio::-webkit-media-controls-volume-slider {
    filter: invert(1);
}

#mp3-audio::-webkit-media-controls-play-button {
    background-color: #00e5ff !important;
    border-radius: 50%;
}

#mp3-audio::-webkit-media-controls-timeline {
    background: linear-gradient(to right, #00e5ff, #7c4dff);
    border-radius: 5px;
}

/* Metadata Section */
.metadata-section {
    margin-top: var(--space-lg);
    border: 1px solid var(--glass-border);
    padding: var(--space-lg);
    border-radius: var(--radius-xl);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.metadata-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.metadata-title {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.metadata-actions {
    display: flex;
    gap: var(--space-sm);
}

.metadata-display p {
    margin: var(--space-xs) 0;
    font-size: var(--font-size-sm);
}

.metadata-display strong {
    color: var(--color-text-secondary);
}

/* ================================================
   Context Menu
   ================================================ */
#context-menu {
    position: fixed;
    background: var(--context-menu-bg);
    backdrop-filter: var(--glass-blur-strong);
    -webkit-backdrop-filter: var(--glass-blur-strong);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow-lg);
    z-index: var(--z-dropdown);
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-width: 180px;
    padding: var(--space-xs) 0;
    animation: contextMenuFadeIn 0.15s ease;
}

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

#context-menu.hidden {
    display: none;
}

.menu-item {
    padding: var(--space-sm) var(--space-lg);
    cursor: pointer;
    font-weight: 500;
    font-size: var(--font-size-sm);
    color: var(--color-text);
    transition: all var(--transition-fast);
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    font-family: inherit;
}

.menu-item:hover {
    background: var(--context-menu-hover);
    color: var(--context-menu-hover-text);
}

/* ================================================
   Result Messages
   ================================================ */
#result {
    margin-top: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-weight: 500;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#result.info {
    background: var(--info-bg);
    color: var(--color-text-secondary);
    border-left: 3px solid var(--color-primary);
}

#result.success {
    background: var(--success-bg);
    color: var(--success-text);
    border-left: 3px solid var(--color-success);
}

#result.error {
    background: var(--error-bg);
    color: var(--error-text);
    border-left: 3px solid var(--color-error);
}

/* ================================================
   Log Output
   ================================================ */
.log-output {
    white-space: pre-wrap;
    background: #1e1e1e;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    padding: var(--space-md);
    margin-top: var(--space-lg);
    height: 300px;
    overflow-y: auto;
    color: #00ff00;
    font-size: var(--font-size-sm);
    line-height: 1.6;
}

/* ================================================
   Cards
   ================================================ */
.card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    box-shadow: var(--glass-shadow);
}

.card-header {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--color-border-light);
}

.card-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin: 0;
}

/* ================================================
   Spinner
   ================================================ */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    vertical-align: middle;
    margin-right: var(--space-xs);
}

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

/* ================================================
   Scrollbars
   ================================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* Custom scrollbar for o3ics */
#mp3-o3ics::-webkit-scrollbar {
    width: 6px;
}

#mp3-o3ics::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

#mp3-o3ics::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* ================================================
   Rename
   ================================================ */
.rename-container {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex: 1;
}

.rename-input {
    font-size: var(--font-size-base);
    font-family: inherit;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-md);
    outline: none;
    background: var(--input-bg);
    color: var(--color-text);
    transition: all var(--transition-fast);
    flex: 1;
    min-width: 200px;
}

.rename-input:focus {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.rename-btn {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-sm);
    cursor: pointer;
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    transition: all var(--transition-fast);
}

.rename-confirm {
    background-color: var(--color-success);
}

.rename-confirm:hover {
    background-color: #059669;
}

.rename-cancel {
    background-color: var(--color-text-muted);
}

.rename-cancel:hover {
    background-color: var(--color-text-secondary);
}

/* ================================================
   Ruby Styles (for o3ics)
   ================================================ */
ruby {
    ruby-align: center;
}

rt {
    font-size: 0.5em;
    color: var(--color-text);
    opacity: 0.8;
}

#mp3-o3ics.synced p.active rt {
    color: #fff;
    opacity: 1;
    font-weight: normal;
}

/* ================================================
   Utility Classes
   ================================================ */
.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--color-text-muted);
}

.mt-md {
    margin-top: var(--space-md);
}

.mb-md {
    margin-bottom: var(--space-md);
}

/* ================================================
   Mobile Navigation Toggle
   ================================================ */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-primary) 0%, #818cf8 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: var(--glass-shadow-lg), 0 8px 24px rgba(99, 102, 241, 0.4);
    cursor: pointer;
    z-index: var(--z-sticky);
    transition: all var(--transition-base);
}

.mobile-nav-toggle:hover {
    transform: translateX(-50%) scale(1.1);
}

.mobile-nav-toggle svg {
    width: 24px;
    height: 24px;
}

/* ================================================
   Responsive Design - Mobile
   ================================================ */
@media (max-width: 768px) {
    /* Hide sidebar, show mobile nav */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        padding-top: var(--space-xl);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: var(--modal-overlay);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        z-index: calc(var(--z-sticky) - 1);
    }

    .sidebar-overlay.visible {
        display: block;
    }

    .main-wrapper {
        margin-left: 0;
        padding: var(--space-md);
        padding-bottom: 100px;
    }

    .mobile-nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .theme-toggle {
        position: static;
        margin-bottom: var(--space-md);
        width: 100%;
        justify-content: center;
    }

    /* Navigation tabs on mobile */
    .sidebar-nav ul {
        flex-direction: column;
    }

    .sidebar-nav li {
        padding: var(--space-md);
        font-size: var(--font-size-base);
    }

    /* File browser */
    .file-browser {
        min-height: 50vh;
        max-height: 70vh;
    }

    .file-item {
        padding: var(--space-md);
    }

    .file-item .item-name {
        font-size: var(--font-size-sm);
    }

    /* Modals - fullscreen on mobile */
    #preview-modal,
    #video-modal,
    #mp3-modal {
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 0;
    }

    /* MP3 player layout */
    #mp3-top-layout {
        flex-direction: column;
        align-items: center;
        min-height: auto;
    }

    #mp3-cover {
        flex: 0 0 auto;
        max-width: 250px;
        height: 250px;
    }

    #mp3-o3ics {
        width: 100%;
        height: 200px;
        max-height: 200px;
    }

    /* Forms */
    .modern-form {
        max-width: 100%;
    }

    .form-actions-modern {
        flex-direction: column;
    }

    .btn-save-modern,
    .btn-run-modern {
        width: 100%;
    }

    /* Video actions */
    #video-actions {
        flex-direction: column;
    }

    #video-actions a,
    #video-actions button {
        width: 100%;
    }

    /* Page title */
    .page-title {
        font-size: var(--font-size-2xl);
    }

    /* Breadcrumb */
    .breadcrumb {
        font-size: var(--font-size-xs);
        padding: var(--space-sm);
    }

    /* Metadata */
    .metadata-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .metadata-actions {
        width: 100%;
    }

    .metadata-actions .btn {
        flex: 1;
    }
}

/* ================================================
   Responsive Design - Tablet
   ================================================ */
@media (min-width: 769px) and (max-width: 1024px) {
    :root {
        --sidebar-width: 220px;
    }

    .main-wrapper {
        padding: var(--space-lg);
    }
}

/* ================================================
   Animations
   ================================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.animate-fade-in {
    animation: fadeIn 0.3s ease;
}

.animate-slide-up {
    animation: slideUp 0.3s ease;
}

/* Loading state */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* LRC Timeline Editor */
#lrc-editor {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    box-shadow: var(--glass-shadow);
}

.lrc-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--color-border);
}

.lrc-editor-header h4 {
    margin: 0;
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-text);
}

.lrc-editor-actions {
    display: flex;
    gap: var(--space-sm);
}

.lrc-editor-controls {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    padding: var(--space-sm);
    background: var(--hover-bg);
    border-radius: var(--radius-md);
}

.lrc-editor-controls label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
}

#lrc-offset-input {
    width: 80px;
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--color-text);
    font-size: var(--font-size-sm);
    text-align: center;
}

#lrc-offset-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.lrc-editor-preview {
    max-height: 200px;
    overflow-y: auto;
    background: var(--info-bg);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.lrc-preview-line {
    padding: 2px 4px;
    border-radius: 2px;
    color: var(--color-text);
    white-space: pre-wrap;
    word-break: break-all;
}

.btn-info {
    background: #0ea5e9;
    color: white;
}

.btn-info:hover {
    background: #0284c7;
}

/* LRC Edit Mode */
#mp3-o3ics.lrc-edit-mode {
    border: 2px solid var(--color-primary);
    background: var(--info-bg);
}

#mp3-o3ics.lrc-edit-mode p.lrc-preview-item {
    margin: 10px 0;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0.6;
    transform: scale(0.95);
    transform-origin: center;
    text-align: center;
}

#mp3-o3ics.lrc-edit-mode p.lrc-preview-item.highlight {
    opacity: 1;
    font-size: 1.3em;
    font-weight: 700;
    color: #00e5ff;
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
    transform: scale(1.05);
}

/* Cover Upload Container */
.cover-upload-container {
    display: flex;
    gap: var(--space-md);
    align-items: flex-start;
}

.cover-preview-container {
    width: 120px;
    height: 120px;
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    flex-shrink: 0;
}

.cover-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-preview-container img.hidden {
    display: none;
}

#editor-cover-placeholder {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    text-align: center;
}

.cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.cover-upload-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

#cover-url-input {
    width: 100%;
    font-size: var(--font-size-sm);
    padding: var(--space-sm);
}

/* Fallback when backdrop-filter is unsupported */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    :root {
        --glass-bg: rgba(255, 255, 255, 0.92);
        --glass-bg-strong: #ffffff;
    }
    [data-theme="dark"] {
        --glass-bg: rgba(30, 41, 59, 0.92);
        --glass-bg-strong: #1e293b;
    }
}
