/* ==========================================================================
   4uStream IMDb Explorer & Player Stylesheet
   ========================================================================== */

:root {
    --bg-main: #08090d;
    --bg-card: #12141d;
    --bg-card-hover: #181c28;
    --accent-red: #e50914;
    --accent-red-hover: #f40612;
    --accent-gold: #f5c518;
    --accent-cyan: #00d2ff;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(229, 9, 20, 0.4);
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 25px rgba(229, 9, 20, 0.35);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(8, 9, 13, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 10px 0 0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.brand-icon {
    font-size: 24px;
}

.brand-accent {
    color: var(--accent-red);
}

.imdb-pill {
    background: var(--accent-gold);
    color: #000;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    margin-left: 6px;
}

/* Nav Center: Centered Search Bar */
.nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 24px;
    padding: 7px 16px;
    width: 100%;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-box:focus-within {
    border-color: var(--accent-red);
    box-shadow: 0 0 20px rgba(229, 9, 20, 0.35), 0 0 0 1px var(--accent-red);
    background: rgba(18, 20, 32, 0.95);
}

.search-icon {
    color: var(--text-secondary);
    margin-right: 10px;
    flex-shrink: 0;
}

.search-box input {
    background: transparent;
    border: none;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 13.5px;
    width: 100%;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-spinner-inline {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent-red);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    flex-shrink: 0;
}

.search-clear {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    margin-right: 4px;
}
.search-clear:hover { color: #fff; }

.search-kbd {
    font-family: inherit;
    background: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    margin-left: 6px;
    pointer-events: none;
    flex-shrink: 0;
}

/* Nav Subbar: Categories Carousel */
.nav-subbar {
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 6px 0;
    background: rgba(9, 10, 15, 0.7);
}

.nav-subbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.nav-subbar-container::-webkit-scrollbar { display: none; }

.nav-categories {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 13.5px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.nav-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.nav-btn.active {
    color: #fff;
    background: var(--accent-red);
    border-color: var(--accent-red);
    box-shadow: 0 2px 10px rgba(229, 9, 20, 0.35);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* ==========================================================================
   Total Movies Counter Badges
   ========================================================================== */
.nav-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(229, 9, 20, 0.12);
    border: 1px solid rgba(229, 9, 20, 0.4);
    padding: 6px 14px;
    border-radius: 20px;
    color: #ff5252;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 0 12px rgba(229, 9, 20, 0.2);
    white-space: nowrap;
}

.nav-count-badge strong {
    color: #fff;
    font-weight: 800;
}

.count-pulse-dot {
    width: 8px;
    height: 8px;
    background: #e50914;
    border-radius: 50%;
    box-shadow: 0 0 8px #e50914;
    animation: pulse 1.6s infinite;
}

.hero-stats-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.stat-chip {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f1f5f9;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.stat-chip strong {
    color: var(--accent-gold);
}

.header-title-group {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.total-movies-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(245, 197, 24, 0.12);
    border: 1px solid rgba(245, 197, 24, 0.4);
    color: var(--accent-gold);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.total-movies-pill strong {
    color: #fff;
    font-weight: 800;
}

.pill-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-gold);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--accent-gold);
}

.source-status-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 210, 255, 0.1);
    border: 1px solid rgba(0, 210, 255, 0.3);
    color: var(--accent-cyan);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.source-status-btn:hover {
    background: rgba(0, 210, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.3);
}

.status-pulse {
    width: 8px;
    height: 8px;
    background: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-cyan);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.7; }
}

/* ==========================================================================
   Hero Featured Banner
   ========================================================================== */
.hero-section {
    position: relative;
    min-height: 480px;
    display: flex;
    align-items: center;
    padding: 40px 0;
    border-bottom: 1px solid var(--border-subtle);
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center 20%;
    filter: brightness(0.4) saturate(1.1);
    transition: background-image 0.5s ease-in-out;
}

.hero-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 70% 30%, transparent 20%, rgba(8, 9, 13, 0.85) 70%, var(--bg-main) 100%),
                linear-gradient(to top, var(--bg-main) 0%, transparent 60%);
}

