/* Base styles */
:root {
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.4);
    --secondary: #1e293b;
    --silver: #cbd5e1;
    /* Silver/Platinum color */
    --silver-glow: rgba(203, 213, 225, 0.2);
    --bg-dark: #0a0a0a;
    --glass: rgba(255, 255, 255, 0.02);
    --glass-border: rgba(203, 213, 225, 0.15);
    /* Silver-tinted border */
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.6);
}

body {
    font-family: 'Outfit', sans-serif;
    user-select: none;
    overflow: hidden;
    background-color: var(--bg-dark);
}

.glass-card {
    background: var(--glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.5);
}

/* Audio Slider Styling */
.audio-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    outline: none;
}

.audio-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px var(--primary-glow);
    transition: 0.2s ease-in-out;
}

.audio-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--primary);
}

/* Result Card */
.result-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 0.75rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.result-card:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
    border-color: var(--silver);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
}

.thumbnail-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    position: relative;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}

.result-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Queue Item */
.queue-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.01);
    border-radius: 0.5rem;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.queue-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(203, 213, 225, 0.1);
}

.queue-item.active {
    background: rgba(203, 213, 225, 0.05);
    /* Platinum tint */
    border: 1px solid var(--silver-glow);
    border-left: 3px solid var(--silver);
    box-shadow: 0 0 15px var(--silver-glow);
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#remote-modal .glass-card {
    border: 1px solid var(--silver-glow);
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.1);
}

#qrcode-container canvas,
#qrcode-container img {
    margin: 0 auto;
}

#open-remote:hover {
    border-color: var(--silver);
    color: white;
}

/* Sidebar Responsiveness & Shrinking */
@media screen and (max-width: 1024px) {
    .glass-card {
        padding: 0.75rem !important;
        /* Global shrink for small width */
    }

    #queue-list {
        min-height: 100px;
    }
}

@media screen and (max-height: 600px) {
    aside {
        gap: 0.5rem !important;
    }

    .glass-card {
        padding: 0.5rem !important;
        border-radius: 0.75rem !important;
    }

    aside .glass-card:first-child {
        padding: 0.5rem !important;
    }

    aside .glass-card:first-child img {
        width: 2rem !important;
        height: 2rem !important;
    }

    h1 {
        font-size: 1rem !important;
    }

    aside p.text-\[12px\] {
        font-size: 8px !important;
    }

    #queue-list {
        max-height: 150px;
    }

    .audio-slider {
        height: 2px !important;
    }

    /* Shrink buttons in sidebar */
    aside button {
        padding-top: 0.25rem !important;
        padding-bottom: 0.25rem !important;
        font-size: 9px !important;
    }
}

/* TV Remote Focus States */
:focus {
    outline: 3px solid var(--primary) !important;
    outline-offset: 4px;
    box-shadow: 0 0 20px var(--primary-glow) !important;
    background: rgba(59, 130, 246, 0.2) !important;
    transform: scale(1.02);
}

/* Specific Focus for Cards */
.glass-card:focus-within,
.glass-card:focus {
    border-color: var(--primary) !important;
}

/* Force Landscape Styling */
@media screen and (orientation: portrait) {
    body.force-landscape-hint::after {
        content: "SILAKAN PUTAR HP KE POSISI LANDSCAPE (MENDATAR)";
        position: fixed;
        inset: 0;
        background: #000;
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 9999;
        font-family: 'Outfit', sans-serif;
        font-weight: 800;
        font-size: 1.2rem;
        text-transform: uppercase;
        text-align: center;
        padding: 2rem;
        letter-spacing: 0.1em;
        line-height: 1.5;
    }
}