:root {
    --primary: #00d2ff;
    --secondary: #3a7bd5;
    --bg: #0b0e14;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text: #e0e6ed;
    --text-dim: #94a3b8;
    --max-width: 1200px;
}

/* ========================================= */
/* PREMIUM LIGHT MODE THEME OVERRIDES        */
/* ========================================= */
:root.light-mode {
    --primary: var(--light-primary);
    --bg: #f3f4f6; /* Very soft, cool gray so white elements pop */
    --card-bg: #ffffff; /* Pure white for elements resting on the background */
    --glass: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(0, 0, 0, 0.06); /* Extremely subtle border */
    --text: #111827; /* Near black for maximum crispness and readability */
    --text-dim: #4b5563; /* Slate gray for secondary text */
}

/* 1. Kill the Dark Gradient */
:root.light-mode body {
    background: var(--bg);
}

/* 2. Crisp White Navigation */
:root.light-mode .custom-nav { 
    background: rgba(255, 255, 255, 0.9); 
    border-bottom: 1px solid rgba(0, 0, 0, 0.05); 
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

/* 3. Movie Posters & Cards (Depth & Elevation) */
:root.light-mode .m-poster, 
:root.light-mode .cw-card,
:root.light-mode .story-circle { 
    background: var(--card-bg); 
    border: 1px solid rgba(0, 0, 0, 0.04); 
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06); /* Soft, diffused shadow */
}
:root.light-mode .m-poster:hover,
:root.light-mode .cw-card:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12); /* Lift up on hover */
    border-color: rgba(0, 0, 0, 0.08);
}

/* 4. Large Containers, Modals, & Profile Cards */
:root.light-mode .setting-card, 
:root.light-mode .custom-modal-box,
:root.light-mode .profile-card { 
    background: var(--card-bg); 
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05); 
}

/* 5. Inputs & Dropdowns (Clean & Accessible) */
:root.light-mode .dropdown-menu,
:root.light-mode .glass-dropdown-menu { 
    background: rgba(255, 255, 255, 0.98); 
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}
:root.light-mode .admin-input, 
:root.light-mode .glass-input,
:root.light-mode .modal-input,
:root.light-mode .google-search-input { 
    background: #f9fafb; 
    color: var(--text); 
    border: 1px solid rgba(0, 0, 0, 0.1); 
}
:root.light-mode .admin-input:focus, 
:root.light-mode .glass-input:focus,
:root.light-mode .modal-input:focus,
:root.light-mode .google-search-input:focus { 
    background: #ffffff; 
    border-color: var(--primary); 
}