.hero-container {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

.hero-card {
    max-width: 650px;
}

.hero-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.badge-featured {
    background: var(--accent-red);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 4px;
}

.badge-imdb {
    background: rgba(245, 197, 24, 0.15);
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    font-weight: 800;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-id {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-subtle);
    color: #cbd5e1;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
}

.hero-title {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1px;
    margin-bottom: 14px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.hero-plot {
    font-size: 15px;
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-meta {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-weight: 600;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent-red);
    color: #fff;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
}

.btn-primary:hover {
    background: var(--accent-red-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 9, 20, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 12px 28px;
    font-size: 15px;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-block {
    width: 100%;
}

/* ==========================================================================
   Filter Bar
   ========================================================================== */
.filter-section {
    background: rgba(18, 20, 29, 0.6);
    border-bottom: 1px solid var(--border-subtle);
    padding: 14px 0;
}

.filter-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-item label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.custom-select {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    outline: none;
    cursor: pointer;
    transition: 0.2s ease;
}

.custom-select:hover, .custom-select:focus {
    border-color: var(--accent-red);
}

.filter-stats {
    margin-left: auto;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

/* ==========================================================================
   Main Content & Movie Grid
   ========================================================================== */
.main-content {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 24px;
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.search-badge {
    background: rgba(229, 9, 20, 0.15);
    border: 1px solid var(--accent-red);
    color: #ff4b55;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 22px;
    min-height: 300px;
}

/* Movie Card */
.movie-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-subtle);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    cursor: pointer;
    content-visibility: auto;
    contain-intrinsic-size: 180px 320px;
}

.movie-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card), var(--shadow-glow);
}

.poster-wrap {
    position: relative;
    width: 100%;
    padding-top: 148%; /* Poster ratio */
    background: #111420;
    overflow: hidden;
}

.poster-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

/* Overlay play button on hover */
.card-play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.movie-card:hover .card-play-overlay {
    opacity: 1;
}

.play-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent-red);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 0 20px rgba(229, 9, 20, 0.8);
    transform: scale(0.85);
    transition: transform 0.2s ease;
}

.movie-card:hover .play-circle {
    transform: scale(1);
}

/* Rating badge inside poster */
.card-rating-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(245, 197, 24, 0.4);
    color: var(--accent-gold);
    font-size: 11px;
    font-weight: 800;
    padding: 3px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
    backdrop-filter: blur(4px);
    z-index: 2;
}

.card-year-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: #cbd5e1;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 4px;
    z-index: 2;
}

.card-type-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: #0284c7;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 4px;
    z-index: 2;
}

.card-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-bottom {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.card-imdb-id {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-cyan);
    background: rgba(0, 210, 255, 0.08);
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.2px;
}

.card-genre-text {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
}

/* ==========================================================================
   Loading Spinner
   ========================================================================== */
.loading-spinner {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    gap: 16px;
    color: var(--text-secondary);
}

.spinner {
    width: 42px;
    height: 42px;
    border: 3px solid rgba(229, 9, 20, 0.2);
    border-top-color: var(--accent-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.pagination-container {
    margin: 40px auto;
    text-align: center;
}

/* ==========================================================================
   Modals (Details & Live Player)
   ========================================================================== */
.modal-overlay, .player-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.modal-overlay.active, .player-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: #111422;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 780px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
    transform: translateY(20px);
    transition: transform 0.25s ease;
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 14px;
    right: 16px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: 0.2s ease;
}
.modal-close-btn:hover { background: var(--accent-red); }

.modal-backdrop-wrap {
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
    filter: brightness(0.4);
}

.modal-backdrop-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #111422 0%, transparent 100%);
}

.modal-content-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 24px;
    padding: 0 28px 28px;
    margin-top: -60px;
    position: relative;
    z-index: 2;
}

.modal-poster-wrap img {
    width: 100%;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    border: 1px solid var(--border-subtle);
    margin-bottom: 12px;
}

.modal-header-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.copy-id-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-subtle);
    color: #cbd5e1;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s ease;
}
.copy-id-btn:hover { background: rgba(255, 255, 255, 0.2); }

.modal-title {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 6px;
    line-height: 1.2;
}

.modal-meta {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
}

.modal-plot {
    font-size: 14px;
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 18px;
}

.modal-crew {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 12px;
    margin-bottom: 16px;
}

.crew-label {
    color: var(--text-muted);
    font-weight: 600;
}

.crew-value {
    color: #fff;
}

.direct-watch-link-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.direct-watch-link-box a {
    color: var(--accent-cyan);
    text-decoration: none;
    font-family: var(--font-mono);
}

/* ==========================================================================
   Player Window
   ========================================================================== */
.player-window {
    background: #0d0f17;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 1060px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.player-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #131622;
    border-bottom: 1px solid var(--border-subtle);
    gap: 12px;
    flex-wrap: wrap;
}

.player-movie-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

/* Series episode controls inside player bar */
.player-series-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 3px 8px;
    border-radius: 16px;
    font-size: 12px;
}

