/* ============================================
   BEATMAKER PRO 2024 - Ultimate Online DAW
   Professional Studio-Grade Stylesheet
   ENHANCED: Fully Responsive, Modern Aesthetics
   ============================================ */

/* CSS Variables - Modern Dark Theme with Refined Colors */
:root {
    /* Backgrounds - Deeper, more luxurious */
    --bg-primary: #03030a;
    --bg-secondary: #080812;
    --bg-tertiary: #0f0f1a;
    --bg-panel: rgba(18, 18, 26, 0.95);
    --bg-hover: #1a1a2a;
    --bg-active: #25253a;
    --bg-elevated: rgba(30, 30, 45, 0.9);
    
    /* Brand Accents - Vibrant but refined */
    --accent-cyan: #00c8ff;
    --accent-magenta: #2a4c7c;
    --accent-lime: #39ff9c;
    --accent-orange: #ff7b4a;
    --accent-purple: #8a6de9;
    --accent-pink: #ff4d8c;
    --accent-yellow: #ffdb5c;
    --accent-red: #ff4d4d;
    
    /* Drum Colors - More distinctive */
    --kick-color: #ff4d8c;
    --snare-color: #00c8ff;
    --hihat-color: #39ff9c;
    --openhat-color: #8a6de9;
    --clap-color: #ff7b4a;
    --tom-color: #ffdb5c;
    --perc-color: #2a4c7c;
    --bass-color: #b967ff;
    
    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #b8b8d0;
    --text-muted: #7a7a9a;
    --text-disabled: #4a4a60;
    
    /* Borders & Shadows */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(0, 200, 255, 0.3);
    
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    
    --shadow-glow-cyan: 0 0 30px rgba(0, 200, 255, 0.3);
    --shadow-glow-pink: 0 0 30px rgba(255, 77, 140, 0.3);
    --shadow-glow-lime: 0 0 30px rgba(57, 255, 156, 0.3);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Font Sizes */
    --text-xs: 0.7rem;
    --text-sm: 0.8rem;
    --text-md: 0.95rem;
    --text-lg: 1.1rem;
    --text-xl: 1.3rem;
    --text-2xl: 1.6rem;
    --text-3xl: 2rem;
    
    /* Z-Index Scale */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal: 300;
    --z-toast: 400;
    --z-overlay: 500;
    --z-loading: 600;
    --z-crow: 1000;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary) !important;
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(0, 200, 255, 0.05) 0%, transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(255, 77, 140, 0.05) 0%, transparent 30%);
    pointer-events: none;
    z-index: -1;
}

/* Prevent scroll jumping */
html, body {
    scroll-behavior: auto !important;
}

/* Custom Scrollbar - Enhanced */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

::-webkit-scrollbar-corner {
    background: var(--bg-secondary);
}

/* Selection */
::selection {
    background: var(--accent-cyan);
    color: var(--bg-primary);
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-cyan);
    color: var(--bg-primary);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-weight: 600;
    z-index: 9999;
    transition: top var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

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

/* ============================================
   HEADER - Enhanced
   ============================================ */
.main-header {
    background: linear-gradient(180deg, rgba(8, 8, 18, 0.95) 0%, rgba(3, 3, 10, 0.98) 100%);
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-md) var(--space-xl);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-sm);
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    position: relative;
}

.logo-pulse {
    position: absolute;
    left: -4px;
    width: 40px;
    height: 40px;
    background: var(--accent-cyan);
    border-radius: 50%;
    opacity: 0.2;
    animation: logo-pulse 2s infinite;
}

@keyframes logo-pulse {
    0%, 100% { transform: scale(1); opacity: 0.2; }
    50% { transform: scale(1.5); opacity: 0; }
}

.logo-icon {
    width: 36px;
    height: 36px;
    color: var(--accent-cyan);
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 15px var(--accent-cyan));
}

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

.logo-text {
    display: flex;
    align-items: baseline;
    gap: var(--space-xs);
}

.logo h1 {
    font-size: var(--text-xl);
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff, var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.logo-pro {
    color: var(--accent-pink);
    font-weight: 800;
    text-shadow: 0 0 15px var(--accent-pink);
}

.logo-version {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-weight: 500;
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

/* Navigation - Enhanced */
.main-nav {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.nav-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-cyan);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-cyan);
}

.nav-btn.highlight {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border-color: transparent;
    color: var(--bg-primary);
    font-weight: 600;
}

.nav-btn.highlight:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 200, 255, 0.4);
}

.nav-badge {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-pink));
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    color: var(--bg-primary);
    font-weight: 600;
    font-size: var(--text-xs);
    box-shadow: var(--shadow-glow-cyan);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    padding: var(--space-sm);
    width: 44px;
    height: 44px;
    justify-content: center;
    align-items: center;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition-fast);
    border-radius: var(--radius-full);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ============================================
   MOBILE OPTIMIZATION BANNER
   ============================================ */
.mobile-optimization-banner {
    background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-cyan) 100%);
    color: white;
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: slideDown 0.5s ease;
    font-weight: 500;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.mobile-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.banner-icon {
    font-size: 28px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.banner-text {
    flex: 1;
    font-size: 15px;
    line-height: 1.5;
}

.banner-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}

.banner-close:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

/* ============================================
   ADS - Optimized Placements
   ============================================ */
.ad-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin: var(--space-md) auto;
    overflow: hidden;
    position: relative;
}

.ad-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 0%, rgba(255,255,255,0.02) 50%, transparent 100%);
    pointer-events: none;
}

.ad-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    margin-bottom: var(--space-xs);
}

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

.ad-incontent {
    margin: var(--space-xl) auto;
}

/* ============================================
   MAIN CONTAINER - FULL SCREEN OPTIMIZED
   ============================================ */
.main-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    width: 100%;
}

