/* ═══════════════════════════════════════════════════════════
   🌸 ANIME KARAOKE PLAYER - ULTRA GODLY EDITION 🌸
   Themes: Sakura Dream | Cyberpunk | Cosmic | Neon City
   ═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════
   ROOT VARIABLES - SAKURA DREAM THEME (DEFAULT)
   ═══════════════════════════════════════════════════════════ */
:root {
    /* Colors */
    --primary-color: #ff6b9d;
    --secondary-color: #c44569;
    --accent-color: #ffa8c5;
    --bg-gradient-1: #ff9a9e;
    --bg-gradient-2: #fecfef;
    --bg-gradient-3: #fbc2eb;
    --text-primary: #ff6b9d;
    --text-secondary: #ffa8c5;
    --glow-color: #ff6b9d;
    --glow-alt: #ffa8c5;
    --panel-bg: rgba(255, 255, 255, 0.08);
    --panel-border: rgba(255, 255, 255, 0.15);
    
    /* Fonts */
    --font-display: 'Bebas Neue', 'Passion One', 'Impact', sans-serif;
    --font-body: 'Poppins', sans-serif;
    --font-tech: 'Orbitron', monospace;
    
    /* Dimensions */
    --blur-amount: 20px;
    --border-radius: 16px;
    --spacing-unit: 1rem;
    
    /* Particles */
    --particle-color: rgba(255, 182, 193, 0.6);
    --star-color: rgba(255, 255, 255, 0.8);
}

/* ═══════════════════════════════════════════════════════════
   THEME VARIATIONS
   ═══════════════════════════════════════════════════════════ */

/* Cyberpunk Theme */
body[data-theme="cyber"] {
    --primary-color: #00f0ff;
    --secondary-color: #ff00ff;
    --accent-color: #00ffaa;
    --bg-gradient-1: #0f0f23;
    --bg-gradient-2: #1a1a3e;
    --bg-gradient-3: #16213e;
    --text-primary: #00f0ff;
    --text-secondary: #00ffaa;
    --glow-color: #00f0ff;
    --glow-alt: #ff00ff;
    --panel-bg: rgba(0, 240, 255, 0.05);
    --panel-border: rgba(0, 240, 255, 0.2);
    --particle-color: rgba(0, 240, 255, 0.4);
}

/* Cosmic Theme */
body[data-theme="cosmic"] {
    --primary-color: #a90fd4;
    --secondary-color: #c084fc;
    --accent-color: #e879f9;
    --bg-gradient-1: #2b1055;
    --bg-gradient-2: #7597de;
    --bg-gradient-3: #4f4f9f;
    --text-primary: #a90fd4;
    --text-secondary: #c331ec;
    --glow-color: #c51bf4;
    --glow-alt: #e879f9;
    --panel-bg: rgba(240, 113, 247, 0.08);
    --panel-border: rgba(241, 94, 185, 0.2);
    --particle-color: rgba(232, 121, 249, 0.6);
}

/* Neon City Theme */
body[data-theme="neon"] {
    --primary-color: #f7971e;
    --secondary-color: #ffd200;
    --accent-color: #ff6ec7;
    --bg-gradient-1: #0a0a0a;
    --bg-gradient-2: #1a1a2e;
    --bg-gradient-3: #16162a;
    --text-primary: #ffd200;
    --text-secondary: #f7971e;
    --glow-color: #f7971e;
    --glow-alt: #ff6ec7;
    --panel-bg: rgba(247, 151, 30, 0.05);
    --panel-border: rgba(247, 151, 30, 0.2);
    --particle-color: rgba(255, 210, 0, 0.4);
}

/* ═══════════════════════════════════════════════════════════
   GLOBAL RESET & BASE STYLES
   ═══════════════════════════════════════════════════════════ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* Fallback gradient if no background image */
    background: linear-gradient(135deg, 
        #1a1a2e 0%, 
        #16213e 50%, 
        #0f0f23 100%);
}

body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-body);
    background: transparent;
    color: var(--text-primary);
    user-select: none;
    -webkit-user-select: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════════════════════════════
   BACKGROUND SYSTEM
   ═══════════════════════════════════════════════════════════ */
#bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -10;
    overflow: hidden;
}

#bg-image, .bg-image {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: brightness(1.0);
    transform: scale(1.0);
    z-index: 0;
}

#bg-video, .bg-video {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: brightness(0.9);
    transform: scale(1.0);
    z-index: 0;
}

/* Show active theme background */
.theme-bg.active {
    display: block !important;
}

/* Theme-specific visibility */
body[data-theme="sakura"] .theme-sakura {
    display: block !important;
}