.series-tag {
    color: var(--accent-gold);
    font-weight: 700;
    font-size: 11px;
}

.player-series-controls label {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 11px;
}

.player-series-controls input {
    width: 44px;
    background: #090a0f;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    outline: none;
}

.player-series-controls input:focus {
    border-color: var(--accent-red);
}

.btn-ep-play {
    background: var(--accent-red);
    border: none;
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.btn-ep-play:hover {
    background: var(--accent-red-hover);
}

.source-notice.connected {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.15), rgba(6, 95, 70, 0.25));
    border-bottom: 1px solid rgba(16, 185, 129, 0.4);
    color: #a7f3d0;
}
.source-notice.connected code {
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 6px;
    border-radius: 4px;
    color: #6ee7b7;
    font-family: var(--font-mono);
}

.source-status-btn.connected {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.5);
    color: #10b981;
}

.status-pulse.connected {
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
}

.player-servers {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
}

.server-pill {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.server-pill:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
}

.server-pill.active {
    background: var(--accent-red);
    color: #fff;
    border-color: var(--accent-red);
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.5);
}

.server-pill.custom {
    border-color: rgba(0, 210, 255, 0.4);
    color: var(--accent-cyan);
}

.server-pill.custom.active {
    background: linear-gradient(135deg, #0077b6, #00b4d8);
    color: #fff;
    box-shadow: 0 0 12px rgba(0, 180, 216, 0.5);
}

.player-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.player-close-btn:hover { background: var(--accent-red); }

.source-notice {
    background: linear-gradient(90deg, rgba(0, 119, 182, 0.25), rgba(0, 180, 216, 0.15));
    border-bottom: 1px solid rgba(0, 180, 216, 0.3);
    padding: 8px 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e0f2fe;
}

.notice-icon {
    font-size: 16px;
    color: var(--accent-cyan);
    font-weight: bold;
}

.player-frame-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 ratio */
    background: #000;
}

.player-frame-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ==========================================================================
   Source Info Card
   ========================================================================== */
.source-info-card {
    padding: 30px;
}

.source-info-body h3 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--accent-cyan);
}

.source-info-body p {
    font-size: 14px;
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 16px;
}