/* ============================================
   PANELS - Glassmorphism Enhanced
   ============================================ */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255,255,255,0.02);
    overflow: hidden;
    transition: all var(--transition-normal);
    width: 100%;
}

.panel:hover {
    border-color: var(--border-hover);
    box-shadow: 0 20px 48px rgba(0, 200, 255, 0.1), inset 0 0 0 1px rgba(0,200,255,0.1);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-xl);
    background: linear-gradient(90deg, rgba(0, 200, 255, 0.08) 0%, transparent 100%);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--accent-cyan);
}

.panel-title h2 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.panel-title svg {
    filter: drop-shadow(0 0 10px var(--accent-cyan));
    width: 20px;
    height: 20px;
}

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

/* ============================================
   ACTION BUTTONS - Enhanced
   ============================================ */
.action-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.action-btn:hover {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    color: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-cyan);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.action-btn i {
    font-size: 14px;
}

.action-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 var(--space-xs);
}

.collapse-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-xs);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.collapse-btn[aria-expanded="false"] {
    transform: rotate(-90deg);
}

.collapse-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

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

/* ============================================
   TRANSPORT CONTROLS - Enhanced
   ============================================ */
.transport-panel {
    padding: var(--space-xl);
}

.transport-grid {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--space-xl);
    align-items: center;
}

.transport-main {
    display: flex;
    gap: var(--space-md);
}

.transport-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.transport-btn svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.transport-btn:hover {
    transform: scale(1.08);
    border-color: var(--accent-cyan);
    box-shadow: var(--shadow-glow-cyan);
}

.play-btn:hover {
    background: var(--accent-lime);
    border-color: var(--accent-lime);
    color: var(--bg-primary);
    box-shadow: 0 0 30px rgba(57, 255, 156, 0.5);
}

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

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

.record-btn {
    border-color: var(--accent-pink);
    position: relative;
}

.record-btn:hover,
.record-btn.recording {
    background: var(--accent-pink);
    color: var(--text-primary);
    box-shadow: 0 0 30px rgba(255, 77, 140, 0.5);
}

.record-indicator {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    background: var(--accent-red);
    border-radius: 50%;
    opacity: 0;
    transition: opacity var(--transition-fast);
    box-shadow: 0 0 10px var(--accent-red);
}

.record-btn.recording .record-indicator {
    opacity: 1;
    animation: record-blink 1s infinite;
}

@keyframes record-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* Transport Settings */
.transport-settings {
    display: flex;
    gap: var(--space-xl);
    flex-wrap: wrap;
    justify-content: center;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    min-width: 100px;
}

.setting-group label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-weight: 600;
}

.bpm-control {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    padding: 2px;
}

.bpm-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: var(--text-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bpm-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    background: var(--bg-hover);
}

.setting-group input[type="number"] {
    width: 70px;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--accent-cyan);
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--text-md);
    font-weight: 600;
    text-align: center;
}

.setting-group input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 2px rgba(0, 200, 255, 0.2);
}

.setting-group input[type="range"] {
    width: 120px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    outline: none;
}

.setting-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-cyan);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 0 10px var(--accent-cyan);
}

.setting-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.3);
    box-shadow: 0 0 20px var(--accent-cyan);
}

.setting-group select {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: var(--text-sm);
    cursor: pointer;
    font-weight: 500;
    min-width: 80px;
}

/* Vertical Slider - Fixed Warning */
input[type=range].vertical-slider,
.volume-slider {
    writing-mode: vertical-lr;
    direction: rtl;
    height: 120px;
    width: 24px;
    -webkit-appearance: slider-vertical;
    appearance: auto;
    background: linear-gradient(to top, var(--accent-cyan), var(--accent-pink));
    border-radius: var(--radius-full);
    padding: 2px;
}

input[type=range].vertical-slider::-webkit-slider-thumb,
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 15px var(--accent-cyan);
    border: 2px solid var(--accent-cyan);
}

.swing-value, .volume-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--text-sm);
    color: var(--accent-cyan);
    font-weight: 600;
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    text-align: center;
}

/* Transport Display */
.transport-display {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-sm);
    min-width: 160px;
}

.time-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--accent-cyan);
    text-shadow: 0 0 30px rgba(0, 200, 255, 0.5);
    letter-spacing: 2px;
    background: var(--bg-tertiary);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    width: fit-content;
}

.beat-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--text-md);
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
}

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

.pattern-display label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.pattern-display select {
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-weight: 500;
}

/* ============================================
   VISUALIZER - FULL SCREEN
   ============================================ */
.visualizer-panel {
    padding: var(--space-md);
    position: relative;
    height: auto;
    width: 100%;
    background: var(--bg-secondary);
}

.visualizer-controls {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    display: flex;
    gap: var(--space-xs);
    z-index: 10;
}

.viz-btn {
    padding: 6px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.viz-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.viz-btn.active {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    color: var(--bg-primary);
    box-shadow: var(--shadow-glow-cyan);
}

#audio-visualizer {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    box-shadow: inset 0 0 30px rgba(0,0,0,0.5);
}

/* ============================================
   SEQUENCER - FULL WIDTH
   ============================================ */
.sequencer-panel {
    min-height: 350px;
    width: 100%;
    overflow: hidden;
}

.sequencer-wrapper {
    padding: var(--space-xl);
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
}

.sequencer-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    min-width: min-content;
}

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

