:root {
    --primary-purple: #8b5cf6;
    --accent-cyan: #22d3ee;
    --accent-pink: #ec4899;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Inter", sans-serif;
    background: radial-gradient(circle at 0 0, rgba(139, 92, 246, 0.18), transparent 55%),
        radial-gradient(circle at 100% 0, rgba(34, 211, 238, 0.18), transparent 55%),
        radial-gradient(circle at 0 100%, rgba(236, 72, 153, 0.15), transparent 55%),
        #020617;
    background-size: 200% 200%;
    animation: bgShift 22s ease-in-out infinite alternate;
    min-height: 100vh;
    color: #e5e7eb;
    overflow-x: hidden;
}

@keyframes bgShift {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 100% 100%;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}

::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.5);
}

.bokeh-layer {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.bokeh-dot {
    position: absolute;
    border-radius: 999px;
    filter: blur(70px);
    opacity: 0.4;
    mix-blend-mode: screen;
    animation: floatDot 18s ease-in-out infinite alternate;
}

.bokeh-dot:nth-child(2) {
    animation-duration: 22s;
    animation-delay: -4s;
}

.bokeh-dot:nth-child(3) {
    animation-duration: 26s;
    animation-delay: -8s;
}

@keyframes floatDot {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    100% {
        transform: translate3d(40px, -60px, 0) scale(1.1);
    }
}

/* Glassmorphism */
.glass-main {
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.2);
    backdrop-filter: blur(22px) saturate(160%);
}

.glass-panel {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.2);
    backdrop-filter: blur(12px);
}

.glass-player {
    background: rgba(15, 23, 42, 0.92);
    border-radius: 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
    backdrop-filter: blur(24px) saturate(170%);
    box-shadow: 0 -12px 40px rgba(2, 6, 23, 1), 0 0 30px rgba(139, 92, 246, 0.3);
}

/* Neon Text Animation */
@keyframes neonText {

    0%,
    100% {
        text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
    }

    50% {
        text-shadow: 0 0 20px rgba(34, 211, 238, 0.8);
    }
}

.neon-text-anim {
    animation: neonText 2s infinite alternate;
    color: #e0e7ff;
}

/* Album Art Spin */
.album-wrapper {
    position: relative;
    border-radius: 1.5rem;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.6);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 1), 0 0 35px rgba(139, 92, 246, 0.6);
}

.album-wrapper::before {
    content: "";
    position: absolute;
    inset: -40%;
    background: conic-gradient(from 180deg, rgba(139, 92, 246, 0.7), rgba(34, 211, 238, 0.6), rgba(15, 23, 42, 1), rgba(236, 72, 153, 0.6), rgba(139, 92, 246, 0.7));
    mix-blend-mode: screen;
    opacity: 0;
    filter: blur(28px);
    transition: opacity 0.5s ease;
    animation: holoSpin 24s linear infinite;
}

.album-wrapper.is-playing::before {
    opacity: 1;
}

@keyframes holoSpin {
    0% {
        transform: rotate(0);
    }

    100% {
        transform: rotate(360deg);
    }
}

.album-wrapper img {
    position: relative;
    z-index: 1;
    transition: transform 0.22s ease-out;
    transform-origin: center;
}

.album-wrapper.is-playing img {
    transform: scale(1.03);
}

/* Playlist Rows */
.track-row {
    background: rgba(30, 41, 59, 0.4);
    border-radius: 0.75rem;
    border: 1px solid transparent;
    transition: 0.25s ease;
}

.track-row:hover {
    background: rgba(45, 55, 80, 0.7);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateX(6px);
}

.track-row.is-playing {
    border-left: 4px solid var(--primary-purple);
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.3), rgba(15, 23, 42, 0.95));
}

/* Cards */
.music-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.music-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.7);
}

.music-card img {
    transition: transform 0.5s ease;
}

.music-card:hover img {
    transform: scale(1.05);
}

/* Utilities */
.player-btn {
    transition: 0.3s ease;
}

.player-btn:hover {
    transform: scale(1.1);
    color: #fff;
    text-shadow: 0 0 10px #8b5cf6;
}

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

.hidden {
    display: none !important;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Extras */
.neon-border {
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.8), 0 0 30px rgba(34, 211, 238, 0.6), inset 0 0 15px rgba(15, 23, 42, 0.9);
    border-color: rgba(139, 92, 246, 0.6) !important;
}

.neon-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.neon-hover:hover {
    box-shadow: 0 0 20px rgba(139, 92, 246, 1), 0 0 40px rgba(34, 211, 238, 1);
    transform: translateY(-3px) scale(1.02);
}

