/* Custom Scrollbar */
        ::-webkit-scrollbar { width: 8px; }
        ::-webkit-scrollbar-track { background: #0f172a; }
        ::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; }
        ::-webkit-scrollbar-thumb:hover { background: #64748b; }

        /* Range Input Styling */
        input[type=range] {
            -webkit-appearance: none;
            background: transparent;
        }
        input[type=range]::-webkit-slider-thumb {
            -webkit-appearance: none;
            height: 16px;
            width: 16px;
            border-radius: 50%;
            background: #fbbf24;
            cursor: pointer;
            margin-top: -6px;
            box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
        }
        input[type=range]::-webkit-slider-runnable-track {
            width: 100%;
            height: 4px;
            cursor: pointer;
            background: #475569;
            border-radius: 2px;
        }
        
        /* Card Active Glow */
        .card-active {
            box-shadow: 0 0 15px rgba(251, 191, 36, 0.2);
            border-color: #fbbf24 !important;
        }

        .playlist-card-active {
            box-shadow: 0 0 15px rgba(14, 165, 233, 0.4);
            border-color: #0ea5e9 !important;
        }

        .playlist-card {
            position: relative;
            z-index: 1;
        }

        .playlist-card::after {
            content: "";
            position: absolute;
            inset: 0;
            background: linear-gradient(to right, transparent, rgba(14, 165, 233, 0.15));
            opacity: 0;
            transition: opacity 0.2s ease-in-out;
            z-index: -1;
        }

        .playlist-card:hover::after {
            opacity: 1;
        }

        .playlist-card:active::after {
            background: linear-gradient(to right, transparent, rgba(14, 165, 233, 0.3));
            opacity: 1;
            transition: opacity 0.05s ease-in-out;
        }

        .playlist-card-active::after {
            background: linear-gradient(to right, transparent, rgba(14, 165, 233, 0.25));
            opacity: 1;
        }

        /* Loader */
        .loader {
            border: 3px solid #f3f3f3;
            border-radius: 50%;
            border-top: 3px solid #fbbf24;
            width: 20px;
            height: 20px;
            -webkit-animation: spin 1s linear infinite; /* Safari */
            animation: spin 1s linear infinite;
        }
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* YT Overlay to capture clicks but allow interaction with specific buttons */
        .yt-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            cursor: pointer;
            z-index: 10;
        }
        .yt-controls {
            z-index: 20;
            position: relative;
        }
        
        /* Hide YT Elements roughly */
        .iframe-wrapper {
            pointer-events: none; /* Ensures clicks go to overlay */
            opacity: 0.6;
            transition: opacity 0.3s;
        }
        .card-active .iframe-wrapper {
            opacity: 1;
        }

        /* Search Input Animation */
        #searchInput {
            transition: width 0.3s ease-in-out, opacity 0.3s ease-in-out, padding 0.3s ease-in-out;
        }

        /* Onboarding Tour Styling */
        #tourBox {
            animation: tourBounce 0.5s ease-out;
        }

        @keyframes tourBounce {
            0% { transform: scale(0.9); opacity: 0; }
            50% { transform: scale(1.02); }
            100% { transform: scale(1); opacity: 1; }
        }

        #tourArrow {
            border-color: #334155; /* slate-700 */
        }

        /* Animated Rainbow Footer Border */
        @keyframes rainbow-move {
            0% { background-position: 0 0; }
            100% { background-position: 500px 0; }
        }

        footer {
            position: relative;
        }

        footer::before, footer::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            background: linear-gradient(to right,
                #ff0000, #ff7f00, #ffff00, #00ff00, #00ffff, #0000ff, #8b00ff, #ff0000);
            background-size: 500px 100%;
            animation: rainbow-move 5s linear infinite;
            opacity: 0;
            transition: opacity 1s ease-in-out;
            pointer-events: none;
        }

        footer::before {
            height: 1px;
            z-index: 50;
        }

        footer::after {
            height: 2px;
            filter: blur(4px);
            z-index: 49;
        }

        .footer-rainbow-active {
            border-top-color: transparent !important;
            transition: border-top-color 1s ease-in-out;
        }

        .footer-rainbow-active::before {
            opacity: 1;
        }

        .footer-rainbow-active::after {
            opacity: 0.7;
        }

        /* Header Icon Pulse (Pattern: x-x-|-xx- over 8 beats at 120 BPM = 4s) */
        @keyframes pulse-rhythmic {
            /* Beat 1: x */
            0% { transform: scale(1.2); }
            5% { transform: scale(1); }
            /* Beat 2: - */
            11.5% { transform: scale(1); }
            12.5% { transform: scale(1.05); }
            17.5% { transform: scale(1); }
            /* Beat 3: x */
            24% { transform: scale(1); }
            25% { transform: scale(1.2); }
            30% { transform: scale(1); }
            /* Beat 4: - */
            36.5% { transform: scale(1); }
            37.5% { transform: scale(1.05); }
            42.5% { transform: scale(1); }
            /* Beat 5: - */
            49% { transform: scale(1); }
            50% { transform: scale(1.05); }
            55% { transform: scale(1); }
            /* Beat 6: x */
            61.5% { transform: scale(1); }
            62.5% { transform: scale(1.2); }
            67.5% { transform: scale(1); }
            /* Beat 7: x */
            74% { transform: scale(1); }
            75% { transform: scale(1.2); }
            80% { transform: scale(1); }
            /* Beat 8: - */
            86.5% { transform: scale(1); }
            87.5% { transform: scale(1.05); }
            92.5% { transform: scale(1); }
            99% { transform: scale(1); }
            100% { transform: scale(1.2); }
        }

        .header-icon-pulse {
            animation: pulse-rhythmic 4s linear infinite;
            display: inline-block;
        }