/* Golden Ratio / Phi Design System */
:root {
    --phi: 1.618033988;
    --gold: #FFD700;
    --gold-dim: #b39700;
    --black: #000000;
    --glass: rgba(10, 10, 10, 0.9);
    
    /* Spacing units based on Phi */
    --unit: 10px;
    --gap-sm: calc(var(--unit) * var(--phi)); /* ~16.18px */
    --gap-md: calc(var(--gap-sm) * var(--phi)); /* ~26.18px */
    --gap-lg: calc(var(--gap-md) * var(--phi)); /* ~42.36px */
    
    /* Border Radii based on Phi */
    --radius-base: 6px;
    --radius-phi: calc(var(--radius-base) * var(--phi)); /* ~9.7px */
    --radius-phi-lg: calc(var(--radius-phi) * var(--phi)); /* ~15.7px */
}

body {
    background-color: var(--black);
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    overflow: hidden; 
}

h1, h2, h3, .brand-font, .font-cinzel {
    font-family: 'Cinzel', serif;
}

/* Enforce Phi Border Radius */
.rounded-phi { border-radius: var(--radius-phi); }
.rounded-phi-lg { border-radius: var(--radius-phi-lg); }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0a0a0a; }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: var(--radius-phi); }

/* Golden Text Glow */
.text-gold-glow {
    color: var(--gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 215, 0, 0.15);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
}

/* Sidebar Specifics - Fix Overlap Z-Index */
.sidebar {
    z-index: 60; /* Higher than Header (40) and standard modals (50) to prevent overlap */
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(var(--gap-sm)); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-reveal {
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Loader */
.loader-ring {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}
.loader-ring div {
    box-sizing: border-box;
    display: block;
    position: absolute;
    width: 64px;
    height: 64px;
    margin: 8px;
    border: 2px solid var(--gold);
    border-radius: 50%;
    animation: loader-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    border-color: var(--gold) transparent transparent transparent;
}
.loader-ring div:nth-child(1) { animation-delay: -0.45s; }
.loader-ring div:nth-child(2) { animation-delay: -0.3s; }
.loader-ring div:nth-child(3) { animation-delay: -0.15s; }
@keyframes loader-ring {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Premium Button Animation (Golden Sheen) */
.btn-premium {
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.4s ease, border-color 0.4s ease, background-color 0.4s ease;
    border: 1px solid rgba(255, 215, 0, 0.2);
}
.btn-premium::after {
    content: '';
    position: absolute;
    top: 0; 
    left: -150%;
    width: 150%; 
    height: 100%;
    background: linear-gradient(
        90deg, 
        transparent, 
        rgba(255, 215, 0, 0.4), 
        transparent
    );
    transform: skewX(-20deg);
    transition: left 0.5s ease;
    pointer-events: none;
}
.btn-premium:hover::after {
    left: 150%;
    transition: left 0.7s ease;
}
.btn-premium:hover {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.25);
    border-color: var(--gold);
    background: rgba(255, 215, 0, 0.05);
}
.btn-premium:active {
    background: rgba(255, 215, 0, 0.1);
}

/* Channel Item */
.channel-item {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: var(--radius-phi);
    margin-bottom: 4px;
    border: 1px solid transparent;
    backface-visibility: hidden;
    transform: translateZ(0);
}
.channel-item:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.2);
    padding-left: 18px; /* Slight shift */
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Video Player Wrapper */
#video-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}
video {
    width: 100%;
    height: 100%;
    max-height: 90vh;
    border-radius: var(--radius-phi);
}

/* Search Modal Specifics */
#search-modal {
    z-index: 70; /* Very high to cover sidebar if needed */
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .sidebar { 
        width: 100% !important; 
        height: 80vh !important; /* Reduced height for better visibility on mobile browsers */
        bottom: 0; 
        top: auto; 
        border-top: 1px solid var(--gold); 
        border-left: none;
        border-radius: var(--radius-phi-lg) var(--radius-phi-lg) 0 0; 
        transform: translateY(100%);
        padding-top: 30px !important; /* Increased padding */
        z-index: 60;
    }
    
    /* Override the JS class for sidebar open on mobile */
    .sidebar:not(.translate-x-full) {
        transform: translateY(0) !important;
    }
    .sidebar.translate-x-full {
        transform: translateY(100%) !important;
    }
    
    #channel-list {
        padding-bottom: 100px; /* More space for scrolling */
    }
    
    .sidebar-header {
        padding-left: 20px !important;
        padding-right: 20px !important;
        margin-bottom: 10px !important;
    }

    .channel-item {
        padding: 16px !important; /* Larger touch targets */
        margin-bottom: 8px !important;
        background: rgba(255, 255, 255, 0.03);
    }
}