/* ================================================================
   CM Stream — Premium Streaming UI
   Dark theme, glassmorphism, smooth transitions, Netflix vibes
   ================================================================ */

/* ------------------------------------------------------------------ */
/*  CSS Variables & Reset                                              */
/* ------------------------------------------------------------------ */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a2e;
    --bg-glass: rgba(26, 26, 46, 0.7);
    --bg-glass-heavy: rgba(10, 10, 15, 0.85);

    --accent-primary: #e50914;
    --accent-secondary: #b20710;
    --accent-gold: #f5c518;
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-green: #22c55e;

    --text-primary: #f1f1f1;
    --text-secondary: #a0a0b0;
    --text-muted: #666680;

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.15);

    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(229, 9, 20, 0.15);
    --shadow-modal: 0 25px 80px rgba(0, 0, 0, 0.8);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition-fast: 0.2s ease;
    --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

    --nav-height: 64px;
    --card-width: 180px;
    --card-height: 270px;

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    border: none;
    cursor: pointer;
    font-family: inherit;
    outline: none;
}

/* ------------------------------------------------------------------ */
/*  Scrollbar                                                          */
/* ------------------------------------------------------------------ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ------------------------------------------------------------------ */
/*  Navigation                                                         */
/* ------------------------------------------------------------------ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 48px;
    z-index: 1000;
    transition: background var(--transition-smooth);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
}

.navbar.scrolled {
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--accent-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    box-shadow: 0 0 20px rgba(229, 9, 20, 0.4);
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo-accent {
    color: var(--accent-primary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 4px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    position: relative;
}

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

.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 1px;
}

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

/* Search */
.search-container {
    display: flex;
    align-items: center;
    position: relative;
}

.search-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

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

.search-input {
    width: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all var(--transition-smooth);
    border-bottom: 2px solid transparent;
}

.search-container.expanded .search-input {
    width: 220px;
    padding: 8px 12px;
    border-bottom-color: var(--accent-primary);
}

/* Profile Badge */
.profile-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.profile-badge:hover {
    background: rgba(255, 255, 255, 0.12);
}

.profile-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.profile-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Profile Dropdown */
.profile-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 280px;
    background: var(--bg-card);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-smooth);
    z-index: 1001;
    backdrop-filter: blur(20px);
}

.profile-badge:hover .profile-dropdown,
.profile-dropdown:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.dropdown-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.dropdown-name {
    font-weight: 600;
    font-size: 14px;
}

.dropdown-email {
    font-size: 12px;
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 12px 0;
}

.dropdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.dropdown-label {
    font-size: 13px;
    color: var(--text-muted);
}

.dropdown-value {
    font-size: 13px;
    font-weight: 500;
}

.premium-badge {
    background: linear-gradient(135deg, var(--accent-gold), #ff8c00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* ------------------------------------------------------------------ */
/*  Hero Section                                                       */
/* ------------------------------------------------------------------ */
.hero {
    position: relative;
    height: 85vh;
    min-height: 550px;
    max-height: 800px;
    overflow: hidden;
}

.hero-backdrop {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
    transition: opacity 1s ease;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(0deg, var(--bg-primary) 0%, transparent 40%),
        linear-gradient(90deg, rgba(0, 0, 0, 0.7) 0%, transparent 60%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, transparent 30%);
}

.hero-content {
    position: absolute;
    bottom: 15%;
    left: 48px;
    max-width: 600px;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(245, 197, 24, 0.15);
    border: 1px solid rgba(245, 197, 24, 0.3);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-gold);
}

.badge-icon {
    font-size: 12px;
}

.hero-title {
    font-size: clamp(28px, 4vw, 52px);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 12px;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.meta-dot {
    color: var(--text-muted);
}

.hero-overview {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 24px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.btn-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--accent-primary);
    color: white;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    box-shadow: 0 4px 20px rgba(229, 9, 20, 0.4);
}

.btn-primary:hover {
    background: var(--accent-secondary);
    transform: scale(1.03);
    box-shadow: 0 6px 30px rgba(229, 9, 20, 0.5);
}

.btn-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    transition: all var(--transition-fast);
}

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