.channel-label {
    width: 100px;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.channel-label .channel-key {
    color: var(--accent-cyan);
    font-weight: 700;
    background: var(--bg-primary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 9px;
}

.channel-label .channel-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-label.kick .channel-name { color: var(--kick-color); }
.channel-label.snare .channel-name { color: var(--snare-color); }
.channel-label.hihat .channel-name { color: var(--hihat-color); }
.channel-label.openhat .channel-name { color: var(--openhat-color); }
.channel-label.clap .channel-name { color: var(--clap-color); }
.channel-label.tom .channel-name { color: var(--tom-color); }
.channel-label.perc .channel-name { color: var(--perc-color); }
.channel-label.bass .channel-name { color: var(--bass-color); }

.step-row {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
}

.step {
    width: 36px;
    height: 44px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.step:hover {
    background: var(--bg-hover);
    border-color: var(--accent-cyan);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 200, 255, 0.3);
    z-index: 2;
}

.step.active {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 20px var(--accent-cyan);
}

.step.active.velocity-medium {
    opacity: 0.7;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
}

.step.active.velocity-low {
    opacity: 0.4;
    background: var(--accent-purple);
}

.step.playing {
    animation: step-flash 0.1s ease;
    z-index: 3;
}

@keyframes step-flash {
    0% { transform: scale(1); box-shadow: 0 0 0 transparent; }
    50% { transform: scale(1.2); box-shadow: 0 0 30px var(--accent-cyan); }
    100% { transform: scale(1); box-shadow: 0 0 0 transparent; }
}

.step.beat-marker {
    border-top: 3px solid var(--accent-magenta);
}

/* Step Markers */
.step-markers {
    display: flex;
    gap: 4px;
    padding: 0 var(--space-xl);
    padding-left: calc(100px + var(--space-xl) + var(--space-sm));
    margin-top: var(--space-xs);
    width: 100%;
}

.step-marker {
    width: 36px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-weight: 500;
}

.step-marker.beat {
    color: var(--accent-magenta);
    font-weight: 700;
    text-shadow: 0 0 10px var(--accent-magenta);
}

/* ============================================
   DRUM PADS - ENHANCED
   ============================================ */
.drum-pads-panel {
    padding: var(--space-xl);
    width: 100%;
}

.kit-selector {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-sm);
}

.kit-selector label {
    color: var(--text-secondary);
    font-weight: 600;
}

.kit-selector select {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: var(--text-sm);
    cursor: pointer;
    font-weight: 500;
    min-width: 120px;
}

.drum-pads-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: var(--space-md);
    margin-top: var(--space-xl);
    width: 100%;
}

.drum-pad {
    aspect-ratio: 1;
    background: linear-gradient(145deg, var(--bg-tertiary), var(--bg-secondary));
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    width: 100%;
    box-shadow: var(--shadow-sm);
}

.drum-pad::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(0, 200, 255, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.drum-pad:hover {
    transform: translateY(-6px) scale(1.03);
    border-color: var(--accent-cyan);
    box-shadow: 0 12px 30px rgba(0, 200, 255, 0.3);
}

.drum-pad:hover::before {
    opacity: 1;
}

.drum-pad:active {
    transform: scale(0.95);
}

.drum-pad.active {
    border-color: var(--accent-lime);
    box-shadow: 0 0 40px rgba(57, 255, 156, 0.5);
}

.drum-pad.active::before {
    opacity: 1;
    background: radial-gradient(circle at center, rgba(57, 255, 156, 0.3) 0%, transparent 70%);
}

/* Drum pad specific active colors */
.drum-pad.kick.active { border-color: var(--kick-color); box-shadow: 0 0 40px rgba(255, 77, 140, 0.5); }
.drum-pad.snare.active { border-color: var(--snare-color); box-shadow: 0 0 40px rgba(0, 200, 255, 0.5); }
.drum-pad.hihat.active { border-color: var(--hihat-color); box-shadow: 0 0 40px rgba(57, 255, 156, 0.5); }
.drum-pad.openhat.active { border-color: var(--openhat-color); box-shadow: 0 0 40px rgba(138, 109, 233, 0.5); }
.drum-pad.clap.active { border-color: var(--clap-color); box-shadow: 0 0 40px rgba(255, 123, 74, 0.5); }
.drum-pad.tom.active { border-color: var(--tom-color); box-shadow: 0 0 40px rgba(255, 219, 92, 0.5); }
.drum-pad.perc.active { border-color: var(--perc-color); box-shadow: 0 0 40px rgba(42, 76, 124, 0.5); }
.drum-pad.bass.active { border-color: var(--bass-color); box-shadow: 0 0 40px rgba(185, 103, 255, 0.5); }

.pad-name {
    font-size: var(--text-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
    color: var(--text-primary);
}

.pad-key {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    z-index: 1;
    background: rgba(0,0,0,0.3);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.keyboard-hint {
    margin-top: var(--space-xl);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    flex-wrap: wrap;
    border: 1px solid var(--border-color);
}

.hint-label {
    color: var(--text-muted);
    font-weight: 600;
}

.hint-divider {
    color: var(--border-color);
}

kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-tertiary));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--accent-cyan);
    box-shadow: 0 2px 0 var(--bg-tertiary);
}

/* ============================================
   MIXER & EFFECTS - ENHANCED
   ============================================ */
.mixer-panel {
    padding: var(--space-xl);
    width: 100%;
}

.mixer-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.mixer-section h3,
.effects-section h3 {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Mixer Channels */
.mixer-channels {
    display: flex;
    gap: var(--space-md);
    overflow-x: auto;
    padding: var(--space-md) 0;
    width: 100%;
}

.mixer-channel {
    min-width: 80px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.mixer-channel:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-cyan);
}

.channel-header {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: var(--space-xs);
    border-bottom: 2px solid;
    width: 100%;
    margin-bottom: var(--space-xs);
}

.channel-header.kick { border-color: var(--kick-color); color: var(--kick-color); }
.channel-header.snare { border-color: var(--snare-color); color: var(--snare-color); }
.channel-header.hihat { border-color: var(--hihat-color); color: var(--hihat-color); }
.channel-header.openhat { border-color: var(--openhat-color); color: var(--openhat-color); }
.channel-header.clap { border-color: var(--clap-color); color: var(--clap-color); }
.channel-header.tom { border-color: var(--tom-color); color: var(--tom-color); }
.channel-header.perc { border-color: var(--perc-color); color: var(--perc-color); }
.channel-header.bass { border-color: var(--bass-color); color: var(--bass-color); }