.float {
    animation: floatAnim 4s ease-in-out infinite;
}

@keyframes floatAnim {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-6px);
    }

    100% {
        transform: translateY(0px);
    }
}

.pulse-glow {
    animation: pulseGlow 3s infinite;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
    }

    50% {
        box-shadow: 0 0 20px rgba(34, 211, 238, 0.8);
    }

    100% {
        box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
    }
}

@keyframes slideFade {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-animated {
    animation: slideFade 0.8s ease-out;
}

/* Signature scan */
@keyframes scan {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.animate-scan {
    animation: scan 3.8s linear infinite;
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    body {
        font-size: 14px;
    }

    .player-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
    }

    .track-row {
        padding: 12px;
        min-height: 60px;
    }

    .music-card {
        min-height: 240px;
    }

    /* Larger touch targets for mobile */
    button {
        min-height: 44px;
    }

    /* Better spacing on mobile */
    .glass-main {
        padding: 1rem;
    }

    /* Optimize hero banner height */
    #hero-banner {
        height: 200px !important;
    }


    /* Enhanced Mobile Optimizations */
    @media (max-width: 640px) {
        body {
            font-size: 15px;
            /* Slightly larger base for readability */
        }

        /* Increase bottom padding for mini-player + footer overlap protection */
        #view-home {
            padding-bottom: 120px;
        }

        #view-player {
            padding-bottom: 110px;
        }

        /* Better touch targets */
        .player-btn {
            min-width: 48px;
            /* Standard inclusive touch target */
            min-height: 48px;
            padding: 12px;
        }

        .track-row {
            padding: 14px;
            /* Easier to tap rows */
            min-height: 64px;
            margin-bottom: 8px;
            /* Separation */
        }

        /* Card entry animation for mobile lists */
        .track-row,
        .music-card {
            animation: slideFade 0.5s ease-out backwards;
        }

        .track-row:nth-child(even) {
            animation-delay: 0.05s;
        }

        .track-row:nth-child(3n) {
            animation-delay: 0.1s;
        }

        /* Improve Hero Banner Aspect Ratio */
        #hero-banner {
            height: auto !important;
            aspect-ratio: 16 / 9;
            min-height: 220px;
        }

        #hero-title {
            font-size: 1.75rem;
            /* Better scaling */
        }

        /* Larger filter buttons */
        .filter-btn {
            padding: 0.6rem 1.2rem;
            font-size: 0.9rem;
            height: 48px;
            /* Hit target */
        }

        /* Make scrollbars invisible on mobile but scrollable */
        div {
            scrollbar-width: none;
            /* Firefox */
        }

        div::-webkit-scrollbar {
            display: none;
            /* Chrome/Safari */
        }
    }


    /* Tablet optimizations */
    @media (min-width: 641px) and (max-width: 1024px) {
        .track-row {
            padding: 10px;
        }
    }

    /* Touch-friendly seek slider */
    #seek-slider {
        height: 44px;
        cursor: pointer;
    }

    /* Accessibility improvements */
    button:focus,
    input:focus {
        outline: 2px solid rgba(139, 92, 246, 0.8);
        outline-offset: 2px;
    }

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

    .loading::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 20px;
        height: 20px;
        margin: -10px 0 0 -10px;
        border: 2px solid rgba(139, 92, 246, 0.3);
        border-top-color: rgba(139, 92, 246, 1);
        border-radius: 50%;
        animation: spin 0.6s linear infinite;
    }

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

    /* Footer styles */
    .site-footer {
        margin-top: 4rem;
        padding: 2rem 1rem;
        border-top: 1px solid rgba(148, 163, 184, 0.2);
    }

    @media (max-width: 640px) {
        .site-footer {
            padding: 1.5rem 1rem;
            margin-top: 2rem;
        }
    }

    /* Slide-in panel animation */
    .slide-panel {
        transform: translateX(100%);
        animation: slideInPanel 0.25s ease-out forwards;
    }

    @keyframes slideInPanel {
        from {
            transform: translateX(100%);
        }

        to {
            transform: translateX(0%);
        }
    }

    @keyframes float1 {
        0% {
            top: 20%;
            left: 10%;
            transform: scale(1);
        }

        50% {
            top: 15%;
            left: 14%;
            transform: scale(1.3);
        }

        100% {
            top: 20%;
            left: 10%;
            transform: scale(1);
        }
    }

    @keyframes float2 {
        0% {
            bottom: 22%;
            right: 18%;
            transform: scale(1);
        }

        50% {
            bottom: 20%;
            right: 15%;
            transform: scale(1.4);
        }

        100% {
            bottom: 22%;
            right: 18%;
            transform: scale(1);
        }
    }

    @keyframes float3 {
        0% {
            top: 60%;
            right: 10%;
            transform: scale(1);
        }

        50% {
            top: 63%;
            right: 6%;
            transform: scale(1.4);
        }

        100% {
            top: 60%;
            right: 10%;
            transform: scale(1);
        }
    }

    .animate-float1 {
        animation: float1 6s ease-in-out infinite;
    }

    .animate-float2 {
        animation: float2 7s ease-in-out infinite;
    }

    .animate-float3 {
        animation: float3 5.5s ease-in-out infinite;
    }

    /* Preloader State */
    .preloader-hidden {
        opacity: 0;
        pointer-events: none;
    }

    /* Enhanced Preloader Animations */

    @keyframes musicWave {

        0%,
        100% {
            height: 6px;
        }

        50% {
            height: 24px;
        }
    }

    .glitch-text {
        position: relative;
        color: white;
    }

    .glitch-text::before,
    .glitch-text::after {
        content: attr(data-text);
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

    .glitch-text::before {
        left: 2px;
        text-shadow: -1px 0 #ff00c1;
        clip-path: inset(44% 0 56% 0);
        animation: glitch-anim 5s infinite linear alternate-reverse;
    }

    .glitch-text::after {
        left: -2px;
        text-shadow: -1px 0 #00fff9;
        clip-path: inset(44% 0 56% 0);
        animation: glitch-anim2 5s infinite linear alternate-reverse;
    }

    @keyframes glitch-anim {
        0% {
            clip-path: inset(30% 0 10% 0);
        }

        5% {
            clip-path: inset(70% 0 90% 0);
        }

        10% {
            clip-path: inset(40% 0 60% 0);
        }

        15% {
            clip-path: inset(10% 0 30% 0);
        }

        20% {
            clip-path: inset(50% 0 20% 0);
        }

        25% {
            clip-path: inset(10% 0 80% 0);
        }

        30% {
            clip-path: inset(60% 0 50% 0);
        }

        35% {
            clip-path: inset(30% 0 10% 0);
        }

        40% {
            clip-path: inset(90% 0 20% 0);
        }

        45% {
            clip-path: inset(50% 0 80% 0);
        }

        50% {
            clip-path: inset(10% 0 30% 0);
        }

        55% {
            clip-path: inset(70% 0 20% 0);
        }

        60% {
            clip-path: inset(40% 0 90% 0);
        }

        65% {
            clip-path: inset(10% 0 50% 0);
        }

        70% {
            clip-path: inset(60% 0 30% 0);
        }

        75% {
            clip-path: inset(20% 0 70% 0);
        }

        80% {
            clip-path: inset(80% 0 20% 0);
        }

        85% {
            clip-path: inset(10% 0 60% 0);
        }

        90% {
            clip-path: inset(40% 0 10% 0);
        }

        95% {
            clip-path: inset(60% 0 30% 0);
        }

        100% {
            clip-path: inset(20% 0 80% 0);
        }
    }

    @keyframes glitch-anim2 {
        0% {
            clip-path: inset(10% 0 80% 0);
        }

        5% {
            clip-path: inset(30% 0 10% 0);
        }

        10% {
            clip-path: inset(50% 0 90% 0);
        }

        15% {
            clip-path: inset(80% 0 20% 0);
        }

        20% {
            clip-path: inset(20% 0 60% 0);
        }

        25% {
            clip-path: inset(60% 0 30% 0);
        }

        30% {
            clip-path: inset(20% 0 50% 0);
        }

        35% {
            clip-path: inset(90% 0 10% 0);
        }

        40% {
            clip-path: inset(40% 0 60% 0);
        }

        45% {
            clip-path: inset(10% 0 30% 0);
        }

        50% {
            clip-path: inset(70% 0 20% 0);
        }

        55% {
            clip-path: inset(30% 0 90% 0);
        }

        60% {
            clip-path: inset(10% 0 50% 0);
        }

        65% {
            clip-path: inset(50% 0 10% 0);
        }

        70% {
            clip-path: inset(20% 0 70% 0);
        }

        75% {
            clip-path: inset(60% 0 30% 0);
        }

        80% {
            clip-path: inset(30% 0 50% 0);
        }

        85% {
            clip-path: inset(10% 0 80% 0);
        }

        90% {
            clip-path: inset(40% 0 20% 0);
        }

        95% {
            clip-path: inset(80% 0 60% 0);
        }

        100% {
            clip-path: inset(10% 0 30% 0);
        }
    }
}