:root {
    --primary-bg: #141414;
    --secondary-bg: #181818;
    --text-white: #e5e5e5;
    --text-gray: #b3b3b3;
    --freemo-green: #2ecc71;
    --transition-speed: 0.3s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-white);
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 75px;
    padding: 0 4%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9) 10%, rgba(0, 0, 0, 0));
    transition: background-color var(--transition-speed);
}

.navbar.scrolled {
    background-color: var(--primary-bg);
}

.logo {
    color: var(--freemo-green);
    font-size: 30px;
    font-weight: 900;
    margin-right: 40px;
    cursor: pointer;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 20px;
    flex-grow: 1;
}

.nav-links a {
    color: var(--text-white);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-gray);
    font-weight: 500;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none !important;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    margin-left: 10px;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 998;
}

.mobile-menu-overlay.active {
    display: block;
}

/* Mobile Menu Slide-in */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background: #181818;
    z-index: 999;
    transition: right 0.3s ease;
    padding-top: 80px;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 25px;
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    border-bottom: 1px solid #333;
    transition: background 0.2s;
}

.mobile-menu a:hover,
.mobile-menu a:active {
    background: #252525;
}

.mobile-menu a i {
    width: 24px;
    color: var(--freemo-green);
}

@media screen and (max-width: 768px) {
    .mobile-menu-btn {
        display: block !important;
    }
}

/* Obvious Search Bar */
.search-container {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid #333;
    padding: 5px 15px;
    border-radius: 4px;
}

.search-input {
    background: transparent;
    border: none;
    color: white;
    font-size: 14px;
    width: 250px;
    margin-left: 10px;
    outline: none;
}

.search-icon {
    color: var(--text-white);
}

/* Hero Section */
.hero {
    position: relative;
    height: 80vh;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 4%;
    transition: height 0.5s ease;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20rem;
    background: linear-gradient(180deg, transparent, rgba(20, 20, 20, 0.5), #141414);
    pointer-events: none;
}

.hero-content {
    max-width: 650px;
    z-index: 10;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
}

.hero-overview {
    font-size: 1.2rem;
    line-height: 1.5;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    border: none;
    border-radius: 4px;
    padding: 0.8rem 2.4rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: white;
    color: black;
}

.btn-primary:hover {
    background-color: rgba(255, 255, 255, 0.75);
}

.btn-secondary {
    background-color: rgba(109, 109, 110, 0.7);
    color: white;
}

.btn-secondary:hover {
    background-color: rgba(109, 109, 110, 0.4);
}

/* Video Player Container */
/* Video Player Container */
.video-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    aspect-ratio: 16/9;
    background: black;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    overflow: hidden;
    display: block;
    margin-bottom: 50px;
}

.video-player {
    width: 100%;
    height: 100%;
    border: none;
}

/* Main Container */
.main-container {
    padding-left: 4%;
    margin-top: -80px;
    z-index: 20;
    position: relative;
    padding-bottom: 50px;
}

/* Rows */
.row {
    margin-bottom: 3rem;
    position: relative;
}

.row-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #e5e5e5;
    transition: ease-in-out;
}

.row-title:hover {
    color: var(--freemo-green);
}

.row-posters {
    display: flex;
    overflow-y: hidden;
    overflow-x: scroll;
    padding: 20px 0 20px 0px;
    gap: 14px;
    scroll-behavior: smooth;
}

.row-posters::-webkit-scrollbar {
    display: none;
}

.row-posters {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.poster {
    max-height: 250px;
    object-fit: cover;
    margin-right: 10px;
    transition: transform 450ms;
    border-radius: 4px;
    cursor: pointer;
}

.poster:hover {
    transform: scale(1.1);
    opacity: 1;
    z-index: 100;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Movie Details Page Styles */
.details-container {
    padding-top: 100px;
    padding-left: 4%;
    padding-right: 4%;
    min-height: 100vh;
    background: var(--primary-bg);
}

.details-hero {
    display: flex;
    gap: 40px;
    padding-bottom: 50px;
    align-items: flex-start;
}

.details-poster {
    width: 300px;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.details-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.details-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 10px;
}

/* Slider Headers */
.row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-right: 4%;
}

.row-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #e5e5e5;
    transition: color 0.2s;
    cursor: pointer;
    display: inline-block;
    margin-bottom: 0;
}

.row-title:hover {
    color: var(--freemo-green);
}

.explore-all {
    font-size: 0.9rem;
    color: #54b9c5;
    cursor: pointer;
    opacity: 0;
    /* Hidden by default, show on hover of row? or always? */
    transition: opacity 0.2s;
    display: none;
    /* Let's keep it simple, title click is enough */
}

/* Slider Container */
.row-slider-container {
    position: relative;
    padding: 0;
}

/* Scroll Arrows */
.slider-arrow {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50px;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s;
    border: none;
    font-size: 2rem;
}

.row:hover .slider-arrow {
    opacity: 1;
}

.slider-arrow:hover {
    background: rgba(0, 0, 0, 0.8);
    color: var(--freemo-green);
}