/* ========================================= */
/* GOOGLE SEARCH TOGGLE BUTTON               */
/* ========================================= */
.google-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    border-radius: 12px;
    
    /* --- THE FIX IS HERE --- */
    width: 40px;         /* Slimmed down from 52px */
    height: 40px;        /* Forces it to be perfectly square */
    align-self: center;  /* Stops it from stretching vertically */
    
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    flex-shrink: 0;
}
/* --- Google SVG Color Burst Animation --- */
.google-svg-icon {
    filter: grayscale(100%) opacity(0.5); /* Muted and grey by default */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.google-toggle-btn:hover .google-svg-icon,
.google-toggle-btn.active .google-svg-icon {
    filter: grayscale(0%) opacity(1); /* Full color pop on hover or click! */
    transform: scale(1.15); /* Slight pop out effect */
}


.google-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.google-toggle-btn.active {
    background: rgba(66, 133, 244, 0.1);
    border-color: #4285F4;
    color: #4285F4;
    box-shadow: 0 0 15px rgba(66, 133, 244, 0.3);
}

/* Light Mode Adaptation */
:root.light-mode .google-toggle-btn {
    background: var(--card-bg);
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}
:root.light-mode .google-toggle-btn:hover {
    background: #f9fafb;
    border-color: rgba(0,0,0,0.15);
}
/* 6. Fix the Glowing Lines (Neon looks cheap in light mode) */
:root.light-mode .section-header::after {
    background: linear-gradient(90deg, transparent 0%, var(--primary) 50%, transparent 100%);
    opacity: 0.4; 
    box-shadow: none; /* Kill the neon shadow */
    animation: none; /* Stop the pulsing */
}

/* 7. Specific Component Fixes */
:root.light-mode .stat-box, 
:root.light-mode .profile-bio-text { 
    background: #f9fafb; 
    border: 1px solid rgba(0, 0, 0, 0.05); 
}
:root.light-mode .app-menu-item:hover { 
    background: #f3f4f6; 
}
:root.light-mode .glass-dropdown-item { 
    color: var(--text); 
    border-bottom: 1px solid rgba(0, 0, 0, 0.05); 
}
:root.light-mode .glass-dropdown-item:hover { 
    background: #f3f4f6; 
    color: var(--primary); 
}
* { box-sizing: border-box; }

body { 
    font-family: 'Inter', sans-serif; 
    background: radial-gradient(circle at top right, #1e293b, #0b0e14); 
    color: var(--text); 
    margin: 0; 
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}




/* ========================================= */
/* PREMIUM MORPHING HAMBURGER BUTTON         */
/* ========================================= */
.mobile-toggle-modern {
    display: none; /* Hidden on desktop */
    width: 32px;
    height: 24px;
    position: relative;
    cursor: pointer;
    z-index: 10000; /* Must be above the overlay */
}

.mobile-toggle-modern .line {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: var(--primary);
    border-radius: 4px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.4);
}

.mobile-toggle-modern .line1 { top: 0px; }
.mobile-toggle-modern .line2 { top: 10px; width: 80%; right: 0; left: auto; } /* Asymmetrical middle line looks cool */
.mobile-toggle-modern .line3 { top: 20px; }

/* Morph into glowing X when active */
.mobile-toggle-modern.is-active .line1 { top: 10px; transform: rotate(135deg); width: 100%; box-shadow: 0 0 15px #ff4d4d; background: #ff4d4d; }
.mobile-toggle-modern.is-active .line2 { opacity: 0; right: -20px; }
.mobile-toggle-modern.is-active .line3 { top: 10px; transform: rotate(-135deg); box-shadow: 0 0 15px #ff4d4d; background: #ff4d4d; }



/* --- UPDATED LEAVING SOON BADGE (PILL SHAPE) --- */
.leaving-soon-badge {
    position: absolute;
    top: 10px;
    /* left: 10px; (handled inline for the different grids) */
    background: rgba(243, 156, 18, 0.95); /* Warning Yellow/Orange */
    color: #fff;
    height: 32px;
    width: auto;             /* Changed from 32px so it can stretch */
    padding: 0 6px 0 14px;   /* Adds room to breathe on the sides */
    border-radius: 16px;     /* Makes it a sleek pill shape */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;                /* Adds a clean gap between the icon and the red tag */
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
    z-index: 20;
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(4px);
}

.days-left-sub {
    position: static;        /* This removes the overlap! */
    background: #e74c3c;     /* Alert Red */
    color: #fff;
    font-size: 0.75rem;
    font-weight: 900;
    padding: 4px 8px;
    border-radius: 10px;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
/* ========================================= */
/* LIVE SEARCH RESULTS - PREMIUM THUMBNAILS  */
/* ========================================= */
.search-poster-thumb {
    width: 45px;
    height: 65px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.result-item:hover .search-icon-thumb {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.5);
    border-color: var(--primary);
}


/* ========================================= */
/* PREMIUM FOLLOW BUTTON                     */
/* ========================================= */
.follow-btn {
    background: rgba(255,255,255,0.05); 
    color: #fff;
    border: 1px solid var(--glass-border); 
    padding: 10px 20px;
    border-radius: 12px; 
    font-weight: bold; 
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex; 
    align-items: center; 
    gap: 8px;
}

.follow-btn i { 
    color: #fff; 
    transition: 0.3s; 
}

.follow-btn:hover { 
    border-color: #ff4d4d; 
    box-shadow: 0 4px 15px rgba(255, 77, 77, 0.3); 
    transform: translateY(-2px); 
}
.follow-btn:hover i { 
    color: #ff4d4d; 
}

.follow-btn.active { 
    background: rgba(255, 77, 77, 0.1); 
    border-color: #ff4d4d; 
    color: #fff; 
}
.follow-btn.active i { 
    color: #ff4d4d; 
    transform: scale(1.1); 
}


/* Professional Notification Badge */
.notif-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #ff4d4d;
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border: 2px solid var(--bg); 
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    line-height: 1;
}

/* ========================================= */
/* PREMIUM GLASSMORPHISM TOOLTIPS            */
/* ========================================= */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -40px; 
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(15, 20, 28, 0.95);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: #fff;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 8px;
    border: 1px solid var(--primary);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55); 
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3);
    z-index: 9999;
    pointer-events: none; 
}

