/* ============================================
   AI Music Studio - Professional DAW Design System
   Version 2.0 - Complete UI/UX Redesign
   ============================================ */

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
    /* === Color System - Premium Dark Theme === */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a2e;
    --bg-elevated: #22223a;
    --bg-hover: #2a2a3e;
    --bg-active: #33334a;
    --bg-glass: rgba(18, 18, 26, 0.8);
    
    /* === Accent Colors - Cyan/Purple Gradient === */
    --accent-primary: #06b6d4;
    --accent-primary-rgb: 6, 182, 212;
    --accent-secondary: #8b5cf6;
    --accent-secondary-rgb: 139, 92, 246;
    --accent-gradient: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
    --accent-gradient-hover: linear-gradient(135deg, #22d3ee 0%, #a78bfa 100%);
    --accent-gradient-subtle: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    --accent-glow: 0 0 40px rgba(139, 92, 246, 0.3);
    --accent-glow-cyan: 0 0 30px rgba(6, 182, 212, 0.4);
    
    /* === Text Colors === */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0a0a0f;
    --text-accent: #06b6d4;
    
    /* === Status Colors === */
    --success: #10b981;
    --success-rgb: 16, 185, 129;
    --warning: #f59e0b;
    --warning-rgb: 245, 158, 11;
    --error: #ef4444;
    --error-rgb: 239, 68, 68;
    --info: #3b82f6;
    --info-rgb: 59, 130, 246;
    
    /* === Border Colors === */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-default: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.15);
    --border-accent: rgba(6, 182, 212, 0.4);
    
    /* === Shadow System === */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
    --shadow-2xl: 0 24px 64px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 60px rgba(139, 92, 246, 0.25);
    --shadow-glow-lg: 0 0 80px rgba(139, 92, 246, 0.35);
    --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    
    /* === Typography === */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    
    /* Font Sizes - Modular Scale (1.25) */
    --text-xs: 0.75rem;     /* 12px */
    --text-sm: 0.875rem;    /* 14px */
    --text-base: 1rem;      /* 16px */
    --text-lg: 1.125rem;    /* 18px */
    --text-xl: 1.25rem;     /* 20px */
    --text-2xl: 1.5rem;     /* 24px */
    --text-3xl: 1.875rem;   /* 30px */
    --text-4xl: 2.25rem;    /* 36px */
    
    /* Font Weights */
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;
    --font-black: 900;
    
    /* Line Heights */
    --leading-tight: 1.2;
    --leading-snug: 1.35;
    --leading-normal: 1.5;
    --leading-relaxed: 1.65;
    --leading-loose: 1.8;
    
    /* Letter Spacing */
    --tracking-tighter: -0.04em;
    --tracking-tight: -0.02em;
    --tracking-normal: 0;
    --tracking-wide: 0.02em;
    --tracking-wider: 0.05em;
    --tracking-widest: 0.1em;
    
    /* === Spacing System (4px base) === */
    --space-0: 0;
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */
    --space-24: 6rem;     /* 96px */
    
    /* === Border Radius === */
    --radius-none: 0;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-3xl: 24px;
    --radius-full: 9999px;
    
    /* === Transitions === */
    --transition-instant: 50ms ease;
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-bounce: 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* === Z-Index Scale === */
    --z-base: 0;
    --z-elevated: 10;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 300;
    --z-modal: 400;
    --z-popover: 450;
    --z-toast: 500;
    --z-tooltip: 600;
    --z-max: 9999;
}

/* ============================================
   CSS Reset & Base Styles
   ============================================ */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'kern' 1, 'liga' 1;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(ellipse at 20% 0%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(6, 182, 212, 0.06) 0%, transparent 50%);
    background-attachment: fixed;
}

/* Selection */
::selection {
    background: rgba(139, 92, 246, 0.4);
    color: white;
}

/* Focus Visible for Accessibility */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-md);
    z-index: var(--z-max);
    font-weight: var(--font-semibold);
    text-decoration: none;
    transition: top var(--transition-fast);
    box-shadow: var(--shadow-lg);
}

.skip-link:focus {
    top: var(--space-4);
}

/* Visually Hidden (Accessible) */
.visually-hidden,
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ============================================
   Custom Scrollbar (Webkit)
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-active);
    border: 2px solid transparent;
    background-clip: padding-box;
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--bg-hover) transparent;
}

/* ============================================
   App Container & Layout
   ============================================ */

.app-container {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* ============================================
   HEADER / NAVIGATION BAR
   ============================================ */

.app-header {
    flex-shrink: 0;
    height: 68px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
    z-index: var(--z-sticky);
}

.app-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(139, 92, 246, 0.3) 50%, 
        transparent 100%
    );
    opacity: 0.5;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 var(--space-6);
    max-width: 1920px;
    margin: 0 auto;
}

/* Logo Section */
.logo-section {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
}

.logo-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    position: relative;
}

.logo-icon::before {
    content: '';
    position: absolute;
    inset: -3px;
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    opacity: 0.3;
    filter: blur(8px);
    transition: opacity var(--transition-base);
}

.logo-icon:hover::before {
    opacity: 0.5;
}

.logo-icon svg {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.app-title {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    letter-spacing: var(--tracking-tight);
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: var(--leading-tight);
}

.app-subtitle {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-weight: var(--font-medium);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
}

/* Navigation */
.header-nav {
    display: flex;
    gap: var(--space-1);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-5);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.nav-btn:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
    border-color: var(--border-default);
}