body[data-theme="cyber"] .theme-cyber {
    display: block !important;
}

body[data-theme="cosmic"] .theme-cosmic {
    display: block !important;
}

body[data-theme="neon"] .theme-neon {
    display: block !important;
}

#bg-gradient {
    display: none;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        var(--bg-gradient-1) 0%, 
        var(--bg-gradient-2) 50%, 
        var(--bg-gradient-3) 100%);
    animation: gradientShift 15s ease infinite;
}

/* Only show gradient if no other backgrounds exist */
body.no-backgrounds #bg-gradient {
    display: block;
}

.bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, 
        rgba(0, 0, 0, 0.05) 0%, 
        rgba(0, 0, 0, 0.2) 100%);
    pointer-events: none;
    z-index: 1;
}

@keyframes slowZoom {
    0% { transform: scale(1.1); }
    100% { transform: scale(1.15); }
}

@keyframes gradientShift {
    0% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(30deg); }
    100% { filter: hue-rotate(0deg); }
}

/* ═══════════════════════════════════════════════════════════
   PARTICLE SYSTEMS
   ═══════════════════════════════════════════════════════════ */
#particles-sakura {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    display: block;
}

#particles-stars,
#particles-lights {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    display: none;
}

.sakura-petal {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--particle-color);
    border-radius: 50% 0 50% 0;
    animation: fallSakura linear infinite;
    opacity: 0.7;
    filter: blur(0.5px);
}

.star-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--star-color);
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite;
    box-shadow: 0 0 4px var(--star-color);
}

.light-orb {
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, var(--glow-color) 0%, transparent 70%);
    border-radius: 50%;
    animation: floatOrb 15s ease-in-out infinite;
    opacity: 0.3;
    filter: blur(10px);
}

@keyframes fallSakura {
    0% {
        transform: translateY(-10vh) rotate(0deg) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(110vh) rotate(360deg) translateX(50px);
        opacity: 0;
    }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.5); }
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.2); }
    50% { transform: translate(0, -60px) scale(0.8); }
    75% { transform: translate(-30px, -30px) scale(1.1); }
}

/* ═══════════════════════════════════════════════════════════
   MAIN APP CONTAINER
   ═══════════════════════════════════════════════════════════ */
.app-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

/* ═══════════════════════════════════════════════════════════
   TOP INFO BAR
   ═══════════════════════════════════════════════════════════ */
.info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--panel-bg);
    backdrop-filter: blur(var(--blur-amount));
    border-bottom: 1px solid var(--panel-border);
    transition: transform 0.3s ease, opacity 0.3s ease;
    animation: slideDown 0.6s ease;
}

.info-bar.hidden {
    transform: translateY(-100%);
    opacity: 0;
}

.song-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.album-art-mini {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--panel-bg);
    border: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5),
                0 0 40px var(--glow-color);
    animation: pulse 2s ease-in-out infinite;
}

.album-art-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-art-mini i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.song-metadata {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.song-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-display);
    text-shadow: 0 0 10px var(--glow-color);
}

.song-artist {
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* Theme Switcher */
.theme-switcher {
    display: flex;
    gap: 0.5rem;
}

.theme-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: var(--panel-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.theme-btn:hover {
    transform: translateY(-3px) scale(1.1);
    border-color: var(--primary-color);
    box-shadow: 0 5px 20px var(--glow-color);
}

.theme-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 30px var(--glow-color);
}

/* ═══════════════════════════════════════════════════════════
   LYRICS STAGE
   ═══════════════════════════════════════════════════════════ */
.lyric-stage {
    flex: 1;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 2rem 12rem 2rem;
    overflow: hidden;
}

/* Album Art Display */
.album-art-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    border-radius: 20px;
    overflow: hidden;
    opacity: 0;
    filter: blur(3px);
    transition: all 0.5s ease;
    z-index: 0;
    display: none;
}

.album-art-display img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: rotateAlbum 30s linear infinite;
}