[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    border-width: 0 6px 6px 6px;
    border-style: solid;
    border-color: transparent transparent var(--primary) transparent;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 9999;
    pointer-events: none;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.fa-beat-subtle {
    animation: fa-beat-subtle 1.5s infinite;
}

@keyframes fa-beat-subtle {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* --- Navigation --- */
.custom-nav {
    background: rgba(11, 14, 20, 0.85);
    backdrop-filter: blur(15px);
    position: sticky; 
    top: 0; 
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
}

.nav-container {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    height: 80px;
}

.logo {
    font-weight: 900; 
    color: var(--primary); 
    text-decoration: none; 
    font-size: 1.8rem; 
    letter-spacing: -1px;
    display: inline-flex;
    align-items: baseline;
    transition: all 0.5s ease;
    animation: logo-distinguished-pulse 8s infinite ease-in-out;
}

.logo:hover {
    text-shadow: 0 0 15px rgba(0, 210, 255, 0.4);
}

.logo .flix { color: #fff; }

.logo .dot-com {
    font-size: 0.35em; 
    color: var(--secondary);
    margin-left: 2px;
    letter-spacing: 0;
    font-weight: 800;
    opacity: 0.9;
    text-transform: lowercase;
}

@keyframes logo-distinguished-pulse {
    0%, 100% {
        text-shadow: 0 0 10px rgba(0, 210, 255, 0.2);
        letter-spacing: -1px;
        transform: scale(1);
    }
    50% {
        text-shadow: 
            -2px 0 15px rgba(0, 210, 255, 0.6), 
             2px 0 20px rgba(58, 123, 213, 0.4);
        letter-spacing: 0px; 
        transform: scale(1.02); 
    }
}

.logo span { color: #fff; }

.nav-links {
    display: flex;
    gap: 25px;
    align-items: center;
}

/* ========================================= */
/* PREMIUM DESKTOP NAVIGATION UPGRADES       */
/* ========================================= */

.nav-item {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
    transition: 0.3s;
    display: flex;
    align-items: center;
    position: relative; /* Needed for the animated underline */
    padding: 5px 0;
}

.nav-item:hover { 
    color: var(--primary); 
}



/* 2. Smooth Slide-in Dropdown Menu */
.nav-item-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 130%; /* Start slightly pushed down */
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    background: rgba(11, 14, 20, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 16px; /* Smoother outer corners */
    padding: 10px;
    z-index: 1000;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    
    /* The Magic: Hide with opacity and visibility instead of display:none */
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Reveal on hover */
.nav-item-dropdown:hover .dropdown-menu {
    top: 100%;
    opacity: 1;
    visibility: visible;
}

/* Refined Dropdown Links */
.dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: 0.3s;
    border-radius: 10px; /* Inner pill shape */
}

.dropdown-link i {
    font-size: 1rem;
    color: var(--text-dim);
    transition: 0.3s;
}

.dropdown-link:hover {
    background: rgba(0, 210, 255, 0.1);
    color: var(--primary);
    transform: translateX(5px); /* Gentle nudge to the right */
}

.dropdown-link:hover i {
    color: var(--primary);
    filter: drop-shadow(0 0 5px rgba(0, 210, 255, 0.5));
}

/* Invisible bridge so the mouse doesn't lose hover when moving to the menu */
.nav-item-dropdown::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 25px;
    bottom: -25px;
    left: 0;
}

.nav-divider {
    width: 1px;
    height: 20px;
    background: var(--glass-border);
    margin: 0 10px;
}

.mobile-toggle {
    display: none; 
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
}

.register-btn {
    background: var(--primary);
    color: #000 !important;
    padding: 10px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 800;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3);
}

.logout-btn {
    background: rgba(255, 77, 77, 0.1);
    color: #ff4d4d;
    border: 1px solid rgba(255, 77, 77, 0.3);
    padding: 8px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
}

.tm-hero {
    height: 40vh;
    background: linear-gradient(to bottom, rgba(11,14,20,0.2), var(--bg)), url('../img/hero.jpg') center/cover;
    display: flex; 
    align-items: center; 
    justify-content: center;
    margin-bottom: 40px;
}

.grid-container { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); 
    gap: 25px; 
}

.m-card { text-decoration: none; color: inherit; transition: 0.4s; }
.m-poster { 
    aspect-ratio: 2/3; border-radius: 20px; overflow: hidden;
    border: 1px solid var(--glass-border); background: var(--glass);
}
.m-poster img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.m-card:hover .m-poster img { transform: scale(1.1); }
.m-info { margin-top: 12px; font-weight: 600; font-size: 0.95rem; text-align: center; }

/* --- ANIMATED GLOWING SECTION DIVIDERS --- */
.section-header {
    font-size: 1.2rem; color: var(--primary); text-transform: uppercase;
    letter-spacing: 2px; margin: 80px 0 30px; display: flex; align-items: center; gap: 15px;
}

/* --- Header.php --- ANIMATED GLOWING SECTION DIVIDERS (DYNAMIC) --- */
.section-header::after { 
    content: ""; 
    flex: 1; 
    height: 1.5px; 
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 210, 255, var(--glow-core)) 50%, 
        transparent 100%
    );
    border-radius: 2px;
    transform-origin: center; 
    animation: centerPulse 3s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