.nav-btn.active {
    background: var(--accent-gradient-subtle);
    border-color: var(--border-accent);
    color: var(--text-primary);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
}

.nav-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
}

.nav-icon {
    width: 18px;
    height: 18px;
    position: relative;
    z-index: 1;
}

.nav-btn span {
    position: relative;
    z-index: 1;
}

/* Header Actions (Right Side) */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.icon-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.icon-btn:hover {
    border-color: var(--border-accent);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.icon-btn:hover::before {
    opacity: 0.1;
}

.icon-btn svg {
    width: 20px;
    height: 20px;
    position: relative;
    z-index: 1;
}

/* User Avatar */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-bold);
    font-size: var(--text-sm);
    color: white;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition-fast);
    position: relative;
}

.user-avatar::before {
    content: '';
    position: absolute;
    inset: -3px;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.user-avatar:hover::before {
    opacity: 0.5;
}

/* Mobile Menu Toggle */
.mobile-menu-btn {
    display: none;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */

.main-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.view {
    display: none;
    height: 100%;
    animation: viewFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.view.active {
    display: block;
}

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

/* ============================================
   GENERATOR VIEW LAYOUT
   ============================================ */

.generator-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    height: 100%;
    overflow: hidden;
}

/* ============================================
   CONTROL PANEL (Left Sidebar)
   ============================================ */

.control-panel {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    position: relative;
}

.control-panel::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, 
        rgba(139, 92, 246, 0.3) 0%, 
        rgba(6, 182, 212, 0.2) 50%,
        transparent 100%
    );
    opacity: 0.5;
}

.control-section {
    position: relative;
    z-index: 1;
}

.section-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border-subtle);
}

.title-icon {
    width: 16px;
    height: 16px;
    color: var(--accent-primary);
    flex-shrink: 0;
}

/* === PROMPT SECTION === */
.prompt-section {
    background: linear-gradient(135deg, 
        var(--bg-tertiary) 0%, 
        rgba(26, 26, 46, 0.8) 100%
    );
    border-radius: var(--radius-xl);
    padding: var(--space-4);
    border: 1px solid var(--border-subtle);
    position: relative;
    overflow: hidden;
}

.prompt-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gradient);
    opacity: 0.6;
}

.prompt-input-wrapper {
    position: relative;
}

.prompt-textarea {
    width: 100%;
    min-height: 130px;
    padding: var(--space-4);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    resize: vertical;
    transition: all var(--transition-fast);
}

.prompt-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 
        0 0 0 3px rgba(var(--accent-primary-rgb), 0.15),
        var(--shadow-glow);
    background: var(--bg-active);
}

.prompt-textarea::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-3);
    padding-top: var(--space-2);
    border-top: 1px dashed var(--border-subtle);
}

.input-hint {
    font-size: var(--text-xs);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.char-count {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-family: var(--font-mono);
    background: var(--bg-elevated);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-md);
}

/* === MODE TOGGLE === */
.mode-toggle-group {
    border: none;
    padding: 0;
    margin: 0;
}

.mode-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}

.mode-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-3);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.mode-option::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.mode-option:hover {
    background: var(--bg-elevated);
    border-color: var(--border-default);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.mode-option.active {
    background: linear-gradient(135deg, 
        rgba(139, 92, 246, 0.15) 0%, 
        rgba(6, 182, 212, 0.15) 100%
    );
    border-color: var(--accent-secondary);
    color: var(--text-primary);
    box-shadow: 
        0 0 30px rgba(139, 92, 246, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.mode-option.active .mode-icon {
    background: var(--accent-gradient);
    color: white;
}

.mode-icon {
    width: 44px;
    height: 44px;
    padding: var(--space-3);
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    position: relative;
    z-index: 1;
}

.mode-icon svg {
    width: 100%;
    height: 100%;
}

.mode-label {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    position: relative;
    z-index: 1;
}

.mode-description {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-align: center;
    position: relative;
    z-index: 1;
}

/* === LYRICS SECTION === */
.lyrics-section {
    background: linear-gradient(135deg, 
        var(--bg-tertiary) 0%, 
        rgba(26, 26, 46, 0.8) 100%
    );
    border-radius: var(--radius-xl);
    padding: var(--space-4);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-base);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 500px;
    }
}

.lyrics-section[hidden] {
    display: none;
}

.toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    margin-left: auto;
    padding: var(--space-1) var(--space-3);
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-family: inherit;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.toggle-btn svg {
    width: 14px;
    height: 14px;
}

.toggle-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md), var(--accent-glow);
}

.toggle-btn:active {
    transform: scale(0.98);
}

.lyrics-input-wrapper {
    position: relative;
}

.lyrics-textarea {
    width: 100%;
    min-height: 160px;
    padding: var(--space-4);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: var(--leading-loose);
    resize: vertical;
    transition: all var(--transition-fast);
}

.lyrics-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 
        0 0 0 3px rgba(var(--accent-primary-rgb), 0.15),
        var(--shadow-glow);
}

.lyrics-textarea::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

/* === ADVANCED PARAMETERS SECTION === */
.advanced-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    transition: all var(--transition-base);
}

.advanced-summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    padding: var(--space-4);
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    transition: background var(--transition-fast);
}

.advanced-summary::-webkit-details-marker {
    display: none;
}

.advanced-summary:hover {
    background: var(--bg-elevated);
}