/* ------------------------------------------------------------------ */
/*  Content Rows & Carousels                                           */
/* ------------------------------------------------------------------ */
.content {
    position: relative;
    z-index: 2;
    margin-top: -80px;
    padding-bottom: 80px;
}

.content-row {
    margin-bottom: 40px;
    padding: 0 48px;
}

.row-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.row-icon {
    font-size: 18px;
}

.row-wrapper {
    position: relative;
}

.carousel {
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    padding: 10px 0 20px 0;
}

.carousel::-webkit-scrollbar {
    display: none;
}

.carousel-track {
    display: flex;
    gap: 16px;
}

/* Scroll Buttons */
.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border: 1px solid var(--border-subtle);
    opacity: 0;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.row-wrapper:hover .scroll-btn {
    opacity: 1;
}

.scroll-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-50%) scale(1.1);
}

.scroll-left {
    left: -8px;
}

.scroll-right {
    right: -8px;
}

/* ------------------------------------------------------------------ */
/*  Movie / Show Cards                                                 */
/* ------------------------------------------------------------------ */
.card {
    flex-shrink: 0;
    width: var(--card-width);
    cursor: pointer;
    transition: transform var(--transition-spring);
    position: relative;
}

.card:hover {
    transform: scale(1.08);
    z-index: 5;
}

.card-poster {
    width: 100%;
    height: var(--card-height);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-card);
}

.card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-smooth);
}

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

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-fast);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px;
    border-radius: var(--radius-md);
}

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

.card-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 44px;
    height: 44px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--transition-smooth);
    box-shadow: 0 4px 20px rgba(229, 9, 20, 0.5);
}

.card:hover .card-play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.card-play svg {
    margin-left: 2px;
}

.card-rating {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    gap: 3px;
}

.card-resolution {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--accent-primary);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
}