@keyframes centerPulse {
    0% { 
        transform: scaleX(0.02); 
        opacity: 0.1; 
        box-shadow: 0 0 2px rgba(0, 210, 255, 0.1);
    }
    100% { 
        transform: scaleX(1); 
        opacity: var(--glow-opacity); 
        box-shadow: 0 0 10px rgba(0, 210, 255, var(--glow-shadow)); 
    }
}
/* --- END ----- ANIMATED GLOWING SECTION DIVIDERS (DYNAMIC) --- */

.watched-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); 
    gap: 15px;
}

.sub-nav {
    background: rgba(0, 210, 255, 0.05);
    border-bottom: 1px solid var(--glass-border);
    padding: 8px 0;
}
.sub-nav-container { display: flex; align-items: center; gap: 20px; }
.sub-nav-label { font-size: 0.7rem; font-weight: 800; color: var(--text-dim); letter-spacing: 1px; }
.sub-nav-link { text-decoration: none; color: var(--text); font-size: 0.8rem; font-weight: 500; transition: 0.3s; display: flex; align-items: center; gap: 6px; }
.sub-nav-link i { font-size: 0.75rem; color: var(--primary); }
.sub-nav-link:hover { color: var(--primary); }


/* ========================================= */
/* THE ULTIMATE MOBILE APP GRID              */
/* ========================================= */