.code-box {
    background: #08090e;
    border: 1px solid var(--border-subtle);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.code-box code {
    font-family: var(--font-mono);
    color: var(--accent-gold);
    font-size: 13px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 30px 0;
    margin-top: 60px;
    background: #06070a;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.footer-sub {
    margin-top: 6px;
    font-size: 12px;
}

/* ==========================================================================
   Comprehensive Responsive Breakpoints (Mobile, Tablet, Desktop, Ultrawide)
   ========================================================================== */

/* Universal Touch & Optimization Enhancements */
button, a, input, select {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.movie-card {
    transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.22s ease;
}

.movie-card:active {
    transform: scale(0.96) !important;
}

.btn:active, .nav-btn:active, .server-pill:active, .season-btn:active, .tg-join-btn:active {
    transform: scale(0.95) !important;
}

/* 1. Ultrawide & 4K Displays (min-width: 1600px) */
@media (min-width: 1600px) {
    .nav-container, .main-content, .hero-container, .watch-container {
        max-width: 1720px;
        padding-left: 36px;
        padding-right: 36px;
    }
    .movies-grid {
        grid-template-columns: repeat(6, 1fr) !important;
        gap: 22px !important;
    }
    .hero-title {
        font-size: 44px;
    }
}

/* 2. Standard Desktops & Large Laptops (1200px - 1599px) */
@media (min-width: 1200px) and (max-width: 1599px) {
    .nav-container, .main-content, .hero-container, .watch-container {
        max-width: 1380px;
        padding-left: 28px;
        padding-right: 28px;
    }
    .movies-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 20px !important;
    }
    .hero-title {
        font-size: 38px;
    }
}

/* 3. Small Laptops & Tablets Landscape (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .nav-container, .main-content, .hero-container, .watch-container {
        padding-left: 20px;
        padding-right: 20px;
    }
    .movies-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 16px !important;
    }
    .hero-title {
        font-size: 32px;
    }
    .hero-container {
        padding: 36px 24px;
    }
}

/* 4. Tablets Portrait (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .nav-container, .main-content, .hero-container, .watch-container {
        padding-left: 18px;
        padding-right: 18px;
    }
    .movies-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 15px !important;
    }
    .hero-title {
        font-size: 28px;
    }
    .hero-container {
        padding: 30px 20px;
    }
    .search-box {
        width: 100% !important;
    }
}

/* 5. Mobile Phones (max-width: 767px) */
@media (max-width: 767px) {
    .navbar {
        padding: 8px 0 0;
    }
    .nav-container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
    }
    .nav-left {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    .nav-center {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
    .search-box {
        width: 100% !important;
        height: 44px;
        padding: 0 14px;
        border-radius: 22px;
        background: rgba(18, 20, 29, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.15);
    }
    .search-box input {
        font-size: 14px;
    }
    .search-kbd {
        display: none !important;
    }
    .nav-right {
        display: none;
    }

    /* Subbar Category Swipe Carousel */
    .nav-subbar {
        padding: 4px 0 6px;
    }
    .nav-subbar-container {
        padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
    }
    .nav-categories {
        gap: 7px;
        padding-bottom: 2px;
    }
    .nav-btn {
        scroll-snap-align: start;
        font-size: 12px;
        padding: 6px 13px;
        min-height: 36px;
        border-radius: 18px;
    }

    /* Hero Banner Mobile */
    .hero-container {
        padding: 24px 14px 20px;
        border-radius: 14px;
        margin: 12px max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
    }
    .hero-title {
        font-size: 24px;
        line-height: 1.25;
        letter-spacing: -0.4px;
    }
    .hero-plot {
        font-size: 13px;
        line-height: 1.45;
        -webkit-line-clamp: 2;
        margin-bottom: 14px;
    }
    .hero-stats-strip {
        gap: 6px;
        flex-wrap: wrap;
    }
    .stat-chip {
        font-size: 11px;
        padding: 3px 8px;
    }
    .hero-actions {
        flex-direction: column;
        gap: 8px;
    }
    .hero-actions .btn {
        width: 100%;
        min-height: 44px;
        justify-content: center;
        font-size: 14px;
    }

    /* Filters Bar */
    .filter-container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
    }
    .filter-item select {
        width: 100%;
        min-height: 42px;
        font-size: 14px;
    }

    /* Main Content & High Performance 2 Columns Grid */
    .main-content {
        padding: 16px max(12px, env(safe-area-inset-right)) 36px max(12px, env(safe-area-inset-left));
    }
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        margin-bottom: 14px;
    }
    .content-header h2 {
        font-size: 18px;
    }
    .movies-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 11px !important;
    }
    .movie-card {
        border-radius: 10px;
    }
    .poster-wrap {
        border-radius: 8px;
        aspect-ratio: 2 / 3;
    }
    .card-info {
        padding: 8px 3px 3px;
    }
    .card-title {
        font-size: 13px;
        line-height: 1.3;
        margin-bottom: 4px;
    }
    .card-genre-text {
        display: none;
    }
    .card-rating-badge, .card-year-badge {
        font-size: 10px;
        padding: 2px 5px;
    }
    .card-type-badge {
        font-size: 9.5px;
        padding: 2px 5px;
    }

    /* Floating Telegram Quick-Access Pill on Mobile */
    .tg-float-pill {
        bottom: max(16px, env(safe-area-inset-bottom)) !important;
        right: 14px !important;
        padding: 8px 14px !important;
        font-size: 12px !important;
        gap: 6px !important;
        border-radius: 25px !important;
    }
    .tg-float-pill svg {
        width: 15px !important;
        height: 15px !important;
    }
}

/* 6. Extra Small Screens (max-width: 380px) */
@media (max-width: 380px) {
    .movies-grid {
        gap: 8px !important;
    }
    .brand-logo {
        font-size: 17px;
    }
    .card-title {
        font-size: 12px;
    }
    .nav-btn {
        font-size: 11.5px;
        padding: 5px 10px;
    }
    .hero-title {
        font-size: 21px;
    }
}