.slider-arrow.left {
    left: 0;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.slider-arrow.right {
    right: 0;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

/* Player Controls Bar */
.player-controls-bar {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 10px auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #181818;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid #333;
}

.control-group {
    display: flex;
    gap: 15px;
    align-items: center;
}

.control-btn {
    background: #333;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.control-btn:hover {
    background: #444;
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.details-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: var(--text-gray);
}

.details-score {
    color: var(--freemo-green);
    font-weight: bold;
    font-size: 1.3rem;
}

.details-overview {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
    max-width: 800px;
}

/* Season/Episode Selector */
.episode-selector {
    margin-top: 20px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
}

.episode-select {
    background: #333;
    color: white;
    padding: 10px 20px;
    border: 1px solid #555;
    border-radius: 4px;
    font-size: 1rem;
    outline: none;
    cursor: pointer;
}

.cast-row {
    margin-top: 40px;
}

.cast-list {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 20px;
}

.cast-card {
    min-width: 120px;
    text-align: center;
}

.cast-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
}

.cast-name {
    font-size: 0.9rem;
    color: var(--text-white);
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

/* Tablet and smaller */
@media screen and (max-width: 1024px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .details-title {
        font-size: 2.5rem;
    }

    .details-poster {
        width: 200px;
    }

    .poster {
        max-height: 200px;
    }
}

/* Mobile devices (Phones & Tablets) */
@media screen and (max-width: 768px) {

    /* Navbar mobile */
    .navbar {
        height: 65px;
        padding: 0 10px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }

    .logo {
        font-size: 1.1rem;
        margin-right: 0;
        flex-shrink: 0;
    }

    .nav-links {
        display: none;
    }

    .right-controls {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        overflow: hidden;
    }

    .search-container {
        flex: 1;
        max-width: 180px;
        padding: 6px 12px;
        border-radius: 20px;
        background: rgba(255, 255, 255, 0.1);
        height: 34px;
    }

    .search-input {
        width: 100%;
        font-size: 13px;
        background: transparent;
    }

    .mobile-menu-btn {
        display: block !important;
        font-size: 1.4rem;
        padding: 5px;
        margin-left: 0;
        color: var(--freemo-green);
    }

    /* MOVIE DETAILS PAGE - Responsive Fixes */
    .details-container {
        padding-top: 80px !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    .details-hero {
        flex-direction: column !important;
        align-items: center !important;
        gap: 20px !important;
        text-align: center !important;
        padding-bottom: 30px !important;
    }

    .details-poster {
        width: 160px !important;
        max-width: 100% !important;
        margin: 0 auto !important;
    }

    .details-info {
        width: 100% !important;
        text-align: center !important;
    }

    .details-title {
        font-size: 1.8rem !important;
        margin-bottom: 15px !important;
    }

    .details-meta {
        font-size: 0.9rem !important;
        justify-content: center !important;
        margin-bottom: 15px !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
    }

    .details-overview {
        font-size: 0.95rem !important;
        line-height: 1.5 !important;
        text-align: left !important;
        margin-bottom: 25px !important;
        max-width: 100% !important;
    }

    /* PLAYER - Responsive Fixes */
    .player-controls-bar {
        flex-direction: column !important;
        gap: 15px !important;
        padding: 15px !important;
        width: 100% !important;
        margin-bottom: 15px !important;
    }

    .video-container {
        width: 100% !important;
        margin: 0 0 30px 0 !important;
        aspect-ratio: 16 / 9 !important;
        height: auto !important;
        border-radius: 4px !important;
        position: relative !important;
        overflow: hidden !important;
    }

    .video-player {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        border: none !important;
    }

    /* Hero mobile */
    .hero {
        height: 50vh;
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Main container mobile */
    .main-container {
        padding-left: 15px;
        margin-top: -40px;
    }

    /* Rows mobile - Fix overlapping */
    .row {
        margin-bottom: 2rem;
    }

    .poster {
        max-height: 180px;
        min-height: 180px;
        width: auto;
        aspect-ratio: 2/3;
        border-radius: 8px;
    }

    /* Grid mobile - Fix Superposition/Overlapping */
    .recommendations-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
        padding: 10px 15px !important;
    }

    .grid-card {
        width: 100% !important;
        margin-bottom: 0 !important;
    }

    .grid-card .poster {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        aspect-ratio: 2/3;
        object-fit: cover;
    }
}

/* Small mobile devices */
@media screen and (max-width: 480px) {
    .navbar {
        height: 60px;
        padding: 0 10px;
    }

    .logo {
        font-size: 0.9rem;
    }

    .search-container {
        padding: 6px 10px;
        max-width: 150px;
    }

    .details-title {
        font-size: 1.5rem !important;
    }

    .details-poster {
        width: 140px !important;
    }

    .poster {
        max-height: 160px !important;
        min-height: 160px !important;
    }

    .recommendations-grid {
        gap: 10px !important;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .poster:hover {
        transform: none;
    }

    .poster:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    .slider-arrow {
        opacity: 1;
    }

    .btn:active {
        transform: scale(0.97);
    }

    .cast-card:active {
        opacity: 0.8;
    }
}

/* Smooth scrolling for all */
html {
    scroll-behavior: smooth;
}

/* Prevent horizontal scroll */
body {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Better touch scrolling */
.row-posters,
.cast-list {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}

.poster,
.cast-card {
    scroll-snap-align: start;
}