/* IzleFlix Pro Streaming UI - Netflix & Prime Inspired */
:root {
    --bg-main: #0c0d12;
    --bg-card: #141721;
    --bg-card-hover: #1c2130;
    --bg-header: rgba(12, 13, 18, 0.95);
    --primary: #e50914;
    --primary-hover: #ff0f1b;
    --accent: #00d2ff;
    --text-main: #f3f5f9;
    --text-muted: #8b95a5;
    --border: #222838;
    --star: #ffb703;
    --radius: 10px;
    --font: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    --transition: all 0.22s ease-in-out;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

/* NAVBAR */
.site-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-header);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 2rem;
}

.nav-container {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #fff;
}

.brand-logo i {
    color: var(--primary);
    font-size: 1.6rem;
    filter: drop-shadow(0 0 10px rgba(229, 9, 20, 0.5));
}

.brand-logo span.badge {
    background: var(--primary);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.nav-link:hover, .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
    background: rgba(229, 9, 20, 0.15);
    color: #fff;
    border: 1px solid rgba(229, 9, 20, 0.4);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-box {
    position: relative;
    width: 250px;
    display: flex;
    align-items: center;
}

.search-box input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.2rem;
    background: #141824;
    border: 1px solid var(--border);
    border-radius: 20px;
    color: #fff;
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--primary);
    background: #191e2e;
    width: 280px;
}

.search-box i {
    position: absolute;
    left: 0.85rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    pointer-events: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #b30710);
    color: #fff;
    padding: 0.5rem 1.2rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.35);
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(229, 9, 20, 0.5);
    color: #fff;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 0.5rem 1.1rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--border);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.2);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.8rem;
    background: #141824;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    position: relative;
}

.user-avatar-placeholder {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #7928ca);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 0.8rem;
}

/* HERO SLIDER / BANNER */
.hero-banner {
    position: relative;
    height: 480px;
    display: flex;
    align-items: center;
    overflow: hidden;
    margin-bottom: 2rem;
}

.hero-backdrop {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 25%;
    filter: brightness(0.4);
    transform: scale(1.02);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, var(--bg-main) 8%, rgba(12, 13, 18, 0.6) 50%, rgba(12, 13, 18, 0.9) 100%),
                linear-gradient(90deg, var(--bg-main) 15%, rgba(12, 13, 18, 0.3) 70%, transparent 100%);
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 680px;
    margin-left: max(2rem, 5%);
    padding: 2rem 0;
}

.hero-tags {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

.badge-tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.12);
}

.badge-tag.rating {
    background: var(--star);
    color: #000;
    display: flex;
    align-items: center;
    gap: 3px;
}

.badge-tag.type-movie {
    background: var(--primary);
    color: #fff;
}

.badge-tag.type-series {
    background: #0070f3;
    color: #fff;
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 0.8rem;
    text-shadow: 0 3px 15px rgba(0, 0, 0, 0.8);
}

.hero-desc {
    font-size: 0.95rem;
    color: #cbd5e1;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-btns {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

/* SECTION HEADERS */
.section-wrapper {
    max-width: 1440px;
    margin: 0 auto 3rem auto;
    padding: 0 2rem;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--primary);
    border-radius: 2px;
}

.section-more {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
}

.section-more:hover {
    color: #fff;
}

/* STREAMING MEDIA CARD & GRID (COMPACT, LOCKED PROPORTIONS) */
.media-grid {
    display: grid;
    /* Never stretch beyond 195px; fit as many as possible per row */
    grid-template-columns: repeat(auto-fill, minmax(160px, 185px));
    gap: 1.25rem;
    justify-content: flex-start;
}

.media-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 190px; /* STRICT MAX WIDTH SO CARDS NEVER BLOW UP */
}

.media-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.7);
}

.media-poster-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: #0f1118;
}

.media-poster-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.media-card:hover .media-poster-wrap img {
    transform: scale(1.06);
}

.media-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.media-card:hover .media-overlay {
    opacity: 1;
}

.play-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.7);
}

.card-top-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.rating-pill {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    color: var(--star);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 3px;
    border: 1px solid rgba(255, 183, 3, 0.3);
}

.type-pill {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
}

.type-pill.movie {
    background: rgba(229, 9, 20, 0.95);
    color: #fff;
}

.type-pill.series {
    background: rgba(0, 112, 243, 0.95);
    color: #fff;
}

.media-info {
    padding: 0.75rem 0.85rem;
    display: flex;
    flex-direction: column;
}

.media-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.3rem;
}

.media-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* FILTER TABS / BAR */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    background: #141721;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 1.75rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.filter-select {
    background: #0b0d13;
    color: #fff;
    border: 1px solid var(--border);
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    cursor: pointer;
}

.filter-select:focus {
    border-color: var(--primary);
}

/* WATCH PAGE */
.player-container {
    max-width: 1440px;
    margin: 1.5rem auto 3rem auto;
    padding: 0 2rem;
}

.video-player-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 700px;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.9);
    border: 1px solid var(--border);
}

.video-player-wrapper video,
.video-player-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.watch-info-panel {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    margin-top: 2rem;
}

.title-details h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.title-badges {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}

.title-synopsis {
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.watch-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.8rem;
}

/* SEASONS & EPISODES LIST */
.episodes-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 1.75rem;
}

.season-tabs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.85rem;
    margin-bottom: 1.25rem;
    overflow-x: auto;
}

.season-btn {
    padding: 0.4rem 1.1rem;
    border-radius: 20px;
    background: #1a1e2b;
    color: var(--text-muted);
    border: 1px solid var(--border);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.season-btn:hover, .season-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.episodes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.episode-card {
    background: #0f121a;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.65rem;
    display: flex;
    gap: 0.75rem;
    transition: var(--transition);
    cursor: pointer;
}

.episode-card:hover, .episode-card.active {
    background: #171c28;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.episode-thumb {
    width: 80px;
    height: 55px;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    background: #000;
}

.episode-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.episode-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.episode-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.episode-duration {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* FOOTER */
.site-footer {
    background: #090a0e;
    border-top: 1px solid var(--border);
    padding: 2.5rem 2rem 2rem 2rem;
    margin-top: auto;
}

.footer-inner {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-copy {
    font-size: 0.8rem;
    color: #555e70;
}

/* RESPONSIVE */
@media (max-width: 992px) {
    .watch-info-panel {
        grid-template-columns: 1fr;
    }
    .hero-title {
        font-size: 2.1rem;
    }
}

@media (max-width: 768px) {
    .site-navbar {
        padding: 0.65rem 1rem;
    }
    .nav-menu {
        display: none;
    }
    .hero-banner {
        height: 380px;
    }
    .hero-title {
        font-size: 1.7rem;
    }
    .media-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.85rem;
    }
    .media-card {
        max-width: 100%;
    }
}
