:root {
    --primary-neon: #00ff41;
    --secondary-neon: #ff0080;
    --accent-neon: #00ffff;
    --warning-neon: #ffff00;
    --bg-dark: #0a0a0f;
    --bg-medium: #1a1a2e;
    --bg-light: #2d2d4a;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-glow: 0 0 20px;
    --border-radius: 16px;
    --font-main: 'Segoe UI', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

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

body {
    font-family: var(--font-main);
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 255, 65, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 0, 128, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-medium) 50%, #16213e 100%);
    color: var(--primary-neon);
    min-height: 100vh;
    overflow-x: hidden;
    backdrop-filter: blur(10px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-glow) rgba(0, 255, 65, 0.3);
    transform: scale(0.85);
    transform-origin: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header:hover {
    transform: scale(0.87);
    box-shadow: var(--shadow-glow) rgba(0, 255, 65, 0.5);
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary-neon), var(--accent-neon));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(0, 255, 65, 0.5);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.info {
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 400;
}

.info a {
    color: var(--accent-neon);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.2);
}

.info a:hover {
    color: var(--primary-neon);
    background: rgba(0, 255, 65, 0.15);
    border-color: rgba(0, 255, 65, 0.3);
    transform: translateY(-1px);
    text-shadow: 0 0 8px currentColor;
    box-shadow: 0 4px 12px rgba(0, 255, 65, 0.2);
}

.info a:active {
    transform: translateY(0);
}

.drop-zone {
    border: 2px dashed var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2rem 1rem;
    text-align: center;
    margin: 1rem 0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    transform: scale(0.85);
    transform-origin: center;
    position: relative;
    overflow: hidden;
}

.drop-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.drop-zone:hover::before {
    left: 100%;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--secondary-neon);
    background: rgba(255, 0, 128, 0.1);
    box-shadow: var(--shadow-glow) rgba(255, 0, 128, 0.4);
    transform: scale(0.87);
}

.drop-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px currentColor);
}

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

.drop-text p {
    font-size: 1rem;
    margin: 0.5rem 0;
    font-weight: 500;
}

.select-file-btn {
    background: linear-gradient(135deg, var(--primary-neon), #00cc33);
    color: var(--bg-dark);
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

.select-file-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--secondary-neon), #cc0066);
    transition: left 0.3s;
    z-index: -1;
}

.select-file-btn:hover::before {
    left: 0;
}

.select-file-btn:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 0, 128, 0.4);
}

.player-controls {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 1rem 0;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-glow) rgba(0, 255, 65, 0.2);
    transform: scale(0.85);
    transform-origin: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-controls:hover {
    box-shadow: var(--shadow-glow) rgba(0, 255, 65, 0.3);
}

.track-info {
    text-align: center;
    margin-bottom: 1.5rem;
}

.track-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-neon);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px currentColor;
    letter-spacing: -0.01em;
}

.track-time {
    font-size: 0.9rem;
    color: var(--warning-neon);
    font-family: var(--font-mono);
    font-weight: 500;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.control-btn {
    background: var(--glass-bg);
    color: var(--primary-neon);
    border: 1px solid var(--glass-border);
    padding: 0.8rem;
    font-size: 1.2rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, var(--primary-neon) 0%, transparent 70%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translate(-50%, -50%);
    opacity: 0;
    z-index: -1;
}

.control-btn:hover::before {
    width: 100px;
    height: 100px;
    opacity: 0.2;
}

.control-btn:hover {
    background: var(--primary-neon);
    color: var(--bg-dark);
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 255, 65, 0.4);
}

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

.play-pause {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary-neon), #00cc33);
    color: var(--bg-dark);
}

.play-pause:hover {
    background: linear-gradient(135deg, #00cc33, var(--primary-neon));
}

.progress-container,
.volume-container {
    margin: 1rem 0;
}

.progress-bar,
.volume-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-light);
    border-radius: 10px;
    outline: none;
    cursor: pointer;
    appearance: none;
    transition: all 0.3s ease;
}

.progress-bar::-webkit-slider-track,
.volume-bar::-webkit-slider-track {
    height: 8px;
    background: var(--bg-light);
    border-radius: 10px;
}

.progress-bar::-webkit-slider-thumb,
.volume-bar::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--primary-neon), #00cc33);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar::-webkit-slider-thumb:hover,
.volume-bar::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.8);
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.volume-container span {
    font-size: 1.2rem;
    filter: drop-shadow(0 0 5px currentColor);
}

.volume-bar {
    width: 120px;
}

.visualizer-container {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 2rem 0;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-glow) rgba(255, 0, 128, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.visualizer-container:hover {
    box-shadow: var(--shadow-glow) rgba(255, 0, 128, 0.3);
}

.visualizer-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.fullscreen-btn {
    background: linear-gradient(135deg, var(--secondary-neon), #cc0066);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.fullscreen-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-neon), #0099cc);
    transition: left 0.3s;
    z-index: -1;
}

.fullscreen-btn:hover::before {
    left: 0;
}

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

#visualizer {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    background: 
        radial-gradient(circle at 30% 20%, rgba(0, 4, 40, 0.8) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(0, 78, 146, 0.8) 0%, transparent 50%),
        linear-gradient(135deg, #000428 0%, #004e92 100%);
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
}

/* WebGPU overlay canvases align exactly over base canvases */
#webgpuCanvas {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: 12px;
    background: transparent;
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
    margin-top: 12px;
}

/* Fullscreen Visualizer */
.fullscreen-visualizer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-dark);
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

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