.advanced-summary .chevron-icon {
    width: 18px;
    height: 18px;
    margin-left: auto;
    transition: transform var(--transition-base);
    color: var(--text-muted);
}

.advanced-section[open] .chevron-icon {
    transform: rotate(180deg);
    color: var(--accent-primary);
}

.advanced-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    padding: 0 var(--space-4) var(--space-4);
    animation: gridExpand 0.3s ease-out;
}

@keyframes gridExpand {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

.param-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.param-group.full-width {
    grid-column: 1 / -1;
}

.param-label {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.param-value {
    font-family: var(--font-mono);
    color: var(--accent-primary);
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
}

/* Select Styling */
.select-wrapper {
    position: relative;
}

.param-select {
    width: 100%;
    padding: var(--space-3) var(--space-10) var(--space-3) var(--space-3);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: var(--text-sm);
    appearance: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.param-select:hover {
    border-color: var(--border-strong);
}

.param-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.15);
}

.select-arrow {
    position: absolute;
    right: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.param-select:focus + .select-arrow {
    color: var(--accent-primary);
}

/* Slider Styling */
.param-slider {
    width: 100%;
    height: 6px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    appearance: none;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.param-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent-gradient);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 
        0 2px 10px rgba(var(--accent-secondary-rgb), 0.4),
        0 0 0 3px rgba(var(--accent-secondary-rgb), 0.1);
    transition: all var(--transition-fast);
}

.param-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 
        0 4px 15px rgba(var(--accent-secondary-rgb), 0.5),
        0 0 0 5px rgba(var(--accent-secondary-rgb), 0.15);
}

.param-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(var(--accent-secondary-rgb), 0.4);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-1);
}

.tempo-slider {
    background: linear-gradient(to right, 
        var(--accent-primary) 0%, 
        var(--accent-primary) calc((120 - 40) / (220 - 40) * 100%),
        var(--bg-elevated) calc((120 - 40) / (220 - 40) * 100%),
        var(--bg-elevated) 100%
    );
}

.variation-slider {
    background: linear-gradient(to right, 
        var(--accent-primary) 0%, 
        var(--accent-primary) 70%,
        var(--bg-elevated) 70%,
        var(--bg-elevated) 100%
    );
}

/* Instrument Chips */
.instrumentation-fieldset,
.quality-fieldset,
.vocal-fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.instrument-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.instrument-chip {
    cursor: pointer;
}

.instrument-chip input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chip-content {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-3);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.chip-content:hover {
    border-color: var(--border-strong);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.instrument-chip input:checked + .chip-content {
    background: linear-gradient(135deg, 
        rgba(139, 92, 246, 0.2) 0%, 
        rgba(6, 182, 212, 0.2) 100%
    );
    border-color: var(--accent-secondary);
    color: var(--text-primary);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.15);
}

.chip-emoji {
    font-size: var(--text-sm);
}

/* Quality Options */
.quality-options,
.vocal-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

.quality-select {
    max-width: 100%;
}

/* Vocal Settings */
.vocal-settings[hidden] {
    display: none;
}

/* === GENERATE BUTTON === */
.generate-section {
    padding-top: var(--space-5);
    border-top: 1px solid var(--border-subtle);
    margin-top: auto;
}

.generate-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    background: var(--accent-gradient);
    background-size: 200% 200%;
    border: none;
    border-radius: var(--radius-xl);
    color: white;
    font-family: inherit;
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    letter-spacing: var(--tracking-wide);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 20px rgba(var(--accent-secondary-rgb), 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.generate-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.25) 0%, 
        transparent 50%,
        rgba(255, 255, 255, 0.1) 100%
    );
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.generate-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.7s ease;
}

.generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 30px rgba(var(--accent-secondary-rgb), 0.5),
        0 0 60px rgba(var(--accent-secondary-rgb), 0.2);
    background-position: 100% 100%;
}

.generate-btn:hover::before {
    opacity: 1;
}

.generate-btn:hover::after {
    left: 100%;
}

.generate-btn:active {
    transform: translateY(-1px);
    box-shadow: 
        0 4px 15px rgba(var(--accent-secondary-rgb), 0.4),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: var(--shadow-md);
}

.generate-btn:disabled::after {
    display: none;
}

.btn-content,
.btn-loading {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.btn-loading[hidden] {
    display: none;
}

.btn-icon {
    width: 22px;
    height: 22px;
}

.spinner {
    width: 22px;
    height: 22px;
    animation: spin 1s linear infinite;
}

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

.generate-status {
    margin-top: var(--space-3);
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-align: center;
    min-height: 20px;
}

/* ============================================
   OUTPUT PANEL (Right Side)
   ============================================ */

.output-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-primary);
    overflow: hidden;
    position: relative;
}

.output-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 300px;
    background: radial-gradient(ellipse at center top, 
        rgba(139, 92, 246, 0.06) 0%, 
        transparent 70%
    );
    pointer-events: none;
}

.output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

.output-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.output-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
}

.output-actions {
    display: flex;
    gap: var(--space-2);
}

.output-actions[hidden] {
    display: none;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.action-btn svg {
    width: 16px;
    height: 16px;
    position: relative;
    z-index: 1;
}

/* Loop Button Active State */
.control-btn.loop-active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
}

.control-btn.loop-active:hover {
    transform: scale(1.08);
    box-shadow: 0 0 20px rgba(var(--accent-secondary-rgb), 0.4);
}

.action-btn span {
    position: relative;
    z-index: 1;
}