@media (max-width: 768px) {
    .mobile-toggle { display: none !important; } 
    .mobile-toggle-modern { display: block; }

    /* --- THE LIQUID CIRCLE REVEAL OVERLAY (GPU ACCELERATED) --- */
    .nav-links {
        position: fixed;
        inset: 0; 
        width: 100vw;
        height: 100vh;
        background: radial-gradient(circle at top right, rgba(11, 14, 20, 0.95), rgba(0, 0, 0, 0.98));
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: max-content; 
        align-content: start; 
        padding: 110px 20px 100px 20px;
        gap: 10px;
        
        /* 1. Fix the Flicker: Bury everything under a massive Z-index */
        z-index: 9999;
        
        clip-path: circle(0px at calc(100% - 35px) 40px);
        /* 2. Smoother Easing: Adjusted the curve for a more natural "liquid" feel */
        transition: clip-path 0.6s cubic-bezier(0.85, 0, 0.15, 1);
        pointer-events: none; 

        /* 3. Force Hardware Acceleration (The Magic Sauce) */
        -webkit-transform: translateZ(0);
        transform: translate3d(0, 0, 0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        perspective: 1000px;
        will-change: clip-path; /* Tells the browser to prep the graphics card */
    }

    .nav-links.active {
        /* Keep this exactly at 150vh so it covers the longest phones */
        clip-path: circle(150vh at calc(100% - 35px) 40px);
        pointer-events: all;
    }

    /* --- STAGGERED HOLOGRAPHIC GRID ITEMS --- */
    .nav-links > * {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
        transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        margin: 0 !important; /* FIX: Clears stray margins */
    }

    .nav-links.active > * {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    /* Stagger Delays */
    .nav-links.active > *:nth-child(1) { transition-delay: 0.15s; }
    .nav-links.active > *:nth-child(2) { transition-delay: 0.20s; }
    .nav-links.active > *:nth-child(3) { transition-delay: 0.25s; }
    .nav-links.active > *:nth-child(4) { transition-delay: 0.30s; }
    .nav-links.active > *:nth-child(5) { transition-delay: 0.35s; }
    .nav-links.active > *:nth-child(6) { transition-delay: 0.40s; }
    .nav-links.active > *:nth-child(7) { transition-delay: 0.45s; }
    .nav-links.active > *:nth-child(8) { transition-delay: 0.50s; }
    .nav-links.active > *:nth-child(9) { transition-delay: 0.55s; }
    .nav-links.active > *:nth-child(10) { transition-delay: 0.60s; }

    .nav-item {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--glass-border);
        /* CHANGED: Reduced padding from 22px to 12px top/bottom */
        padding: 12px 10px !important; 
        border-radius: 16px; /* Slightly smaller radius to match smaller box */
        flex-direction: column !important; 
        justify-content: center;
        align-items: center;
        text-align: center;
        box-shadow: 0 10px 25px rgba(0,0,0,0.2);
        /* CHANGED: Slightly smaller text */
        font-size: 0.5rem !important; 
        position: relative;
        overflow: hidden;
        height: auto !important; 
    }

    .nav-item:active::after {
        content: '';
        position: absolute;
        top: 0; left: -100%;
        width: 50%; height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
        transform: skewX(-20deg);
        animation: glassSwipe 0.5s forwards;
    }
    @keyframes glassSwipe { 100% { left: 150%; } }

    .nav-item i {
        /* CHANGED: Reduced icon size from 1.8rem to 1.3rem */
        font-size: 1.3rem;
        color: var(--primary);
        /* CHANGED: Reduced space between icon and text */
        margin: 0 0 5px 0 !important; 
        filter: drop-shadow(0 0 8px rgba(0, 210, 255, 0.4));
    }

    /* FIX: Force tooltip text to become standard inline text on mobile */
    .nav-item[data-tooltip]::after {
        content: attr(data-tooltip) !important;
        position: static !important; 
        opacity: 1 !important; visibility: visible !important;
        background: transparent !important; border: none !important; box-shadow: none !important;
        transform: none !important; padding: 0 !important; color: #fff !important;
        font-size: 0.65rem !important; font-weight: 700 !important; margin-top: 5px !important;
        white-space: normal !important; pointer-events: auto !important;
    }
    .nav-item[data-tooltip]::before { display: none !important; } 
    .nav-item:has(.user-display)::after { display: none !important; }

    /* Span 2 columns for wider items */
    .nav-item-dropdown, .logout-btn, .register-btn, .nav-item:has(.user-display), a[href="/admin/index.php"] {
        grid-column: span 3; 
        width: 100%;
    }
    
    .user-display {
        display: flex; flex-direction: column; align-items: center;
        gap: 8px; font-size: 1.1rem; color: #fff; font-weight: 800;
    }

    /* Custom Dropdown styling */
    .nav-item-dropdown .nav-item { flex-direction: row !important; justify-content: space-between; padding: 20px 25px !important; }
    .nav-item-dropdown .hide-on-mobile { display: inline !important; flex: 1; text-align: left; margin-left: 15px !important; }
    
    /* Target the wide buttons and make their text larger */
    .nav-item-dropdown .hide-on-mobile,
    a[href="/admin/index.php"],
    a[href="/slideshow.php"] {
        font-size: 0.70rem !important; 
        font-weight: 800 !important;
        letter-spacing: 0.5px;
    }
    .dropdown-menu { 
            position: static !important; 
            display: none !important; 
            background: transparent !important; 
            border: none !important; 
            box-shadow: none !important; 
            padding: 0 !important; 
            margin-top: 15px !important; 
            transform: none !important; /* <-- THIS FIXES THE SHIFT */
            width: 100% !important; 
        }

    .nav-item-dropdown.open .dropdown-menu { display: grid !important; grid-template-columns: 1fr 1fr; gap: 15px; }

    .dropdown-link {
        background: rgba(0, 210, 255, 0.05);
        border: 1px solid rgba(0, 210, 255, 0.15);
        border-radius: 16px; padding: 18px 10px;
        font-size: 0.85rem; font-weight: 700; display: flex; flex-direction: column;
        align-items: center; text-align: center; gap: 10px; color: #fff;
    }
    .dropdown-link i { font-size: 1.4rem; color: var(--primary); filter: drop-shadow(0 0 5px rgba(0, 210, 255, 0.3)); }
    .nav-item-dropdown .fa-chevron-down { transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
    .nav-item-dropdown.open .fa-chevron-down { transform: rotate(180deg); color: var(--primary); }
    
    .nav-divider { display: none !important; }
    .notif-badge { top: 10px; right: 15px; font-size: 0.85rem; min-width: 22px; height: 22px; box-shadow: 0 0 10px rgba(255, 77, 77, 0.6); }

    .logout-btn {
        padding: 20px; text-align: center; border-radius: 20px;
        font-size: 1rem; margin-top: 10px; background: rgba(255, 77, 77, 0.08); border-color: rgba(255, 77, 77, 0.3);
        color: #ff4d4d;
    }

    /* --- YOUR EXISTING MOBILE GRID RULES --- */
    html body .container .grid-container {
        grid-template-columns: repeat(var(--mobile-columns), 1fr) !important; 
        gap: 10px !important;
    }
    
    html body .container .watched-grid {
        grid-template-columns: repeat(var(--mobile-columns), 1fr) !important; 
        gap: 10px !important;
    }
    
    html body .container .watched-grid .m-info {
        font-size: 0.65rem; 
    }
}



/* ========================================= */
/* PREMIUM GLASS SCROLLBAR                   */
/* ========================================= */
::-webkit-scrollbar { 
    width: 14px; 
}
::-webkit-scrollbar-track { 
    background: var(--bg); 
}
::-webkit-scrollbar-thumb { 
    background: rgba(0, 210, 255, 0.2); 
    border-radius: 10px; 
    border: 4px solid var(--bg); 
}
::-webkit-scrollbar-thumb:hover { 
    background: var(--primary); 
}
/* ========================================= */
/* PREMIUM CUSTOM MODAL (GLOBAL)             */
/* ========================================= */
.custom-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.custom-modal-box {
    background: rgba(15, 20, 28, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0,0,0,0.8);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-modal-overlay.active .custom-modal-box {
    transform: scale(1);
}

.custom-modal-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.custom-modal-icon.danger {
    color: #ff4d4d;
    filter: drop-shadow(0 0 15px rgba(255, 77, 77, 0.4));
}

.custom-modal-title {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 900;
    margin: 0 0 10px 0;
    letter-spacing: -0.5px;
}

.custom-modal-text {
    color: var(--text-dim);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 30px;
}

.custom-modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.btn-modal-cancel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 12px 25px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    flex: 1;
}

.btn-modal-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Red Danger Button for Deletions */
.btn-modal-danger {
    background: rgba(255, 77, 77, 0.1);
    border: 1px solid rgba(255, 77, 77, 0.5);
    color: #ff4d4d;
    padding: 12px 25px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    flex: 1;
}

.btn-modal-danger:hover {
    background: #ff4d4d;
    color: #000;
    box-shadow: 0 0 15px rgba(255, 77, 77, 0.4);
}
/* ========================================= */
/* ========================================= */
/* ========================================= */


/* ========================================= */
/* PREMIUM DANGER BUTTON (RED GLOW)          */
/* ========================================= */
.btn-modern-danger {
    background: rgba(255, 77, 77, 0.1);
    border: 1px solid rgba(255, 77, 77, 0.5);
    color: #ff4d4d;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-modern-danger:hover {
    background: rgba(255, 77, 77, 0.15); /* Keeps it transparent glass */
    color: #ff4d4d; /* Keeps the text red instead of turning black */
    border-color: #ff4d4d; /* Lights up the border */
    box-shadow: 0 0 20px rgba(255, 77, 77, 0.6), inset 0 0 10px rgba(255, 77, 77, 0.2); /* Outer and Inner Neon Glow */
    text-shadow: 0 0 8px rgba(255, 77, 77, 0.5); /* Makes the text itself glow */
    transform: translateY(-2px);
}
/* FIX: Stop hovering carousel items from getting their tops cut off */
.cw-carousel {
    padding-top: 15px !important;
    margin-top: -15px !important; /* This pulls it back up so it doesn't mess up your spacing! */
}

/* Let's fix it for the Coming Soon/Leaving Soon shelves too, just in case! */
.scroll-shelf {
    padding-top: 15px !important;
    margin-top: -15px !important; 
}

/* ========================================= */
/* PREMIUM MOBILE APP DOWNLOAD PILL          */
/* ========================================= */

/* 1. Hide it completely on desktop screens */
.mobile-app-dl-btn {
    display: none; 
}

/* 2. Style and show it ONLY on mobile screens */
@media (max-width: 768px) {
    .mobile-app-dl-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        
        /* This pushes it to the right, sitting right next to the hamburger */
        margin-left: auto; 
        margin-right: 20px; 
        
        /* Glassmorphism styling to match your theme */
        background: rgba(0, 210, 255, 0.1);
        border: 1px solid rgba(0, 210, 255, 0.4);
        color: var(--primary);
        padding: 6px 14px;
        border-radius: 20px;
        font-size: 0.65rem;
        font-weight: 800;
        text-decoration: none;
        /* text-transform: uppercase; */
        letter-spacing: 0.5px;
        box-shadow: 0 0 10px rgba(0, 210, 255, 0.2);
        transition: all 0.3s ease;
    }

    .mobile-app-dl-btn i {
        font-size: 0.9rem;
        animation: subtleBounce 2s infinite;
    }

    .mobile-app-dl-btn:active {
        transform: scale(0.95);
        background: rgba(0, 210, 255, 0.2);
    }
}

/* A tiny bounce animation to catch the user's eye */
@keyframes subtleBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}