.card-title {
    font-size: 13px;
    font-weight: 600;
    margin-top: 10px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-year {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ------------------------------------------------------------------ */
/*  Loading Spinner                                                    */
/* ------------------------------------------------------------------ */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    gap: 16px;
    color: var(--text-muted);
    font-size: 14px;
}

.loading-spinner.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ------------------------------------------------------------------ */
/*  Modal                                                              */
/* ------------------------------------------------------------------ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-smooth);
    backdrop-filter: blur(4px);
}

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

.modal {
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-spring);
    box-shadow: var(--shadow-modal);
    border: 1px solid var(--border-subtle);
}

.modal-overlay.visible .modal {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    color: white;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--accent-primary);
    transform: scale(1.1);
}

.modal-backdrop {
    width: 100%;
    height: 350px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.modal-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 350px;
    background: linear-gradient(0deg, var(--bg-secondary) 0%, transparent 60%);
    pointer-events: none;
}

.modal-content {
    padding: 0 32px 32px;
    margin-top: -80px;
    position: relative;
    z-index: 1;
}

.modal-header {
    margin-bottom: 24px;
}

.modal-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
}

.modal-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.modal-badge {
    background: rgba(245, 197, 24, 0.15);
    border: 1px solid rgba(245, 197, 24, 0.3);
    color: var(--accent-gold);
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
}

.modal-body h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.modal-overview {
    margin-bottom: 24px;
}

.modal-overview p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.modal-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.info-value {
    font-size: 14px;
    color: var(--text-primary);
}

/* Cast */
.modal-cast {
    margin-bottom: 24px;
}

.cast-list {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.cast-item {
    flex-shrink: 0;
    text-align: center;
    width: 80px;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.cast-photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 8px;
    border: 2px solid var(--border-subtle);
    background: var(--bg-card);
    transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.cast-item:hover .cast-photo {
    border-color: var(--accent-primary);
    transform: scale(1.08);
}

.cast-item:hover .cast-name {
    color: var(--text-primary);
}

.cast-name {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.3;
    transition: color var(--transition-fast);
}

/* Streaming Links */
.modal-streams,
.modal-downloads {
    margin-bottom: 24px;
}

.streams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.stream-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
}

.stream-link:hover {
    background: rgba(229, 9, 20, 0.1);
    border-color: rgba(229, 9, 20, 0.3);
    transform: translateY(-2px);
}

.stream-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stream-server {
    font-size: 13px;
    font-weight: 600;
}

.stream-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.stream-quality {
    padding: 3px 8px;
    background: var(--accent-primary);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: white;
}

/* ------------------------------------------------------------------ */
/*  Seasons & Episodes                                                 */
/* ------------------------------------------------------------------ */
.modal-seasons {
    margin-bottom: 24px;
}

.season-block {
    margin-bottom: 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.season-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: background var(--transition-fast);
    user-select: none;
}

.season-header:hover {
    background: rgba(255, 255, 255, 0.08);
}

.season-title {
    font-size: 15px;
    font-weight: 700;
    flex: 1;
}

.season-episode-count {
    font-size: 12px;
    color: var(--text-muted);
}

.season-toggle {
    font-size: 12px;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.episode-list {
    border-top: 1px solid var(--border-subtle);
}

.episode-card {
    display: flex;
    gap: 14px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.episode-card:last-child {
    border-bottom: none;
}

.episode-card:hover {
    background: rgba(255, 255, 255, 0.04);
}

.episode-card.active {
    background: rgba(229, 9, 20, 0.1);
    border-left: 3px solid var(--accent-primary);
    padding-left: 13px;
}


.episode-thumb {
    flex-shrink: 0;
    width: 100px;
    height: 56px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    background: var(--bg-card);
}

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

.episode-number {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.75);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-gold);
}

.episode-info {
    flex: 1;
    min-width: 0;
}

.episode-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.episode-meta {
    display: flex;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.episode-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ep-link-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.ep-link-badge.stream {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.ep-link-badge.download {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

/* ------------------------------------------------------------------ */
/*  Toast                                                              */
/* ------------------------------------------------------------------ */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 12px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    z-index: 3000;
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-smooth);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-card);
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ------------------------------------------------------------------ */
/*  Footer                                                             */
/* ------------------------------------------------------------------ */
.footer {
    text-align: center;
    padding: 32px 48px;
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid var(--border-subtle);
}

.footer a {
    color: var(--accent-primary);
    font-weight: 500;
}

.footer a:hover {
    text-decoration: underline;
}

/* Mobile navigation lives off-canvas on larger screens. */
.mobile-bottom-nav {
    display: none;
}

.mobile-nav-icon {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ------------------------------------------------------------------ */
/*  Skeleton Loading                                                   */
/* ------------------------------------------------------------------ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, rgba(255, 255, 255, 0.06) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-card {
    flex-shrink: 0;
    width: var(--card-width);
    height: calc(var(--card-height) + 48px);
}

/* ------------------------------------------------------------------ */
/*  Responsive                                                         */
/* ------------------------------------------------------------------ */
@media (max-width: 768px) {
    body {
        padding-bottom: calc(92px + env(safe-area-inset-bottom));
    }

    .navbar {
        padding: 0 16px;
    }

    .nav-links {
        display: none;
    }

    .hero-content {
        left: 16px;
        right: 16px;
        max-width: none;
    }

    .hero-title {
        font-size: 24px;
    }

    .content-row {
        padding: 0 16px;
    }

    .hero {
        height: 70vh;
    }

    :root {
        --card-width: 140px;
        --card-height: 210px;
    }

    .modal {
        width: 95%;
        max-height: 95vh;
    }

    .modal-content {
        padding: 0 16px 24px;
    }

    .modal-title {
        font-size: 22px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 10px 20px;
        font-size: 13px;
    }

    .mobile-bottom-nav {
        position: fixed;
        left: 50%;
        bottom: max(12px, env(safe-area-inset-bottom));
        z-index: 1900;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 3px;
        width: calc(100% - 24px);
        max-width: 440px;
        min-height: 68px;
        padding: 7px;
        transform: translateX(-50%);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 22px;
        background: rgba(15, 15, 24, 0.9);
        box-shadow: 0 14px 44px rgba(0, 0, 0, 0.6), 0 0 28px rgba(229, 9, 20, 0.08);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
    }

    .mobile-nav-item {
        position: relative;
        display: flex;
        min-width: 0;
        min-height: 52px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        border-radius: 16px;
        background: transparent;
        color: var(--text-muted);
        font-size: 10px;
        font-weight: 600;
        line-height: 1;
        transition: color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-nav-item:active {
        transform: scale(0.96);
    }

    .mobile-nav-item.active {
        color: #fff;
        background: linear-gradient(145deg, rgba(229, 9, 20, 0.24), rgba(139, 92, 246, 0.12));
    }

    .mobile-nav-item.active .mobile-nav-icon {
        color: var(--accent-primary);
        filter: drop-shadow(0 0 7px rgba(229, 9, 20, 0.45));
    }

    .footer {
        padding-bottom: calc(28px + env(safe-area-inset-bottom));
    }
}

/* ------------------------------------------------------------------ */
/*  Catalog Grid & Pagination                                          */
/* ------------------------------------------------------------------ */
.catalog-section {
    padding: 0 48px 48px;
    margin-top: 24px;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 32px 20px;
    margin-top: 24px;
}

.catalog-grid .card {
    width: 100%;
}

.catalog-grid .card-poster {
    width: 100%;
    height: 270px;
}

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    margin-top: 56px;
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
}

.pagination-btn {
    padding: 10px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.3);
}

.pagination-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 80px;
    text-align: center;
}

@media (max-width: 768px) {
    .catalog-section {
        padding: 0 16px 32px;
        margin-top: 80px;
    }
    .catalog-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 20px 12px;
    }
    .catalog-grid .card-poster {
        height: 195px;
    }
    .pagination-container {
        gap: 16px;
        margin-top: 40px;
    }
    .pagination-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}


/* ================================================================
   Added Styles for Filters & Live TV Player
   ================================================================ */

.global-filter-section {
    padding: 16px 48px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background: linear-gradient(180deg, rgba(10, 10, 15, 0.95) 0%, rgba(10, 10, 15, 0.8) 100%);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: var(--nav-height);
    z-index: 50;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all var(--transition-smooth);
}

.content.hero-hidden {
    margin-top: var(--nav-height);
}

.catalog-header-flex, .live-header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-dropdown-container {
    position: relative;
}

.filter-select-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all var(--transition-fast);
}