.channel-controls {
    display: flex;
    gap: 6px;
    margin: var(--space-xs) 0;
}

.mute-btn, .solo-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mute-btn:hover {
    border-color: var(--accent-pink);
    color: var(--accent-pink);
    background: var(--bg-hover);
}

.solo-btn:hover {
    border-color: var(--accent-yellow);
    color: var(--accent-yellow);
    background: var(--bg-hover);
}

.mute-btn.active {
    background: var(--accent-pink);
    border-color: var(--accent-pink);
    color: var(--text-primary);
}

.solo-btn.active {
    background: var(--accent-yellow);
    border-color: var(--accent-yellow);
    color: var(--bg-primary);
}

.channel-meter {
    width: 6px;
    height: 80px;
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
    margin: var(--space-xs) 0;
}

.meter-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, var(--accent-lime) 0%, var(--accent-yellow) 50%, var(--accent-pink) 100%);
    transition: height 0.05s ease;
    min-height: 2px;
    border-radius: var(--radius-full);
}

/* Effects Rack */
.effects-rack {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-lg);
    width: 100%;
}

.effect-unit {
    background: var(--bg-tertiary);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.effect-unit:hover {
    border-color: var(--accent-cyan);
    box-shadow: var(--shadow-glow-cyan);
}

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

.effect-header label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.effect-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--text-md);
    color: var(--accent-cyan);
    font-weight: 600;
}

.effect-unit input[type="range"] {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    outline: none;
    margin: var(--space-xs) 0;
}

.effect-unit input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-cyan);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 0 10px var(--accent-cyan);
}

.effect-presets {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: var(--space-xs);
}

.preset-btn {
    flex: 1;
    min-width: 50px;
    padding: 6px 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preset-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    background: var(--bg-hover);
    transform: translateY(-2px);
}

/* ============================================
   PATTERN MANAGER
   ============================================ */
.pattern-manager-panel {
    padding: var(--space-xl);
    width: 100%;
}

.pattern-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: var(--space-sm);
    width: 100%;
}

.pattern-slot {
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    position: relative;
    overflow: hidden;
}

.pattern-slot::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(0, 200, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.pattern-slot:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow-cyan);
}

.pattern-slot:hover::before {
    opacity: 1;
}

.pattern-slot.active {
    border-color: var(--accent-lime);
    background: rgba(57, 255, 156, 0.1);
    box-shadow: 0 0 30px rgba(57, 255, 156, 0.3);
}

.pattern-slot.active::before {
    opacity: 1;
    background: radial-gradient(circle at center, rgba(57, 255, 156, 0.2) 0%, transparent 70%);
}

.pattern-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--accent-cyan);
    z-index: 1;
}

.pattern-name {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    z-index: 1;
}

/* ============================================
   PIANO ROLL - FULL WIDTH
   ============================================ */