.action-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.action-btn:hover::before {
    opacity: 0.1;
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn.secondary {
    background: transparent;
    border-style: dashed;
}

.action-btn.secondary:hover {
    border-style: solid;
}

.text-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.text-btn svg {
    width: 14px;
    height: 14px;
}

.text-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

/* === PLAYER AREA === */
.player-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    overflow: auto;
    position: relative;
    z-index: 1;
}

/* Empty State */
.empty-state {
    text-align: center;
    max-width: 360px;
    animation: fadeInUp 0.6s ease-out;
}

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

.empty-icon {
    width: 140px;
    height: 140px;
    margin: 0 auto var(--space-6);
    color: var(--text-muted);
    opacity: 0.4;
    position: relative;
}

.empty-icon::before {
    content: '';
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.empty-icon svg {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
}

.empty-title {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-3);
    letter-spacing: var(--tracking-tight);
}

.empty-description {
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: var(--leading-relaxed);
}

/* === AUDIO PLAYER === */
.audio-player {
    width: 100%;
    max-width: 860px;
    animation: playerSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.audio-player[hidden] {
    display: none;
}

/* Waveform Container */
.waveform-container {
    position: relative;
    height: 130px;
    background: linear-gradient(180deg, 
        var(--bg-secondary) 0%, 
        var(--bg-tertiary) 100%
    );
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: var(--space-5);
    border: 1px solid var(--border-subtle);
    box-shadow: 
        var(--shadow-inner),
        var(--shadow-md);
}

.waveform-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.waveform-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        rgba(139, 92, 246, 0.1) 0%, 
        rgba(6, 182, 212, 0.05) 50%,
        transparent 100%
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.waveform-container:hover .waveform-overlay {
    opacity: 1;
}

.waveform-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to top, var(--bg-tertiary), transparent);
    pointer-events: none;
}

/* Player Controls */
.player-controls {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-5);
    background: linear-gradient(135deg, 
        var(--bg-secondary) 0%, 
        var(--bg-tertiary) 100%
    );
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-lg);
}

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

.control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.control-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.control-btn svg {
    width: 20px;
    height: 20px;
    position: relative;
    z-index: 1;
}

.control-btn:hover {
    border-color: var(--accent-primary);
    transform: scale(1.08);
    box-shadow: var(--shadow-md);
}

.control-btn:hover::before {
    opacity: 0.2;
}

.control-btn:active {
    transform: scale(0.95);
}

.play-pause-btn {
    width: 58px;
    height: 58px;
    background: var(--accent-gradient);
    border: none;
    box-shadow: 
        0 4px 20px rgba(var(--accent-secondary-rgb), 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.play-pause-btn:hover {
    transform: scale(1.1);
    box-shadow: 
        0 6px 28px rgba(var(--accent-secondary-rgb), 0.5),
        0 0 40px rgba(var(--accent-secondary-rgb), 0.2);
}

.play-pause-btn:active {
    transform: scale(1.05);
}

.play-pause-btn .play-icon,
.play-pause-btn .pause-icon {
    width: 26px;
    height: 26px;
}

.play-pause-btn .pause-icon[hidden],
.play-pause-btn .play-icon[hidden] {
    display: none;
}

.skip-btn {
    width: 38px;
    height: 38px;
}

.skip-btn svg {
    width: 16px;
    height: 16px;
}

/* Time Display */
.time-display {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
}

.time-current,
.time-total {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    min-width: 45px;
    font-variant-numeric: tabular-nums;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    position: relative;
    cursor: pointer;
    touch-action: none;
    transition: height var(--transition-fast);
}

.progress-bar:hover {
    height: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.progress-bar:hover .progress-fill::after {
    opacity: 1;
}

.progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(var(--accent-primary-rgb), 0.5);
    opacity: 0;
    transition: opacity var(--transition-fast);
    z-index: 2;
}

.progress-bar:hover .progress-thumb {
    opacity: 1;
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.volume-btn {
    width: 38px;
    height: 38px;
}

.volume-slider {
    width: 90px;
    height: 4px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    appearance: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.volume-slider::-webkit-slider-thumb:hover {
    background: var(--accent-primary);
    transform: scale(1.2);
}

.volume-high-icon[hidden],
.volume-mute-icon[hidden] {
    display: none;
}

/* Now Playing Info */
.now-playing {
    margin-top: var(--space-5);
    padding: var(--space-5);
    background: linear-gradient(135deg, 
        var(--bg-secondary) 0%, 
        var(--bg-tertiary) 100%
    );
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    animation: fadeInUp 0.4s ease-out 0.2s both;
}

.now-playing[hidden] {
    display: none;
}

.track-info {
    margin-bottom: var(--space-3);
}

.track-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-1);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.track-title::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: nowPlayingPulse 1.5s ease-in-out infinite;
}

@keyframes nowPlayingPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.track-meta {
    font-size: var(--text-sm);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.track-meta span::after {
    content: '•';
    margin-left: var(--space-3);
    color: var(--border-strong);
}

.track-meta span:last-child::after {
    display: none;
}

.track-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.track-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.track-tag:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* === GENERATION PROGRESS === */
.generation-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-subtle);
    padding: var(--space-6);
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.generation-progress[hidden] {
    display: none;
}

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

.progress-title {
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.progress-title::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: progressPulse 1s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.progress-percentage {
    font-family: var(--font-mono);
    color: var(--accent-primary);
    font-weight: var(--font-bold);
    font-size: var(--text-lg);
}

.progress-bar-container {
    height: 8px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-5);
    position: relative;
}

.progress-bar-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4));
    animation: progressGlow 1.5s ease-in-out infinite;
}