.filter-select-btn:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.08);
}

.filter-select-btn .chevron {
    font-size: 10px;
    color: var(--text-secondary);
    transition: transform var(--transition-fast);
}

.filter-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: auto;
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    width: 220px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all var(--transition-smooth);
    box-shadow: var(--shadow-modal);
}

.filter-dropdown-menu.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.filter-dropdown-item {
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}

.filter-dropdown-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.filter-dropdown-item.active {
    color: var(--text-primary);
    font-weight: 700;
    background: rgba(229, 9, 20, 0.15);
    border-left: 3px solid var(--accent-primary);
}

.btn-clear-filters {
    background: rgba(229, 9, 20, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(229, 9, 20, 0.3);
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    transition: all var(--transition-fast);
}

.btn-clear-filters:hover {
    background: var(--accent-primary);
    color: white;
}

/* Live TV Tabs */
.live-groups-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    overflow-x: auto;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

.live-tab-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 10px 22px;
    border-radius: var(--radius-xl);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

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

.live-tab-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(229, 9, 20, 0.4);
}

/* Modal Player Container */
.modal-player-container {
    width: 100%;
    position: relative;
    background: black;
    aspect-ratio: 16/9;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
    border-bottom: 1px solid var(--border-subtle);
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.player-close-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    transition: all var(--transition-fast);
}

.player-close-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

@media (max-width: 768px) {
    .global-filter-section {
        padding: 12px 16px;
    }
    .filter-controls {
        gap: 8px;
        overflow-x: auto;
        width: 100%;
        padding-bottom: 4px;
        justify-content: flex-start;
    }
    .filter-select-btn {
        padding: 8px 12px;
        font-size: 12px;
        white-space: nowrap;
    }
    .filter-dropdown-menu {
        right: auto;
        left: 0;
        width: 180px;
    }
}

/* Portrait layout for Reels vertical playback */
.modal-player-container.portrait-mode {
    aspect-ratio: 9/16 !important;
    max-width: 360px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
}