.piano-roll-panel {
    margin-top: var(--space-lg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    width: 100%;
}

.piano-roll-container {
    display: flex;
    background: var(--bg-secondary);
    overflow-x: auto;
    padding: var(--space-md);
    gap: var(--space-sm);
}

.piano-keys {
    display: flex;
    flex-direction: column;
    border-right: 2px solid var(--accent-cyan);
    position: sticky;
    left: 0;
    background: var(--bg-secondary);
    z-index: 5;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.piano-key {
    width: 70px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.1s;
    font-weight: 600;
    font-size: var(--text-xs);
}

.piano-key.white {
    background: linear-gradient(135deg, #ffffff, #f0f0f0);
    color: #333;
}

.piano-key.black {
    background: linear-gradient(135deg, #444, #222);
    color: white;
}

.piano-key:hover {
    transform: scale(1.05) translateX(5px);
    box-shadow: 0 0 20px var(--accent-cyan);
    z-index: 10;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.piano-key:active {
    transform: scale(0.95);
}

.piano-grid {
    display: grid;
    gap: 2px;
    flex: 1;
    min-width: min-content;
}

.piano-cell {
    width: 36px;
    height: 32px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.1s;
}

.piano-cell:hover {
    background: rgba(0, 200, 255, 0.2);
    transform: scale(1.05);
    border-color: var(--accent-cyan);
}

.piano-cell.active {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-pink));
    box-shadow: 0 0 20px var(--accent-cyan);
    border-color: var(--accent-cyan);
}

/* ============================================
   MODALS - ENHANCED
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    padding: var(--space-md);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.modal-content {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 550px;
    max-height: 85vh;
    overflow: auto;
    position: relative;
    transform: scale(0.95) translateY(20px);
    transition: transform var(--transition-normal);
    box-shadow: var(--shadow-lg);
}

.modal-wide {
    max-width: 800px;
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-xl);
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(90deg, rgba(0, 200, 255, 0.1) 0%, transparent 100%);
}

.modal-header h2 {
    font-size: var(--text-xl);
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-pink));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-close {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: var(--text-2xl);
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--accent-pink);
    background: var(--bg-hover);
    border-color: var(--accent-pink);
    transform: rotate(90deg);
}

.modal-body {
    padding: var(--space-xl);
}

.input-group {
    margin-bottom: var(--space-xl);
}

.input-group label {
    display: block;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input[type="text"] {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: var(--text-md);
    transition: all var(--transition-fast);
}

.input-group input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 200, 255, 0.2);
}

.saved-projects h3 {
    font-size: var(--text-md);
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.saved-projects ul {
    list-style: none;
    max-height: 250px;
    overflow-y: auto;
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
    padding: var(--space-xs);
}

.saved-projects li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-xs);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.saved-projects li:hover {
    background: var(--bg-hover);
    border-color: var(--accent-cyan);
    transform: translateX(5px);
}

.saved-projects .project-name {
    font-weight: 600;
    color: var(--text-primary);
}

.saved-projects .project-date {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.import-section {
    margin-top: var(--space-xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border-color);
}

.import-section label {
    display: block;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
    font-weight: 600;
}

.import-section input[type="file"] {
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    cursor: pointer;
}

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

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    color: var(--bg-primary);
    box-shadow: 0 4px 15px rgba(0, 200, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 200, 255, 0.5);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #ff4d4d 0%, #b3003a 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 77, 77, 0.3);
}

.btn-danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 77, 77, 0.5);
}

.btn-large {
    padding: var(--space-lg) var(--space-2xl);
    font-size: var(--text-lg);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-width: 400px;
}

.toast {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-cyan);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    animation: toast-in 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.toast.success {
    border-left-color: var(--accent-lime);
}

.toast.error {
    border-left-color: var(--accent-pink);
}

.toast.warning {
    border-left-color: var(--accent-yellow);
}

@keyframes toast-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-out {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-out {
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-loading);
    transition: opacity var(--transition-slow);
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    max-width: 400px;
    padding: var(--space-2xl);
}

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--accent-cyan);
    border-right-color: var(--accent-pink);
    border-bottom-color: var(--accent-lime);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-xl);
}

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

.loading-text h2 {
    font-size: var(--text-2xl);
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta), var(--accent-pink));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: var(--space-xs);
    font-weight: 800;
}

.loading-text p {
    color: var(--text-secondary);
    font-size: var(--text-md);
}

.loading-progress {
    width: 300px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    margin-top: var(--space-xl);
    overflow: hidden;
}

.loading-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-magenta), var(--accent-pink));
    border-radius: var(--radius-full);
    animation: loading-progress 2s ease-in-out infinite;
}

@keyframes loading-progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* ============================================
   FOOTER - ENHANCED
   ============================================ */
.main-footer {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-top: 1px solid var(--border-color);
    padding: var(--space-3xl) var(--space-xl);
    margin-top: var(--space-3xl);
    width: 100%;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: var(--space-2xl);
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.footer-section h3 {
    font-size: var(--text-xl);
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.footer-section h4 {
    font-size: var(--text-md);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-section p {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: 1.7;
}

.footer-social {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.footer-social a {
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 50%;
    border: 1px solid var(--border-color);
}

.footer-social a:hover {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow-cyan);
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: var(--space-sm);
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
    display: inline-block;
}

.footer-section a:hover {
    color: var(--accent-cyan);
    transform: translateX(5px);
}

.footer-bottom {
    max-width: 1400px;
    margin: var(--space-2xl) auto 0;
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--text-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.footer-bottom i {
    color: var(--accent-pink);
    animation: heart-pulse 1.5s infinite;
}

@keyframes heart-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ============================================
   CROW SIGNATURE & EASTER EGGS
   ============================================ */
.crow-signature {
    position: fixed;
    bottom: 25px;
    right: 25px;
    opacity: 0.15;
    z-index: var(--z-crow);
    pointer-events: none;
    font-size: 28px;
    color: var(--accent-cyan);
    transform: rotate(5deg);
    transition: all var(--transition-normal);
    filter: drop-shadow(0 0 10px var(--accent-cyan));
}

.crow-signature:hover {
    opacity: 0.8;
    transform: rotate(0deg) scale(1.2);
}

/* Recording styles */
.recording-item {
    transition: all var(--transition-fast);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    border: 1px solid var(--border-color);
}

.recording-item:hover {
    transform: translateX(8px);
    background: var(--bg-hover);
    border-color: var(--accent-cyan);
}

/* Velocity modal */
#velocity-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 10px;
    background: linear-gradient(90deg, var(--accent-lime) 0%, var(--accent-yellow) 50%, var(--accent-pink) 100%);
    border-radius: var(--radius-full);
    outline: none;
}

#velocity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 20px var(--accent-cyan);
    border: 2px solid var(--accent-cyan);
}

/* Welcome footer */
.welcome-footer {
    background: rgba(255, 255, 255, 0.03);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    margin-top: var(--space-lg);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: var(--text-sm);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent-cyan);
}

/* Step numbers for guide */
.step-num {
    display: inline-flex;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-pink));
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    color: var(--bg-primary);
    font-weight: bold;
    margin-right: var(--space-sm);
    font-size: var(--text-sm);
}

/* ============================================
   RESPONSIVE DESIGN - ENHANCED
   ============================================ */
@media (max-width: 1280px) {
    .transport-grid {
        gap: var(--space-lg);
    }
    
    .pattern-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .drum-pads-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    .transport-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .transport-display {
        align-items: center;
        flex-direction: row;
        justify-content: center;
        gap: var(--space-lg);
        flex-wrap: wrap;
    }
    
    .pattern-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .drum-pads-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: var(--space-lg);
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .main-nav.active {
        display: flex;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .header-content {
        flex-wrap: wrap;
    }
    
    .transport-main {
        justify-content: center;
    }
    
    .transport-btn {
        width: 56px;
        height: 56px;
    }
    
    .transport-settings {
        justify-content: center;
    }
    
    .step {
        width: 30px;
        height: 38px;
    }
    
    .step-marker {
        width: 30px;
    }
    
    .channel-label {
        width: 80px;
        font-size: 9px;
    }
    
    .drum-pads-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-sm);
    }
    
    .mixer-channels {
        justify-content: flex-start;
    }
    
    .effects-rack {
        grid-template-columns: 1fr;
    }
    
    .pattern-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .piano-key {
        width: 50px;
    }
    
    .piano-cell {
        width: 28px;
        height: 28px;
    }
    
    .help-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .ad-bottom {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        border-radius: 0;
        z-index: 99;
    }
    
    .main-container {
        padding-bottom: 120px;
        padding: var(--space-lg);
    }
    
    .visualizer-panel {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: var(--text-lg);
    }
    
    .transport-btn {
        width: 48px;
        height: 48px;
    }
    
    .transport-btn svg {
        width: 24px;
        height: 24px;
    }
    
    .transport-settings {
        gap: var(--space-md);
    }
    
    .setting-group {
        min-width: 70px;
    }
    
    .setting-group input[type="range"] {
        width: 80px;
    }
    
    .step {
        width: 24px;
        height: 32px;
    }
    
    .step-marker {
        width: 24px;
        font-size: 9px;
    }
    
    .channel-label {
        width: 70px;
        padding: var(--space-xs) var(--space-xs);
    }
    
    .channel-key {
        display: none;
    }
    
    .drum-pads-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pattern-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .piano-key {
        width: 40px;
        font-size: 9px;
    }
    
    .piano-cell {
        width: 22px;
        height: 22px;
    }
    
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .panel-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .action-btn span {
        display: none;
    }
    
    .action-btn i {
        margin: 0;
    }
    
    .modal-content {
        max-width: 95%;
    }
    
    .modal-header h2 {
        font-size: var(--text-lg);
    }
    
    .toast-container {
        left: var(--space-md);
        right: var(--space-md);
        max-width: none;
    }
    
    .crow-signature {
        bottom: 80px;
        font-size: 22px;
    }
}

@media (max-width: 360px) {
    .step {
        width: 20px;
        height: 28px;
    }
    
    .step-marker {
        width: 20px;
    }
    
    .channel-label {
        width: 60px;
        font-size: 8px;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hidden {
    display: none !important;
}

.invisible {
    visibility: hidden;
}

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

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

/* Focus styles */
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 3px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print styles */
@media print {
    .ad-section,
    .modal,
    .toast-container,
    .loading-overlay,
    .crow-signature {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .panel {
        break-inside: avoid;
        border: 1px solid #ccc;
    }
}

/* ============================================
   COMPLETE MOBILE REDESIGN - FIXES ALL ISSUES
   ============================================ */
@media (max-width: 768px) {
    
    /* Reset containers for mobile */
    .main-container {
        padding: 10px !important;
        gap: 15px !important;
        width: 100%;
        overflow-x: hidden;
    }
    
    /* Make all panels stack properly */
    .panel {
        width: 100% !important;
        margin: 0 !important;
        padding: 12px !important;
        overflow: hidden;
    }
    
    /* Fix transport section */
    .transport-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    .transport-main {
        display: flex !important;
        justify-content: center !important;
        gap: 8px !important;
        flex-wrap: wrap !important;
    }
    
    .transport-btn {
        width: 48px !important;
        height: 48px !important;
    }
    
    .transport-btn svg {
        width: 24px !important;
        height: 24px !important;
    }
    
    .transport-settings {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        width: 100% !important;
    }
    
    .setting-group {
        min-width: auto !important;
        width: 100% !important;
    }
    
    .setting-group input[type="range"] {
        width: 100% !important;
    }
    
    .transport-display {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        width: 100% !important;
    }
    
    .time-display {
        font-size: 1.2rem !important;
        padding: 5px 10px !important;
    }
    
    /* Fix sequencer for mobile */
    .sequencer-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 10px 0 !important;
    }
    
    .sequencer-grid {
        min-width: 800px !important; /* Force horizontal scroll */
    }
    
    .step {
        width: 28px !important;
        height: 36px !important;
    }
    
    .channel-label {
        width: 70px !important;
        font-size: 10px !important;
    }
    
    .step-markers {
        padding-left: 80px !important;
    }
    
    .step-marker {
        width: 28px !important;
        font-size: 9px !important;
    }
    
    /* Fix drum pads - make them grid properly */
    .drum-pads-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8px !important;
        padding: 5px !important;
    }
    
    .drum-pad {
        aspect-ratio: 1/1 !important;
        padding: 8px !important;
        min-width: 0 !important;
    }
    
    .pad-name {
        font-size: 10px !important;
    }
    
    .pad-key {
        font-size: 8px !important;
        padding: 2px 4px !important;
    }
    
    .keyboard-hint {
        flex-wrap: wrap !important;
        padding: 10px !important;
        font-size: 10px !important;
    }
    
    kbd {
        min-width: 24px !important;
        height: 24px !important;
        font-size: 9px !important;
    }
    
    /* Fix mixer - make it scroll horizontally */
    .mixer-channels {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 10px !important;
        padding: 10px 0 !important;
    }
    
    .mixer-channel {
        min-width: 70px !important;
        flex-shrink: 0 !important;
    }
    
    /* Fix effects rack */
    .effects-rack {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    
    .effect-unit {
        padding: 12px !important;
    }
    
    /* Fix pattern grid */
    .pattern-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8px !important;
    }
    
    .pattern-slot {
        padding: 8px !important;
    }
    
    .pattern-number {
        font-size: 1rem !important;
    }
    
    .pattern-name {
        font-size: 8px !important;
    }
    
    /* Fix piano roll */
    .piano-roll-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .piano-keys {
        position: sticky !important;
        left: 0 !important;
        z-index: 5 !important;
    }
    
    .piano-key {
        width: 45px !important;
        height: 28px !important;
        font-size: 9px !important;
    }
    
    .piano-grid {
        min-width: 600px !important;
    }
    
    .piano-cell {
        width: 28px !important;
        height: 28px !important;
    }
    
    /* Fix header/navigation */
    .header-content {
        flex-wrap: wrap !important;
        padding: 8px !important;
    }
    
    .main-nav {
        width: 100% !important;
        display: none !important;
        flex-direction: column !important;
        gap: 5px !important;
        padding: 10px !important;
        background: var(--bg-secondary) !important;
        border-radius: 10px !important;
        margin-top: 10px !important;
    }
    
    .main-nav.active {
        display: flex !important;
    }
    
    .nav-btn {
        width: 100% !important;
        justify-content: center !important;
    }
    
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    .nav-badge {
        display: none !important;
    }
    
    /* Fix modals for mobile */
    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        margin: 10px !important;
        max-height: 80vh !important;
        overflow-y: auto !important;
    }
    
    .modal-body {
        padding: 15px !important;
    }
    
    .help-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .shortcut {
        font-size: 11px !important;
    }
    
    /* Fix toast notifications */
    .toast-container {
        left: 10px !important;
        right: 10px !important;
        bottom: 10px !important;
        max-width: none !important;
    }
    
    .toast {
        padding: 12px !important;
        font-size: 12px !important;
    }
    
    /* Fix footer */
    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .footer-section {
        text-align: center !important;
    }
    
    .footer-social {
        justify-content: center !important;
    }
    
    .footer-bottom {
        flex-direction: column !important;
        gap: 8px !important;
        font-size: 10px !important;
    }
    
    /* Fix crow signature on mobile */
    .crow-signature {
        bottom: 70px !important;
        right: 10px !important;
        font-size: 20px !important;
        opacity: 0.3 !important;
    }
    
    /* Fix recording items */
    .recording-item {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    
    .recording-item > div:last-child {
        width: 100% !important;
        justify-content: space-between !important;
    }
    
    /* Fix panel actions */
    .panel-actions {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 5px !important;
        width: 100% !important;
    }
    
    .action-btn {
        white-space: nowrap !important;
        padding: 6px 10px !important;
        font-size: 10px !important;
    }
    
    .action-btn span {
        display: none !important;
    }
    
    .action-btn i {
        margin: 0 !important;
    }
}

/* Extra small devices (phones under 480px) */
@media (max-width: 480px) {
    .transport-settings {
        grid-template-columns: 1fr !important;
    }
    
    .drum-pads-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .pattern-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .step {
        width: 24px !important;
        height: 32px !important;
    }
    
    .step-marker {
        width: 24px !important;
    }
    
    .channel-label {
        width: 60px !important;
        font-size: 9px !important;
    }
    
    .channel-key {
        display: none !important;
    }
    
    .step-markers {
        padding-left: 70px !important;
    }
    
    .transport-btn {
        width: 42px !important;
        height: 42px !important;
    }
    
    .transport-btn svg {
        width: 20px !important;
        height: 20px !important;
    }
    
    .time-display {
        font-size: 1rem !important;
    }
    
    .piano-key {
        width: 35px !important;
    }
    
    .piano-cell {
        width: 22px !important;
        height: 22px !important;
    }
}

/* Fix touch interactions on mobile */
@media (hover: none) and (pointer: coarse) {
    .step:hover,
    .drum-pad:hover,
    .action-btn:hover,
    .nav-btn:hover {
        transform: none !important;
    }
    
    .step:active,
    .drum-pad:active,
    .action-btn:active,
    .nav-btn:active {
        transform: scale(0.95) !important;
    }
    
    /* Increase touch targets */
    .step,
    .drum-pad,
    .action-btn,
    .nav-btn,
    .piano-key,
    .piano-cell {
        cursor: pointer !important;
        -webkit-tap-highlight-color: rgba(0, 200, 255, 0.2) !important;
    }
}

/* ============================================
   SETTINGS MODAL - COMPLETE REDESIGN
   ============================================ */

/* Modal Base - Clean and modern */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

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

/* Modal Content - Clean card design */
.modal-content {
    background: linear-gradient(135deg, #1a1a2a 0%, #0f0f1a 100%);
    border: 1px solid rgba(0, 200, 255, 0.2);
    border-radius: 24px;
    width: 100%;
    max-width: 550px;
    max-height: 85vh;
    overflow: hidden;
    position: relative;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 200, 255, 0.1);
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    background: linear-gradient(90deg, rgba(0, 200, 255, 0.1) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #00c8ff, #ff4d8c);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    letter-spacing: -0.5px;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 77, 140, 0.2);
    border-color: #ff4d8c;
    transform: rotate(90deg);
}

/* Modal Body - Scrollable */
.modal-body {
    padding: 25px;
    overflow-y: auto;
    max-height: calc(85vh - 130px);
    scrollbar-width: thin;
    scrollbar-color: #00c8ff #1a1a2a;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: #1a1a2a;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #00c8ff;
    border-radius: 3px;
}

/* Settings Sections */
.settings-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.settings-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #00c8ff;
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-section h3::before {
    content: '';
    width: 4px;
    height: 16px;
    background: linear-gradient(135deg, #00c8ff, #ff4d8c);
    border-radius: 2px;
}

/* Setting Rows */
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.setting-row label {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
}

/* Select Inputs */
.setting-row select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 200, 255, 0.3);
    border-radius: 20px;
    padding: 8px 25px 8px 15px;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2300c8ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    min-width: 120px;
}

.setting-row select:hover {
    border-color: #ff4d8c;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ff4d8c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.setting-row select:focus {
    outline: none;
    border-color: #ff4d8c;
    box-shadow: 0 0 0 3px rgba(255, 77, 140, 0.2);
}

/* Range Sliders */
.setting-row input[type="range"] {
    width: 150px;
    height: 6px;
    appearance: none;
    -webkit-appearance: none;
    background: linear-gradient(90deg, #00c8ff, #ff4d8c);
    border-radius: 3px;
    outline: none;
}

.setting-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px #00c8ff;
    border: 2px solid #00c8ff;
    transition: all 0.2s;
}

.setting-row input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px #ff4d8c;
    border-color: #ff4d8c;
}

.setting-row span {
    color: #00c8ff;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    min-width: 45px;
    text-align: right;
}

/* Checkbox styling */
.setting-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #00c8ff;
    transform: scale(1.2);
}