@keyframes progressGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    flex: 1;
    opacity: 0.35;
    transition: all var(--transition-base);
}

.progress-step.active {
    opacity: 1;
    transform: scale(1.05);
}

.progress-step.completed {
    opacity: 0.7;
}

.step-indicator {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 2px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    transition: all var(--transition-base);
    position: relative;
}

.step-indicator::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: all var(--transition-base);
}

.progress-step.active .step-indicator {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    color: white;
    box-shadow: 
        0 0 20px rgba(var(--accent-primary-rgb), 0.5),
        0 0 40px rgba(var(--accent-primary-rgb), 0.2);
}

.progress-step.active .step-indicator::after {
    border-color: rgba(var(--accent-primary-rgb), 0.3);
    animation: stepRing 1.5s ease-out infinite;
}

@keyframes stepRing {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.progress-step.completed .step-indicator {
    border-color: var(--success);
    background: var(--success);
    color: white;
}

.step-text {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-step.active .step-text {
    color: var(--text-primary);
    font-weight: var(--font-medium);
}

/* ============================================
   EDITOR MODAL
   ============================================ */

.editor-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    animation: overlayFadeIn 0.3s ease-out;
}

.editor-overlay[hidden] {
    display: none;
}

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

.editor-modal {
    width: 100%;
    max-width: 960px;
    max-height: 90dvh;
    background: var(--bg-secondary);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border-default);
    box-shadow: 
        var(--shadow-2xl),
        0 0 100px rgba(var(--accent-secondary-rgb), 0.15);
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

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

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
    background: var(--bg-tertiary);
}

.editor-title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
}

.editor-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.close-btn {
    width: 38px;
    height: 38px;
}

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

/* Editor Tabs */
.editor-tabs {
    display: flex;
    gap: var(--space-1);
    padding: var(--space-4) var(--space-6) 0;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.editor-tab {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.editor-tab svg {
    width: 16px;
    height: 16px;
}

.editor-tab:hover {
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}

.editor-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.editor-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gradient);
}

/* Editor Panels */
.editor-panels {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-6);
    background: var(--bg-secondary);
}

.editor-panel {
    display: none;
    animation: panelFadeIn 0.3s ease-out;
}

.editor-panel.active {
    display: block;
}

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

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

.panel-header h3 {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
}

.panel-actions {
    display: flex;
    gap: var(--space-2);
}

/* Lyrics Editor */
.lyrics-editor-wrapper {
    position: relative;
}

.editor-textarea {
    width: 100%;
    min-height: 320px;
    padding: var(--space-5);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: var(--leading-loose);
    resize: vertical;
    transition: all var(--transition-fast);
}

.editor-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 
        0 0 0 3px rgba(var(--accent-primary-rgb), 0.15),
        var(--shadow-glow);
}

.editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px dashed var(--border-subtle);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.word-count {
    background: var(--bg-elevated);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-md);
}

/* Lyrics Preview */
.lyrics-preview {
    margin-top: var(--space-6);
    padding: var(--space-5);
    background: var(--bg-tertiary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    animation: fadeInUp 0.3s ease-out;
}

.lyrics-preview[hidden] {
    display: none;
}

.lyrics-preview h4 {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.lyrics-preview h4::before {
    content: '';
    width: 4px;
    height: 14px;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
}

.preview-content {
    font-size: var(--text-sm);
    line-height: var(--leading-loose);
    color: var(--text-primary);
    white-space: pre-wrap;
    padding: var(--space-4);
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
}

.preview-content .section-tag {
    color: var(--accent-primary);
    font-weight: var(--font-semibold);
}

/* Structure List */
.structure-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.structure-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    cursor: grab;
    transition: all var(--transition-fast);
}

.structure-item:hover {
    border-color: var(--border-default);
    background: var(--bg-elevated);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.structure-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
    transform: scale(0.98);
}

.structure-handle {
    color: var(--text-muted);
    cursor: grab;
    padding: var(--space-2);
}

.structure-info {
    flex: 1;
}

.structure-name {
    font-weight: var(--font-medium);
    font-size: var(--text-sm);
}

.structure-duration {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.structure-actions {
    display: flex;
    gap: var(--space-2);
}

/* Style Controls */
.style-controls {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.style-param {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--bg-tertiary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
}

.style-param:hover {
    border-color: var(--border-default);
}

/* Editor Footer */
.editor-footer-main {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
    background: var(--bg-tertiary);
}

.regenerate-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

.regenerate-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-xl);
    color: white;
    font-family: inherit;
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 
        0 4px 20px rgba(var(--accent-secondary-rgb), 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.regenerate-btn svg {
    width: 20px;
    height: 20px;
}

.regenerate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 28px rgba(var(--accent-secondary-rgb), 0.5),
        0 0 40px rgba(var(--accent-secondary-rgb), 0.2);
}

.regenerate-hint {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* ============================================
   LIBRARY VIEW
   ============================================ */

.library-layout {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.library-header {
    padding: var(--space-6) var(--space-8);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
}

.library-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-5);
    letter-spacing: var(--tracking-tight);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.library-title::before {
    content: '';
    width: 6px;
    height: 28px;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
}

.library-filters {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 220px;
    max-width: 340px;
}

.search-icon {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.search-input {
    width: 100%;
    padding: var(--space-3) var(--space-4) var(--space-3) var(--space-12);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    color: var(--text-primary);
    font-family: inherit;
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 
        0 0 0 3px rgba(var(--accent-primary-rgb), 0.15),
        var(--shadow-glow);
    background: var(--bg-elevated);
}

.search-input:focus + .search-icon,
.search-input:not(:placeholder-shown) ~ .search-icon {
    color: var(--accent-primary);
}

.filter-buttons {
    display: flex;
    gap: var(--space-2);
}

.filter-btn {
    padding: var(--space-2) var(--space-4);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.filter-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--border-default);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 
        0 4px 15px rgba(var(--accent-secondary-rgb), 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.filter-btn span {
    position: relative;
    z-index: 1;
}

/* Library Content */
.library-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-6) var(--space-8);
}

.library-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    min-height: 400px;
}

.library-empty[hidden] {
    display: none;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: var(--space-5);
}

/* Song Card */
.song-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
}

.song-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: 0;
    border-radius: var(--radius-xl);
}