/* Touch Device Optimization: Always show slight rating presence */
@media (hover: none) and (pointer: coarse) {
    .movie-card:hover .poster-overlay {
        opacity: 0;
    }
    .movie-card:hover .play-icon-glow {
        opacity: 0;
        transform: scale(0.85);
    }
    .movie-card:active .poster-overlay {
        opacity: 1;
    }
    .movie-card:active .play-icon-glow {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==========================================================================
   Telegram Modal & Floating Pill Styles
   ========================================================================== */
.tg-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(3, 7, 18, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tg-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.tg-modal-card {
    position: relative;
    width: 460px;
    max-width: 100%;
    background: linear-gradient(180deg, #0e1526 0%, #090d18 100%);
    border: 1px solid rgba(0, 150, 255, 0.28);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 45px rgba(0, 136, 204, 0.25);
    border-radius: 20px;
    padding: 30px 26px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transform: scale(0.92) translateY(15px);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tg-modal-overlay.active .tg-modal-card {
    transform: scale(1) translateY(0);
}

.tg-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tg-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: rotate(90deg);
}

.tg-icon-circle {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: radial-gradient(circle, #0099e6 0%, #0077b5 100%);
    border: 3px solid rgba(56, 189, 248, 0.45);
    box-shadow: 0 0 30px rgba(0, 136, 204, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tg-badge {
    margin-top: 16px;
    background: rgba(0, 136, 204, 0.16);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.tg-title {
    font-size: 23px;
    font-weight: 800;
    color: #fff;
    margin: 14px 0 8px;
    letter-spacing: -0.3px;
}

.tg-desc {
    font-size: 13.5px;
    color: #94a3b8;
    line-height: 1.55;
    margin-bottom: 20px;
    max-width: 390px;
}

.tg-desc strong {
    color: #f1f5f9;
}

.tg-features {
    width: 100%;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    margin-bottom: 22px;
}

.tg-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #cbd5e1;
}

.tg-feature-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.tg-feature-text strong {
    color: #fff;
}

.tg-join-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #00a0e9 0%, #007bb5 100%);
    color: #fff;
    border: none;
    padding: 13px 22px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(0, 150, 255, 0.45);
    transition: all 0.25s ease;
}

.tg-join-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 150, 255, 0.7);
    color: #fff;
}

.tg-later-btn {
    background: none;
    border: none;
    color: #64748b;
    font-size: 12.5px;
    margin-top: 14px;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.tg-later-btn:hover {
    color: #94a3b8;
}

/* Floating Telegram Quick-Access Button */
.tg-float-pill {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #0099e6 0%, #0077b5 100%);
    color: #fff;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 13.5px;
    font-weight: 700;
    box-shadow: 0 8px 25px rgba(0, 136, 204, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.25s ease;
}

.tg-float-pill:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 32px rgba(0, 136, 204, 0.75);
    color: #fff;
}

@media (max-width: 600px) {
    .tg-modal-card {
        padding: 24px 18px 20px;
    }
    .tg-title {
        font-size: 20px;
    }
    .tg-float-pill {
        bottom: 16px;
        right: 16px;
        padding: 8px 14px;
        font-size: 12px;
    }
}



/* =============================================================================
   Audio Language Selector Toolbar, Badges & Interactive Toasts
   ============================================================================= */
.audio-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0 16px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 16px;
    backdrop-filter: blur(12px);
    flex-wrap: wrap;
}

.audio-label-group {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13.5px;
    font-weight: 700;
    color: #cbd5e1;
    white-space: nowrap;
}

.audio-icon {
    font-size: 16px;
    line-height: 1;
}

.audio-heading {
    letter-spacing: -0.2px;
}

.audio-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.audio-pill {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    white-space: nowrap;
}

.audio-pill:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
    transform: translateY(-1px);
}

.audio-pill.active {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    border-color: #38bdf8;
    color: #fff;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.45);
    font-weight: 700;
}

.audio-pill .orig-badge {
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #f5c518;
}

.audio-pill .dub-badge {
    background: rgba(229, 9, 20, 0.35);
    border: 1px solid rgba(229, 9, 20, 0.45);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 9.5px;
    text-transform: uppercase;
    font-weight: 700;
    color: #fca5a5;
}

.audio-status-toast {
    display: none;
    align-items: center;
    gap: 8px;
    background: rgba(2, 132, 199, 0.18);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12.5px;
    color: #bae6fd;
    margin-top: 10px;
    animation: fadeInToast 0.3s ease;
}

@keyframes fadeInToast {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Movie Card Audio Badge on Catalog Grid */
.card-audio-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(10, 14, 26, 0.88);
    border: 1px solid rgba(56, 189, 248, 0.45);
    color: #38bdf8;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 5px;
    backdrop-filter: blur(6px);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.modal-audio-row {
    margin-top: 14px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-audio-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #94a3b8;
}

.modal-audio-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.modal-audio-pill {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
}

@media (max-width: 767px) {
    .audio-toolbar {
        padding: 10px 12px;
        gap: 8px;
        margin: 10px 0 14px;
    }
    .audio-pill {
        padding: 5px 11px;
        font-size: 12px;
    }
    .card-audio-badge {
        font-size: 10px;
        padding: 2px 5px;
        bottom: 6px;
        left: 6px;
    }
}