/* Storage Info Box */
.storage-info {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(0, 200, 255, 0.2);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.storage-info div {
    color: #fff;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.storage-info div:last-child {
    border-bottom: none;
}

/* Lookahead value display */
#lookahead-value {
    background: rgba(0, 200, 255, 0.1);
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.85rem;
}

/* Modal Footer */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 25px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Modal Buttons */
.modal-footer .btn {
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    letter-spacing: 0.5px;
}

.modal-footer .btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-footer .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #00c8ff;
    transform: translateY(-2px);
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, #00c8ff, #ff4d8c);
    color: #000;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 200, 255, 0.3);
}

.modal-footer .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 77, 140, 0.4);
}

/* Mobile Responsive for Settings Modal */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95%;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .settings-section {
        padding: 15px;
    }
    
    .setting-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .setting-row select,
    .setting-row input[type="range"] {
        width: 100%;
    }
    
    .setting-row span {
        align-self: flex-end;
    }
    
    .modal-footer {
        flex-direction: column-reverse;
        padding: 15px 20px;
    }
    
    .modal-footer .btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .modal-header h2 {
        font-size: 1rem;
    }
    
    .settings-section h3 {
        font-size: 0.9rem;
    }
    
    .setting-row label {
        font-size: 0.85rem;
    }
    
    .modal-footer .btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
}