.no-album-art {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.no-album-art i {
    font-size: 8rem;
    color: rgba(255, 255, 255, 0.3);
}

@keyframes rotateAlbum {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fa-spin-slow {
    animation: rotateAlbum 10s linear infinite;
}

/* Lyrics Container */
.lyric-container {
    position: relative;
    z-index: 5;
    max-width: 90%;
    width: 1200px;
    text-align: center;
    margin-bottom: 0;
}

.lyric-display {
    font-family: 'Bebas Neue', 'Impact', sans-serif;
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 700;
    line-height: 0.95;
    color: var(--text-primary);
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-shadow: 
        0 0 40px var(--glow-color),
        0 4px 20px rgba(0, 0, 0, 0.9),
        0 2px 4px rgba(0, 0, 0, 1);
    letter-spacing: 0.05em;
    position: relative;
    min-height: 80px;
    max-height: 20vh;
    text-transform: uppercase;
}

.lyric-display.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Next Lyric Preview */
.lyric-next {
    margin-top: 2rem;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: var(--text-secondary);
    opacity: 0;
    font-weight: 300;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    display: none;
}

/* Audio Visualizer */
.visualizer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    opacity: 0;
    pointer-events: none;
    z-index: 4;
    filter: blur(1px);
    display: none;
}

/* ═══════════════════════════════════════════════════════════
   CONTROL PANEL
   ═══════════════════════════════════════════════════════════ */
.control-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(var(--blur-amount));
    border-top: 1px solid var(--panel-border);
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.4s ease, opacity 0.4s ease;
    animation: slideUp 0.6s ease;
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.3);
}

.control-panel.hidden {
    transform: translateY(100%);
    opacity: 0;
}

/* Time Display */
.time-display {
    text-align: center;
    font-family: var(--font-tech);
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--glow-color);
}

.time-separator {
    margin: 0 0.5rem;
    opacity: 0.5;
}

/* Seek Bar */
.seek-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    overflow: visible;
    transition: height 0.2s ease;
}

.seek-container:hover {
    height: 12px;
}

.seek-bar {
    height: 100%;
    background: linear-gradient(90deg, 
        var(--primary-color) 0%, 
        var(--glow-alt) 100%);
    border-radius: 4px;
    width: 0%;
    transition: width 0.1s linear;
    box-shadow: 0 0 15px var(--glow-color);
    position: relative;
}

.seek-handle {
    position: absolute;
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: white;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--glow-color);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.seek-container:hover .seek-handle {
    opacity: 1;
}

/* Controls Row */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.btn-control {
    background: var(--panel-bg);
    border: 2px solid var(--panel-border);
    color: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
}

.btn-control:hover {
    transform: translateY(-3px) scale(1.1);
    border-color: var(--primary-color);
    box-shadow: 0 5px 30px var(--glow-color);
    background: var(--primary-color);
    color: #ffffff;
}

.btn-control:active {
    transform: translateY(-1px) scale(1.05);
}

.btn-primary {
    width: 70px;
    height: 70px;
    font-size: 1.8rem;
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 30px var(--glow-color);
    color: #ffffff;
}

.btn-primary:hover {
    transform: scale(1.15);
    box-shadow: 0 0 50px var(--glow-color);
}

.btn-secondary {
    width: 50px;
    height: 50px;
}

.btn-small {
    width: 40px;
    height: 40px;
    font-size: 1rem;
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: absolute;
    right: 2rem;
    bottom: 50%;
    transform: translateY(50%);
}

.volume-slider {
    width: 100px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    transition: all 0.2s ease;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--glow-color);
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--glow-color);
    border: none;
}

/* Options */
.options {
    display: flex;
    gap: 0.5rem;
    position: absolute;
    left: 2rem;
    bottom: 50%;
    transform: translateY(50%);
}

.btn-control.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 20px var(--glow-color);
    color: #ffffff;
}

/* ═══════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════ */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.5), 0 0 40px var(--glow-color);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), 0 0 60px var(--glow-color);
    }
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(2px, -2px); }
    60% { transform: translate(-1px, 1px); }
    80% { transform: translate(1px, -1px); }
    100% { transform: translate(0); }
}

.glitch {
    animation: glitch 0.3s ease;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .info-bar {
        padding: 0.75rem 1rem;
    }
    
    .song-title {
        font-size: 0.9rem;
    }
    
    .song-artist {
        font-size: 0.75rem;
    }
    
    .theme-switcher {
        gap: 0.25rem;
    }
    
    .theme-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .lyric-display {
        font-size: clamp(1.5rem, 6vw, 3rem);
    }
    
    .album-art-display {
        width: 250px;
        height: 250px;
    }
    
    .control-panel {
        padding: 1rem;
    }
    
    .btn-primary {
        width: 60px;
        height: 60px;
    }
    
    .volume-control,
    .options {
        position: static;
        transform: none;
        justify-content: center;
    }
    
    .controls {
        flex-wrap: wrap;
    }
}

/* ═══════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════ */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-out {
    animation: fadeOut 0.5s ease;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Cursor */
body {
    cursor: default;
}

button {
    cursor: pointer;
}

/* Scrollbar (if needed) */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--glow-alt);
}