#fullscreenCanvas {
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 30% 20%, rgba(0, 4, 40, 0.8) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(0, 78, 146, 0.8) 0%, transparent 50%),
        linear-gradient(135deg, #000428 0%, #004e92 100%);
}

#fullscreenWebgpuCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    pointer-events: none;
}

.fullscreen-controls {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
}

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

.exit-fullscreen-btn {
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.9), rgba(200, 0, 0, 0.9));
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.exit-fullscreen-btn:hover {
    background: linear-gradient(135deg, rgba(255, 0, 0, 1), rgba(200, 0, 0, 1));
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 0, 0, 0.4);
}

.fullscreen-viz-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-glow) rgba(0, 0, 0, 0.2);
}

.fullscreen-viz-controls select,
.fullscreen-viz-controls input {
    background: var(--bg-light);
    color: var(--primary-neon);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.5rem;
    font-size: 0.9rem;
    font-family: var(--font-main);
    transition: all 0.3s ease;
}

.fullscreen-viz-controls select:focus,
.fullscreen-viz-controls input:focus {
    outline: none;
    border-color: var(--primary-neon);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.fullscreen-viz-controls label {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--warning-neon);
    font-size: 0.9rem;
    font-weight: 500;
}

.visualizer-controls {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.visualizer-controls label {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--warning-neon);
    font-size: 0.9rem;
    font-weight: 500;
}

.visualizer-controls select,
.visualizer-controls input[type="range"] {
    background: var(--bg-light);
    color: var(--primary-neon);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.5rem;
    font-family: var(--font-main);
    transition: all 0.3s ease;
}

.viz-actions {
    display: flex;
    gap: 0.8rem;
}

.viz-action-btn {
    background: linear-gradient(135deg, var(--accent-neon), #0099cc);
    color: #0a0a0f;
    border: none;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.viz-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 255, 255, 0.25);
}

/* Mode filter controls */
.mode-filter {
    display: block;
    margin-top: 0.5rem;
}
.mode-filter-title {
    font-size: 0.8rem;
    opacity: 0.8;
}
.mode-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    gap: 4px 12px;
    margin-top: 6px;
}
.fullscreen-viz-controls .mode-filter-grid {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
}
.mode-filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.visualizer-controls select:focus,
.visualizer-controls input[type="range"]:focus {
    outline: none;
    border-color: var(--primary-neon);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.playlist {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 2rem 0;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-glow) rgba(0, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.playlist:hover {
    box-shadow: var(--shadow-glow) rgba(0, 255, 255, 0.3);
}

.playlist h3 {
    color: var(--accent-neon);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 0 15px currentColor;
    letter-spacing: -0.02em;
}

.playlist-item {
    padding: 1rem;
    margin: 0.8rem 0;
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.playlist-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.playlist-item:hover::before {
    left: 100%;
}

.playlist-item:hover {
    background: rgba(0, 255, 255, 0.1);
    transform: translateX(8px);
    border-color: var(--accent-neon);
    box-shadow: 0 4px 20px rgba(0, 255, 255, 0.2);
}

.playlist-item.active {
    background: rgba(255, 0, 128, 0.1);
    border-color: var(--secondary-neon);
    color: var(--secondary-neon);
    box-shadow: 0 4px 20px rgba(255, 0, 128, 0.3);
}

.playlist-item .song-name {
    font-weight: 600;
    font-size: 1rem;
}

.playlist-item .song-duration {
    opacity: 0.7;
    font-size: 0.9rem;
    font-family: var(--font-mono);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .header {
        transform: scale(0.7);
        margin-bottom: 1rem;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .drop-zone {
        transform: scale(0.7);
        margin: 0.5rem 0;
    }
    
    .player-controls {
        transform: scale(0.7);
        margin: 0.5rem 0;
    }
    
    .controls {
        gap: 0.8rem;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .play-pause {
        width: 56px;
        height: 56px;
        font-size: 1.3rem;
    }
    
    .visualizer-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    #visualizer {
        height: 300px;
    }
    
    .fullscreen-controls {
        top: 1rem;
        right: 1rem;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.8rem;
    }
    
    .fullscreen-viz-controls {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.8rem;
    }
    
    .volume-container {
        gap: 0.8rem;
    }
    
    .volume-bar {
        width: 100px;
    }
}

@media (max-width: 480px) {
    .header {
        transform: scale(0.6);
    }
    
    .drop-zone {
        transform: scale(0.6);
        padding: 1.5rem 0.8rem;
    }
    
    .player-controls {
        transform: scale(0.6);
    }
    
    .playlist-item {
        padding: 0.8rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .fullscreen-controls {
        flex-direction: column;
    }
}

/* Enhanced animations and loading states */
.loading {
    animation: pulse-glow 2s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
    from { 
        box-shadow: var(--shadow-glow) rgba(0, 255, 65, 0.3);
        transform: scale(1);
    }
    to { 
        box-shadow: var(--shadow-glow) rgba(0, 255, 65, 0.6);
        transform: scale(1.02);
    }
}

/* Smooth scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-neon), var(--accent-neon));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--accent-neon), var(--secondary-neon));
}

/* Focus states for accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-neon);
    outline-offset: 2px;
}