/* ============================================
   ALL OTHER MODALS - Consistent Styling
   ============================================ */

/* Save Modal, Load Modal, Help Modal, etc */
#save-modal .modal-content,
#load-modal .modal-content,
#help-modal .modal-content,
#guide-modal .modal-content,
#recordings-modal .modal-content,
#velocity-modal .modal-content,
#secret-modal .modal-content {
    background: linear-gradient(135deg, #1a1a2a 0%, #0f0f1a 100%);
    border: 1px solid rgba(0, 200, 255, 0.2);
}

/* Saved Projects List */
#saved-projects-list,
#load-projects-list {
    list-style: none;
    padding: 0;
    margin: 15px 0;
    max-height: 200px;
    overflow-y: auto;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
}

#saved-projects-list li,
#load-projects-list li {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#saved-projects-list li:hover,
#load-projects-list li:hover {
    background: rgba(0, 200, 255, 0.1);
    padding-left: 20px;
}

#saved-projects-list li:last-child,
#load-projects-list li:last-child {
    border-bottom: none;
}

.project-name {
    font-weight: 600;
    color: #fff;
}

.project-date {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Import Section */
.import-section {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.import-section label {
    display: block;
    margin-bottom: 8px;
    color: #00c8ff;
    font-weight: 500;
}

.import-section input[type="file"] {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 200, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
}

.import-section input[type="file"]::-webkit-file-upload-button {
    background: linear-gradient(135deg, #00c8ff, #ff4d8c);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    color: #000;
    font-weight: 600;
    margin-right: 10px;
    cursor: pointer;
}

/* Recordings List */
.recordings-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.recording-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.recording-item:hover {
    border-color: #00c8ff;
    transform: translateX(5px);
}

.recording-item > div:first-child {
    flex: 1;
}

.recording-item .recording-name {
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.recording-item .recording-date {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.recording-item button {
    padding: 6px 12px;
    border-radius: 20px;
    border: none;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.recording-item .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.recording-item .btn-primary {
    background: linear-gradient(135deg, #00c8ff, #ff4d8c);
    color: #000;
}

.recording-item .btn-danger {
    background: rgba(255, 77, 77, 0.2);
    color: #ff4d4d;
}

.recording-item button:hover {
    transform: scale(1.05);
}

/* Help Modal Specific */
#help-modal .help-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

#help-modal .help-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 15px;
}

#help-modal .help-section h3 {
    color: #00c8ff;
    font-size: 1rem;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#help-modal .shortcut {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.85rem;
    color: #fff;
}

#help-modal .help-tips {
    background: rgba(0, 200, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
}

#help-modal .help-tips h3 {
    color: #ff4d8c;
    margin-bottom: 10px;
}

#help-modal .help-tips ul {
    list-style: none;
    padding: 0;
}

#help-modal .help-tips li {
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
    color: rgba(255, 255, 255, 0.9);
}

#help-modal .help-tips li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #00c8ff;
}

/* Velocity Modal */
#velocity-modal .modal-content {
    max-width: 400px;
    text-align: center;
}