.song-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-6px);
    box-shadow: 
        var(--shadow-xl),
        0 0 40px rgba(var(--accent-secondary-rgb), 0.15);
}

.song-card:hover::before {
    opacity: 0.03;
}

.card-waveform {
    height: 110px;
    background: linear-gradient(135deg, 
        var(--bg-tertiary) 0%, 
        var(--bg-elevated) 100%
    );
    position: relative;
    overflow: hidden;
}

.card-waveform canvas {
    width: 100%;
    height: 100%;
}

.card-play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--transition-base);
}

.song-card:hover .card-play-overlay {
    opacity: 1;
}

.card-play-btn {
    width: 60px;
    height: 60px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.4),
        0 0 0 4px rgba(255, 255, 255, 0.1);
    transition: all var(--transition-base);
}

.card-play-btn:hover {
    transform: scale(1.1);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 0 6px rgba(255, 255, 255, 0.15);
}

.card-play-btn:active {
    transform: scale(0.95);
}

.card-play-btn svg {
    width: 26px;
    height: 26px;
    margin-left: 3px;
}

.card-body {
    padding: var(--space-4) var(--space-5);
    position: relative;
    z-index: 1;
    background: var(--bg-secondary);
}

.card-title {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.card-meta {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin-bottom: var(--space-4);
}

.card-tag {
    padding: var(--space-1) var(--space-2);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.card-tag:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-subtle);
}

.card-duration {
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.card-favorite {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.card-favorite:hover {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

.card-favorite.active {
    color: var(--warning);
}

.card-favorite svg {
    width: 20px;
    height: 20px;
}

/* Card Action Menu */
.card-menu-btn {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    width: 32px;
    height: 32px;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--transition-fast);
    z-index: 2;
}

.song-card:hover .card-menu-btn {
    opacity: 1;
}

.card-menu-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.card-menu-btn svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    z-index: var(--z-toast);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    box-shadow: 
        var(--shadow-xl),
        0 0 40px rgba(0, 0, 0, 0.3);
    min-width: 320px;
    max-width: 420px;
    pointer-events: auto;
    animation: toastSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
}

.toast.toast-success::before { background: var(--success); }
.toast.toast-error::before { background: var(--error); }
.toast.toast-warning::before { background: var(--warning); }
.toast.toast-info::before { background: var(--info); }

.toast.removing {
    animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideIn {
    from { 
        opacity: 0; 
        transform: translateX(100%) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0) scale(1); 
    }
}

@keyframes toastSlideOut {
    from { 
        opacity: 1; 
        transform: translateX(0) scale(1); 
    }
    to { 
        opacity: 0; 
        transform: translateX(100%) scale(0.95); 
    }
}

.toast-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: var(--space-1);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-success .toast-icon {
    background: rgba(var(--success-rgb), 0.15);
    color: var(--success);
}

.toast-error .toast-icon {
    background: rgba(var(--error-rgb), 0.15);
    color: var(--error);
}

.toast-warning .toast-icon {
    background: rgba(var(--warning-rgb), 0.15);
    color: var(--warning);
}

.toast-info .toast-icon {
    background: rgba(var(--info-rgb), 0.15);
    color: var(--info);
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-1);
    color: var(--text-primary);
}

.toast-message {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
}

.toast-close {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-1);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

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

.toast-close svg {
    width: 18px;
    height: 18px;
}

/* Toast Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--accent-gradient);
    border-radius: 0 0 0 var(--radius-xl);
    animation: toastProgress 5s linear forwards;
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ============================================
   LOADING SKELETONS
   ============================================ */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 25%,
        var(--bg-elevated) 50%,
        var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 16px;
    margin-bottom: var(--space-2);
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-title {
    height: 24px;
    width: 70%;
    margin-bottom: var(--space-3);
}

.skeleton-card {
    height: 280px;
    border-radius: var(--radius-xl);
}

.skeleton-waveform {
    height: 110px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1440px) {
    .generator-layout {
        grid-template-columns: 380px 1fr;
    }
}

@media (max-width: 1200px) {
    .header-nav {
        position: static;
        transform: none;
    }
    
    .nav-btn span {
        display: none;
    }
    
    .nav-btn {
        padding: var(--space-2) var(--space-3);
    }
}

