:root {
    /* DEFAULT THEME VARIABLES (FilmMatics Purple) */
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    
    --bg-start: #1e1b4b;
    --bg-end: #020617;
    
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    
    --glass-tint: #1e1b4b;
    
    /* DEFAULT FONT: Montserrat */
    --font-main: 'Montserrat', sans-serif; 
    --grid-cols: 6; 
}

/* --- TAILWIND & VARIABLE OVERRIDES --- */
.bg-indigo-600 { background-color: var(--accent) !important; }
.hover\:bg-indigo-500:hover { background-color: var(--accent-hover) !important; } 

.text-indigo-400, .text-indigo-300 { color: var(--accent) !important; }
.text-gray-500, .text-gray-400 { color: var(--text-secondary) !important; }
.text-white, .text-gray-300 { color: var(--text-primary) !important; }

/* Dynamic Logo Gradient */
.logo-text {
    background: linear-gradient(135deg, var(--accent) 0%, var(--text-primary) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-size: 200% auto;
    transition: all 0.5s ease;
}

/* Dynamic Shadow/Glow Classes */
.shadow-accent { box-shadow: 0 10px 30px -10px var(--accent); }
.shadow-strong { box-shadow: 0 20px 60px -10px var(--accent); }
.shadow-indigo-600\/20, .shadow-indigo-600\/40 { box-shadow: 0 10px 25px -5px var(--accent) !important; }

/* SEARCH BAR FOCUS OVERRIDE */
.search-input:focus {
    /* Matches the 'Reconnect' button style (White/10) instead of accent color */
    border-color: rgba(255, 255, 255, 0.2) !important; 
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1) !important;
}

/* FAB TOOLTIP */
.fab-tooltip {
    position: absolute;
    right: 110%;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(4px);
    color: white;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 1px solid rgba(255,255,255,0.1);
}
.group:hover .fab-tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

body {
    background: radial-gradient(circle at 50% 0%, var(--bg-start) 0%, var(--bg-end) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow-x: hidden;
    transition: background 0.5s ease, color 0.5s ease;
}

/* --- DYNAMIC GRID --- */
.dynamic-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.5rem 2.5rem;
}
@media (min-width: 640px) { .dynamic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .dynamic-grid { grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr)); } }

/* --- UTILITIES --- */
.glass {
    background: linear-gradient(145deg, var(--glass-tint) 0%, rgba(0,0,0,0.4) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.poster-shadow { box-shadow: 0 20px 50px -15px rgba(0, 0, 0, 0.9); }
.hero-gradient { background: linear-gradient(to bottom, transparent, var(--bg-end) 98%); }

.animate-pop { animation: pop 0.4s cubic-bezier(0.26, 0.53, 0.74, 1.48); }
@keyframes pop { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-end); }
::-webkit-scrollbar-thumb { background: var(--bg-start); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* --- STAR RATING --- */
.star-rating-group {
    display: inline-flex; flex-direction: row-reverse; gap: 4px;
}
.star-rating-group input { display: none; }
.star-rating-group label {
    cursor: pointer; color: var(--text-secondary); transition: color 0.2s, transform 0.1s;
}
.star-rating-group label:hover,
.star-rating-group label:hover ~ label,
.star-rating-group input:checked ~ label { color: #fbbf24; }
.star-rating-group label:hover { transform: scale(1.2); }

/* --- VIDEO PLAYER FIXED --- */
.video-wrapper { 
    position: relative; width: 100%; height: 100%; background: #000; overflow: hidden; display: flex; align-items: center; justify-content: center; 
}
video::-webkit-media-controls { display:none !important; }

/* SHARED OVERLAY CLASS (Logic Handled in JS) */
.video-overlay {
    transition: opacity 0.4s ease, transform 0.4s ease;
    opacity: 1; 
    pointer-events: auto;
    /* FIX: Force max z-index so it sits on top of video in fullscreen */
    z-index: 2147483647; 
}

/* HIDE STATE */
.user-idle .video-overlay {
    opacity: 0;
    pointer-events: none;
}

/* HEADER POS */
.video-header {
    position: absolute; top: 0; left: 0; width: 100%; 
    background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, transparent 100%);
    padding: 2.5rem; display: flex; justify-content: space-between; align-items: flex-start;
}

/* CONTROLS POS */
.video-controls {
    position: absolute; bottom: 0; left: 0; width: 100%; 
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 60%, transparent 100%);
    padding: 2rem 1.5rem 1.5rem; display: flex; flex-direction: column; gap: 12px;
    transform: translateY(0);
}
.user-idle .video-controls { transform: translateY(20px); }

/* TIMELINE FIXED */
.video-progress { 
    width: 100%; 
    height: 8px; /* Thicker */
    background: rgba(255,255,255,0.2); 
    cursor: pointer; 
    border-radius: 4px; 
    position: relative; 
    transition: height 0.1s; 
    display: block; /* Ensure visibility */
    margin-bottom: 10px; /* Space from buttons */
}
.video-progress:hover { height: 12px; }

.video-progress-fill { 
    height: 100%; 
    background: var(--accent); 
    width: 0%; 
    border-radius: 4px; 
    position: relative; 
    pointer-events: none; 
}
.video-progress-fill::after {
    content: ''; position: absolute; right: -6px; top: 50%; margin-top: -8px; width: 16px; height: 16px; background: var(--text-primary);
    border-radius: 50%; transform: scale(0); transition: transform 0.1s; box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.video-wrapper:hover .video-progress-fill::after { transform: scale(1); }

.control-btn:hover { background: rgba(255,255,255,0.1); transform: scale(1.1); }
.control-btn:active { transform: scale(0.95); }

/* Fix for Dropdown Backgrounds */
select {
    background-color: var(--glass-tint) !important; /* Forces dark background */
    color: var(--text-primary) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

/* Optional: Fix the dropdown options on some browsers */
select option {
    background-color: var(--bg-start);
    color: var(--text-primary);
}

/* --- FORM ELEMENTS --- */
input[type=range].volume-slider {
    -webkit-appearance: none; width: 0; height: 4px; background: rgba(255,255,255,0.3);
    border-radius: 2px; outline: none; transition: width 0.3s ease; cursor: pointer; overflow: hidden;
}
.volume-group:hover input[type=range].volume-slider { width: 80px; }
input[type=range].volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 10px; height: 10px; background: var(--text-primary);
    border-radius: 50%; box-shadow: -100px 0 0 100px var(--accent);
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent; /* important */
}

/* Chrome, Edge, Safari */
input[type=range]::-webkit-slider-runnable-track {
    height: 8px;
    background: var(--accent);
    border-radius: 999px;
}

/* Firefox */
input[type=range]::-moz-range-track {
    height: 8px;
    background: var(--accent);
    border-radius: 999px;
}

/* Optional: rounded thumb */
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    margin-top: -4px; /* centers thumb */
}

input[type=range]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
}