#velocity-modal #velocity-slider {
    width: 100%;
    margin: 20px 0;
}

#velocity-modal #velocity-value {
    font-size: 2rem;
    font-weight: bold;
    color: #00c8ff;
    text-shadow: 0 0 20px #00c8ff;
}

/* Secret Modal */
#secret-modal .modal-content {
    border: 2px solid #00c8ff;
    box-shadow: 0 0 50px rgba(0, 200, 255, 0.3);
}

#secret-modal .modal-header {
    border-bottom: 1px solid #00c8ff;
}

#secret-modal .modal-header h2 {
    -webkit-text-fill-color: #00c8ff;
    text-shadow: 0 0 20px #00c8ff;
}

#secret-modal .fa-crow {
    color: #ff4d8c;
    animation: cawFloat 3s infinite;
}

@keyframes cawFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Clear All Recordings Button */
#clear-all-recordings {
    background: linear-gradient(135deg, #ff4d4d, #b3003a);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

#clear-all-recordings:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 77, 77, 0.4);
}

/* Mobile Responsive for all modals */
@media (max-width: 768px) {
    #help-modal .help-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .recording-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .recording-item > div:last-child {
        width: 100%;
        display: flex;
        gap: 8px;
    }
    
    .recording-item button {
        flex: 1;
    }
}