@media (max-width: 1024px) {
    .generator-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    
    .control-panel {
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
        max-height: 50vh;
        padding: var(--space-4);
    }
    
    .control-panel::before {
        display: none;
    }
    
    .advanced-grid {
        grid-template-columns: 1fr;
    }
    
    .quality-options,
    .vocal-options {
        grid-template-columns: 1fr;
    }
    
    .library-header {
        padding: var(--space-5);
    }
    
    .library-content {
        padding: var(--space-4) var(--space-5);
    }
}

@media (max-width: 768px) {
    :root {
        --space-6: 1.25rem;
        --space-8: 1.75rem;
    }
    
    .app-header {
        height: 60px;
    }
    
    .header-inner {
        padding: 0 var(--space-4);
    }
    
    .logo-text {
        display: none;
    }
    
    .header-nav {
        gap: var(--space-1);
    }
    
    .header-actions {
        gap: var(--space-1);
    }
    
    .icon-btn {
        width: 38px;
        height: 38px;
    }
    
    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: var(--text-xs);
    }
    
    .control-panel {
        padding: var(--space-4);
        max-height: 45vh;
    }
    
    .mode-toggle {
        grid-template-columns: 1fr;
    }
    
    .prompt-textarea {
        min-height: 100px;
    }
    
    .output-header {
        flex-direction: column;
        gap: var(--space-3);
        align-items: stretch;
        padding: var(--space-4);
    }
    
    .output-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .player-area {
        padding: var(--space-4);
    }
    
    .player-controls {
        flex-wrap: wrap;
        gap: var(--space-3);
        padding: var(--space-4);
    }
    
    .play-pause-btn {
        width: 52px;
        height: 52px;
    }
    
    .time-display {
        order: 3;
        flex-basis: 100%;
    }
    
    .volume-control {
        margin-left: auto;
    }
    
    .waveform-container {
        height: 90px;
    }
    
    .editor-modal {
        max-height: 100dvh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        margin-top: auto;
    }
    
    .editor-tabs {
        padding: var(--space-3) var(--space-4) 0;
        overflow-x: auto;
    }
    
    .editor-tab {
        padding: var(--space-2) var(--space-3);
        font-size: var(--text-xs);
        white-space: nowrap;
    }
    
    .editor-panels {
        padding: var(--space-4);
    }
    
    .editor-textarea {
        min-height: 250px;
    }
    
    .library-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        max-width: none;
    }
    
    .filter-buttons {
        overflow-x: auto;
        padding-bottom: var(--space-2);
        flex-wrap: nowrap;
    }
    
    .filter-btn {
        flex-shrink: 0;
    }
    
    .library-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    .library-header {
        padding: var(--space-4);
    }
    
    .library-content {
        padding: var(--space-4);
    }
    
    .toast-container {
        left: var(--space-4);
        right: var(--space-4);
        bottom: var(--space-4);
    }
    
    .toast {
        min-width: auto;
        max-width: none;
    }
    
    .generation-progress {
        padding: var(--space-4);
    }
    
    .progress-steps {
        gap: var(--space-2);
    }
    
    .step-text {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    :root {
        --space-4: 0.875rem;
        --space-5: 1rem;
        --space-6: 1.125rem;
    }
    
    .app-header {
        height: 56px;
    }
    
    .logo-icon {
        width: 36px;
        height: 36px;
    }
    
    .nav-btn {
        padding: var(--space-2);
    }
    
    .icon-btn {
        width: 34px;
        height: 34px;
    }
    
    .control-panel {
        padding: var(--space-3);
    }
    
    .section-title {
        font-size: 10px;
    }
    
    .generate-btn {
        padding: var(--space-3) var(--space-4);
        font-size: var(--text-sm);
    }
    
    .waveform-container {
        height: 70px;
    }
    
    .play-pause-btn {
        width: 48px;
        height: 48px;
    }
    
    .play-pause-btn .play-icon,
    .play-pause-btn .pause-icon {
        width: 22px;
        height: 22px;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
    }
    
    .volume-slider {
        width: 70px;
    }
    
    .action-btn {
        padding: var(--space-2) var(--space-3);
        font-size: var(--text-xs);
    }
    
    .card-waveform {
        height: 90px;
    }
    
    .card-play-btn {
        width: 50px;
        height: 50px;
    }
    
    .editor-modal {
        border-radius: 0;
    }
    
    .toast {
        padding: var(--space-3) var(--space-4);
    }
    
    .toast-icon {
        width: 24px;
        height: 24px;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Text Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-accent { color: var(--accent-primary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: var(--font-bold); }
.font-semibold { font-weight: var(--font-semibold); }

/* Flexbox Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.flex-1 { flex: 1; }

/* Spacing Utilities */
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.p-4 { padding: var(--space-4); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }

/* Visibility */
.hidden { display: none !important; }
.visible { visibility: visible; }
.invisible { visibility: hidden; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

/* Border Radius */
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-grab { cursor: grab; }

/* Transitions */
.transition-fast { transition: all var(--transition-fast); }
.transition-base { transition: all var(--transition-base); }

/* Print Styles */
@media print {
    .app-header,
    .control-panel,
    .editor-overlay,
    .toast-container,
    .generation-progress {
        display: none !important;
    }
    
    .generator-layout {
        grid-template-columns: 1fr;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* =============================================================================
   VOCAL & LYRICS ENGINE STYLES
   ============================================================================= */

/* Inline Icon for Section Legends */
.inline-icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: middle;
}

/* Toggle Switch Component */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: var(--surface-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.toggle-switch:hover {
    border-color: var(--primary-color);
    background: var(--surface-tertiary);
}

.toggle-switch.active {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: rgba(6, 182, 212, 0.1);
}

.toggle-track {
    position: relative;
    width: 40px;
    height: 22px;
    background: var(--surface-tertiary);
    border-radius: 11px;
    transition: background var(--transition-base);
}

.toggle-switch.active .toggle-track {
    background: var(--primary-color);
}

.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: transform var(--transition-base);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active .toggle-thumb {
    transform: translateX(18px);
}

.toggle-status {
    font-weight: 600;
    font-size: var(--text-xs);
    letter-spacing: 0.5px;
    min-width: 24px;
}

.toggle-label {
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

/* Control Row (for toggle switches) */
.control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.control-row:last-child {
    border-bottom: none;
}

.voice-toggle-row,
.stem-toggle-row {
    background: var(--surface-secondary);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

/* Enhanced Vocal Controls Panel */
.vocal-enhanced-controls {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), rgba(6, 182, 212, 0.05));
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 16px;
}

.vocal-fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.vocal-fieldset legend {
    font-weight: 600;
    font-size: var(--text-base);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.vocal-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.vocal-option {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Sliders Grid for Voice Characteristics */
.sliders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

.slider-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.slider-value {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--primary-color);
    font-family: 'JetBrains Mono', monospace;
    background: rgba(6, 182, 212, 0.1);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.param-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--surface-tertiary);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.param-slider:hover {
    background: var(--border-color);
}

.param-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.4);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.param-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 12px rgba(6, 182, 212, 0.5);
}

.param-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.4);
}

.slider-description {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    font-style: italic;
}

/* Track Separation & Stem Control */
.track-separation-controls {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.05), rgba(139, 92, 246, 0.05));
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 16px;
}

.separation-fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.separation-fieldset legend {
    font-weight: 600;
    font-size: var(--text-base);
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(6, 182, 212, 0.2);
}

/* Stem Mix Controls */
.stem-mix-controls {
    margin-top: 16px;
    padding: 16px;
    background: var(--surface-secondary);
    border-radius: var(--radius-md);
}

.mix-slider-group {
    margin-bottom: 16px;
}

.mix-slider-group:last-child {
    margin-bottom: 0;
}

.mix-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.mix-indicator {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.vocal-indicator {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

.instrumental-indicator {
    background: linear-gradient(135deg, #06b6d4, #22d3ee);
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
}

.slider-with-value {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mix-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 8px;
    background: var(--surface-tertiary);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.mix-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--border-color);
}

.mix-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    min-width: 42px;
    text-align: right;
}

/* Regeneration Options */
.regeneration-options {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

.options-title {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.regen-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.regen-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--surface-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.regen-btn:hover {
    background: var(--surface-tertiary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.regen-btn svg {
    width: 16px;
    height: 16px;
}

.regen-btn:active {
    transform: scale(0.98);
}

/* Multi-Prompt System */
.multi-prompt-system {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.05), rgba(139, 92, 246, 0.05));
    border: 1px solid rgba(236, 72, 153, 0.2);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 16px;
}

.prompt-fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.prompt-fieldset legend {
    font-weight: 600;
    font-size: var(--text-base);
    color: #ec4899;
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(236, 72, 153, 0.2);
}

.prompt-input-group {
    margin-bottom: 16px;
}

.prompt-input-group:last-of-type {
    margin-bottom: 0;
}

.prompt-group-label {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.vocal-label {
    color: #8b5cf6;
}

.instrumental-label {
    color: #06b6d4;
}

.prompt-hint {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    font-weight: 400;
}

.prompt-textarea.small {
    min-height: 60px;
    font-size: var(--text-sm);
    padding: 10px 12px;
}

/* Provider Selection */
.provider-selection {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

.provider-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.provider-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.provider-option {
    position: relative;
    cursor: pointer;
}

.provider-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.provider-info {
    display: block;
    padding: 12px 16px;
    background: var(--surface-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.provider-option:hover .provider-info {
    border-color: var(--primary-muted);
    background: var(--surface-tertiary);
}

.provider-option input[type="radio"]:checked + .provider-info {
    border-color: var(--primary-color);
    background: rgba(6, 182, 212, 0.08);
}

.provider-option input[type="radio"]:focus-visible + .provider-info {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.provider-name {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.provider-desc {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

/* Responsive Adjustments for Vocal Controls */
@media (max-width: 768px) {
    .sliders-grid {
        grid-template-columns: 1fr;
    }
    
    .vocal-options {
        grid-template-columns: 1fr;
    }
    
    .regen-buttons {
        flex-direction: column;
    }
    
    .regen-btn {
        justify-content: center;
    }
    
    .provider-options {
        grid-template-columns: 1fr;
    }
    
    .vocal-enhanced-controls,
    .track-separation-controls,
    .multi-prompt-system {
        padding: 16px;
    }
}

/* Animation for Vocal Toggle */
@keyframes vocalPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.toggle-switch.active .toggle-track {
    animation: vocalPulse 2s ease-in-out infinite;
}

/* Stem Indicator Animation */
@keyframes stemGlow {
    0%, 100% { box-shadow: 0 0 8px currentColor; }
    50% { box-shadow: 0 0 16px currentColor, 0 0 24px currentColor; }
}

.mix-indicator.active {
    animation: stemGlow 1.5s ease-in-out infinite;
}
