/* ============================
   TV PAKISTAN — Classic Netflix UI
   ============================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #e50914;
    --primary-dark: #b20710;
    --bg: #141414;
    --bg-light: #181818;
    --bg-card: #222;
    --text: #fff;
    --text-muted: #b3b3b3;
    --border: #333;
}

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Roboto', Arial, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* ============== NAVBAR ============== */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 18px 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.85) 10%, transparent);
    transition: background 0.3s ease;
}
.navbar.scrolled { background: #141414; box-shadow: 0 2px 10px rgba(0,0,0,0.5); }

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4%;
    display: flex;
    align-items: center;
    gap: 30px;
}

.logo {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 28px;
    color: var(--primary);
    letter-spacing: 2px;
    font-weight: 900;
    flex-shrink: 0;
}
.logo span { color: #fff; margin-left: 4px; }

.nav-menu { display: flex; gap: 22px; flex: 1; }
.nav-link {
    font-size: 14px;
    color: #e5e5e5;
    transition: color 0.3s;
    font-weight: 400;
}
.nav-link:hover { color: #b3b3b3; }

.nav-right { display: flex; align-items: center; gap: 14px; }

.search-box { position: relative; }
.search-box input {
    background: rgba(0,0,0,0.75);
    border: 1px solid #fff;
    color: #fff;
    padding: 8px 36px 8px 14px;
    border-radius: 4px;
    font-size: 13px;
    width: 200px;
    transition: width 0.3s;
}
.search-box input:focus { outline: none; width: 240px; }
.search-box button {
    position: absolute;
    right: 8px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: #fff;
}

.btn-login, .btn-signup {
    padding: 7px 18px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-login { color: #fff; }
.btn-login:hover { color: #b3b3b3; }
.btn-signup {
    background: var(--primary);
    color: #fff;
}
.btn-signup:hover { background: var(--primary-dark); }

.user-menu { position: relative; }
.user-btn {
    background: none; border: none; color: #fff;
    font-size: 14px; padding: 6px 10px;
    display: flex; align-items: center; gap: 6px;
}
.user-dropdown {
    position: absolute; right: 0; top: 100%;
    background: rgba(0,0,0,0.95);
    border: 1px solid #333;
    border-radius: 4px;
    min-width: 180px;
    padding: 8px 0;
    margin-top: 8px;
    opacity: 0; visibility: hidden;
    transition: all 0.2s;
}
.user-menu:hover .user-dropdown { opacity: 1; visibility: visible; }
.user-dropdown a {
    display: block;
    padding: 10px 16px;
    font-size: 13px;
    color: #fff;
    transition: background 0.2s;
}
.user-dropdown a:hover { background: #333; }
.user-dropdown a i { margin-right: 8px; width: 16px; }

.menu-toggle { display: none; background: none; border: none; color: #fff; font-size: 22px; }

/* ============== HERO BANNER ============== */
.hero {
    position: relative;
    height: 85vh;
    min-height: 500px;
    margin-bottom: 30px;
    overflow: hidden;
}
.hero-bg {
    position: absolute; inset: 0;
    background-size: cover;
    background-position: center;
    background-color: #000;
}
.hero-bg::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(77deg, rgba(0,0,0,0.95) 30%, rgba(0,0,0,0.4) 70%),
                linear-gradient(180deg, transparent 60%, #141414 100%);
}
.hero-content {
    position: absolute;
    bottom: 25%;
    left: 4%;
    max-width: 600px;
    z-index: 2;
}
.hero-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(38px, 6vw, 72px);
    line-height: 1;
    margin-bottom: 18px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.8);
    letter-spacing: 1px;
}
.hero-meta {
    display: flex; gap: 14px;
    margin-bottom: 14px;
    font-size: 14px;
    color: #ccc;
    flex-wrap: wrap;
}
.hero-meta .badge {
    background: var(--primary);
    padding: 2px 10px;
    border-radius: 3px;
    font-weight: 700;
    color: #fff;
}
.hero-desc {
    font-size: 16px;
    color: #e5e5e5;
    margin-bottom: 22px;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.7);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 26px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 700;
    border: none;
    transition: all 0.2s;
    cursor: pointer;
}
.btn-play { background: #fff; color: #000; }
.btn-play:hover { background: rgba(255,255,255,0.75); }
.btn-info { background: rgba(109,109,110,0.7); color: #fff; }
.btn-info:hover { background: rgba(109,109,110,0.4); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; color: #fff; border: 2px solid #fff; }

/* ============== ROW / SLIDER ============== */
.section { padding: 0 4%; margin-bottom: 40px; }
.section-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
}
.section-title {
    font-size: 22px;
    font-weight: 700;
}
.section-link { font-size: 13px; color: var(--text-muted); }
.section-link:hover { color: #fff; }

.row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: #555 transparent;
}
.row::-webkit-scrollbar { height: 6px; }
.row::-webkit-scrollbar-thumb { background: #555; border-radius: 3px; }

/* ============== CARD ============== */
.card {
    flex: 0 0 240px;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s ease;
    cursor: pointer;
    background: var(--bg-card);
}
.card:hover { transform: scale(1.05); z-index: 5; }
.card-poster {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: #000;
}
.card-info {
    padding: 12px;
}
.card-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
}
.card-meta .rating { color: #46d369; font-weight: 700; }
.card-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.85), transparent 50%);
    opacity: 0; transition: opacity 0.3s;
    display: flex;
    align-items: flex-end;
    padding: 14px;
}
.card:hover .card-overlay { opacity: 1; }
.card-play-btn {
    background: rgba(255,255,255,0.9);
    color: #000;
    border: none;
    width: 38px; height: 38px;
    border-radius: 50%;
    font-size: 14px;
    transition: background 0.2s;
}
.card-play-btn:hover { background: #fff; }

/* ============== GRID ============== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.grid .card { flex: none; }

/* ============== SHOW DETAIL PAGE ============== */
.show-banner {
    position: relative;
    height: 60vh;
    min-height: 400px;
    background-size: cover;
    background-position: center top;
}
.show-banner::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 50%, #141414);
}
.show-detail {
    padding: 0 4% 50px;
    margin-top: -150px;
    position: relative;
    z-index: 2;
}
.show-detail h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(36px, 5vw, 60px);
    margin-bottom: 12px;
    letter-spacing: 1px;
}
.show-detail-meta {
    display: flex; gap: 16px;
    margin-bottom: 18px;
    color: #ccc;
    font-size: 14px;
    flex-wrap: wrap;
}
.show-detail-meta .badge {
    background: var(--primary);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    color: #fff;
}
.show-detail p.desc {
    max-width: 800px;
    color: #e5e5e5;
    margin-bottom: 20px;
    font-size: 16px;
}
.show-actions { display: flex; gap: 12px; margin-bottom: 30px; flex-wrap: wrap; }
.show-meta-list {
    color: #ccc;
    font-size: 14px;
    line-height: 1.8;
    max-width: 800px;
    margin-bottom: 30px;
}
.show-meta-list strong { color: #b3b3b3; margin-right: 8px; }

/* ============== EPISODES ============== */
.episodes-section { padding: 0 4% 40px; }
.season-tabs { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.season-tab {
    background: #333;
    border: none;
    padding: 8px 16px;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
}
.season-tab.active { background: var(--primary); }

.episode-list { display: flex; flex-direction: column; gap: 0; border-top: 1px solid #333; }
.episode-item {
    display: flex;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid #333;
    align-items: center;
    transition: background 0.2s;
}
.episode-item:hover { background: rgba(255,255,255,0.04); padding-left: 12px; padding-right: 12px; }
.episode-num {
    font-size: 22px;
    color: #b3b3b3;
    min-width: 36px;
    text-align: center;
    font-weight: 300;
}
.episode-thumb {
    width: 180px;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
    background: #222;
}
.episode-info { flex: 1; }
.episode-info h3 { font-size: 16px; margin-bottom: 6px; display: flex; justify-content: space-between; gap: 12px; }
.episode-info h3 span { font-size: 13px; color: #b3b3b3; font-weight: 400; }
.episode-info p { color: #b3b3b3; font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============== PLAYER ============== */
.player-wrap {
    background: #000;
    width: 100%;
    aspect-ratio: 16/9;
    max-height: 80vh;
}
.player-wrap video, .player-wrap iframe {
    width: 100%; height: 100%;
    border: none;
    background: #000;
}
.player-info {
    padding: 24px 4%;
}
.player-info h1 {
    font-size: 28px;
    margin-bottom: 8px;
}
.player-info .ep-meta { color: #b3b3b3; font-size: 14px; margin-bottom: 12px; }

/* ============== AUTH FORMS ============== */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)),
                url('https://images.unsplash.com/photo-1489599809005-7b29e0c5d9b3?auto=format&fit=crop&q=80&w=1920') center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 40px;
}
.auth-box {
    background: rgba(0,0,0,0.85);
    padding: 50px 60px;
    border-radius: 6px;
    width: 100%;
    max-width: 450px;
}
.auth-box h2 {
    font-size: 32px;
    margin-bottom: 28px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    color: #b3b3b3;
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding: 14px 18px;
    background: #333;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 16px;
    font-family: inherit;
}
.form-control:focus { outline: none; background: #454545; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-actions { margin-top: 22px; }
.btn-block { width: 100%; padding: 14px; font-size: 16px; }
.auth-extra {
    margin-top: 20px;
    font-size: 13px;
    color: #b3b3b3;
}
.auth-extra a { color: #fff; }
.auth-extra a:hover { text-decoration: underline; }
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-error { background: #e87c03; color: #fff; }
.alert-success { background: #2f9e44; color: #fff; }

/* ============== FOOTER ============== */
.footer {
    background: #0b0b0b;
    color: #999;
    padding: 50px 4% 20px;
    margin-top: 60px;
    border-top: 1px solid #222;
}
.footer-container { max-width: 1200px; margin: 0 auto; }
.footer-top {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}
.footer-col h3 { color: var(--primary); font-family: 'Bebas Neue', sans-serif; letter-spacing: 2px; font-size: 22px; margin-bottom: 12px;}
.footer-col h4 { color: #fff; font-size: 14px; margin-bottom: 14px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: #999; font-size: 13px; transition: color 0.2s; }
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-col p { font-size: 13px; line-height: 1.6; }
.social-links { display: flex; gap: 12px; }
.social-links a {
    width: 36px; height: 36px;
    background: #222;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
}
.social-links a:hover { background: var(--primary); color: #fff; }
.footer-bottom {
    border-top: 1px solid #222;
    padding-top: 20px;
    text-align: center;
    font-size: 12px;
}

/* ============== EMPTY ============== */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty i { font-size: 48px; margin-bottom: 16px; color: #444; }
.empty h3 { color: #fff; margin-bottom: 8px; }

/* ============== RESPONSIVE ============== */
@media (max-width: 992px) {
    .nav-menu { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #141414; flex-direction: column; padding: 20px; gap: 16px; border-top: 1px solid #222; }
    .nav-menu.open { display: flex; }
    .menu-toggle { display: block; }
    .search-box input { width: 140px; }
    .search-box input:focus { width: 160px; }
    .card { flex: 0 0 200px; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .episode-thumb { width: 140px; }
}

@media (max-width: 600px) {
    .nav-container { gap: 10px; padding: 0 4%; }
    .logo { font-size: 22px; }
    .btn-login { display: none; }
    .search-box input { width: 110px; padding: 6px 28px 6px 10px; font-size: 12px; }
    .hero { height: 65vh; min-height: 380px; }
    .hero-content { bottom: 18%; left: 4%; right: 4%; }
    .hero-desc { font-size: 14px; }
    .btn { padding: 9px 18px; font-size: 14px; }
    .card { flex: 0 0 150px; }
    .card-info { padding: 8px; }
    .card-title { font-size: 13px; }
    .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .auth-box { padding: 30px 24px; }
    .auth-box h2 { font-size: 24px; }
    .episode-item { flex-direction: column; align-items: flex-start; }
    .episode-thumb { width: 100%; }
    .episode-num { display: none; }
    .show-detail { margin-top: -80px; }
    .show-detail h1 { font-size: 32px; }
    .footer-top { grid-template-columns: 1fr 1fr; }
}

/* ============================
   CLASSIC POLISH — animations & finishing touches
   ============================ */

html { scroll-behavior: smooth; }

/* Custom scrollbar — subtle, classic */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0a0a0a; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 5px; border: 2px solid #0a0a0a; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* Selection */
::selection { background: var(--primary); color: #fff; }

/* Keyframes */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes heroZoom {
    from { transform: scale(1.08); }
    to { transform: scale(1); }
}
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(229, 9, 20, 0.45); }
    50% { box-shadow: 0 0 0 8px rgba(229, 9, 20, 0); }
}

/* Page entrance — body fades in cleanly */
body { animation: fadeIn .5s ease-out both; }

/* Reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s ease-out, transform .7s ease-out; will-change: opacity, transform; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* Logo — subtle glow, smooth transition */
.logo { transition: text-shadow .3s ease, transform .3s ease; }
.logo:hover { text-shadow: 0 0 18px rgba(229, 9, 20, 0.55); transform: scale(1.02); }

/* Nav links — classic underline reveal */
.nav-link { position: relative; padding-bottom: 4px; }
.nav-link::after {
    content: ''; position: absolute; left: 0; bottom: 0;
    width: 100%; height: 2px;
    background: var(--primary);
    transform: scaleX(0); transform-origin: right;
    transition: transform .3s ease;
}
.nav-link:hover { color: #fff; }
.nav-link:hover::after { transform: scaleX(1); transform-origin: left; }

/* Hero — bg slow zoom on load, content slides in */
.hero-bg { animation: heroZoom 12s ease-out both; }
.hero-content > * { animation: fadeInUp .8s ease-out both; }
.hero-title { animation-delay: .15s; }
.hero-meta { animation-delay: .3s; }
.hero-desc { animation-delay: .45s; }
.hero-actions { animation-delay: .6s; }

/* Section titles — classic accent bar on left */
.section-title {
    position: relative;
    padding-left: 14px;
    letter-spacing: .3px;
}
.section-title::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 4px; height: 70%;
    background: var(--primary);
    border-radius: 2px;
}

/* Buttons — refined easing, primary glow on hover */
.btn { transition: all .25s cubic-bezier(.4,0,.2,1); letter-spacing: .3px; }
.btn:hover { transform: translateY(-1px); }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(229, 9, 20, .35); }
.btn-play:hover { box-shadow: 0 6px 18px rgba(255,255,255,.18); }

.btn-signup { transition: all .25s ease; }
.btn-signup:hover { box-shadow: 0 4px 14px rgba(229,9,20,.4); }

/* Card — classier hover: lift + subtle border glow */
.card {
    transition: transform .35s cubic-bezier(.4,0,.2,1), box-shadow .35s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.card:hover {
    transform: scale(1.06) translateY(-2px);
    box-shadow: 0 12px 28px rgba(0,0,0,.6), 0 0 0 1px rgba(229,9,20,.35);
}
.card-poster { transition: transform .4s ease; }
.card:hover .card-poster { transform: scale(1.02); }

/* Image loading shimmer — placeholder while img loads */
.card-poster:not([src]),
.card-poster[src=""] {
    background: linear-gradient(90deg, #1a1a1a 0%, #2a2a2a 50%, #1a1a1a 100%);
    background-size: 1000px 100%;
    animation: shimmer 1.6s infinite linear;
}

/* Episode rows — refined */
.episode-item { transition: background .2s ease, padding .2s ease, transform .2s ease; }
.episode-item:hover { transform: translateX(4px); }

/* Form inputs — focus ring */
.form-control { transition: background .25s ease, box-shadow .25s ease; }
.form-control:focus { box-shadow: 0 0 0 2px rgba(229,9,20,.5); }

/* Search box subtle glow */
.search-box input { transition: width .3s ease, box-shadow .3s ease, background .3s ease; }
.search-box input:focus { box-shadow: 0 0 0 1px rgba(229,9,20,.6); background: rgba(0,0,0,.9); }

/* Auth box — entrance */
.auth-box { animation: fadeInUp .6s ease-out both; box-shadow: 0 18px 50px rgba(0,0,0,.6); }

/* Social icons — lift */
.social-links a { transition: all .25s ease; }
.social-links a:hover { transform: translateY(-3px); box-shadow: 0 6px 14px rgba(229,9,20,.35); }

/* Footer column titles — accent */
.footer-col h3 { position: relative; display: inline-block; }
.footer-col h3::after {
    content: '';
    display: block;
    width: 36px; height: 2px;
    background: var(--primary);
    margin-top: 6px;
    border-radius: 2px;
}

/* User dropdown — slide-in feel */
.user-dropdown { transform: translateY(-6px); transition: opacity .2s ease, visibility .2s, transform .2s ease; }
.user-menu:hover .user-dropdown { transform: translateY(0); }

/* Season tabs */
.season-tab { transition: all .2s ease; }
.season-tab:hover:not(.active) { background: #444; transform: translateY(-1px); }
.season-tab.active { box-shadow: 0 4px 12px rgba(229,9,20,.35); }

/* Badge subtle pulse on hero only */
.hero-meta .badge { animation: pulseGlow 2.6s ease-in-out 1.2s infinite; }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
    .hero-bg { animation: none; }
}
