/**
 * KnightFlix - Premium Streaming Platform Styles
 * Inspired by Netflix & Disney+
 * Clean, Modern, Mobile-First Design
 */

/* ========== CSS VARIABLES ========== */
:root {
    --primary: #e50914;
    --primary-hover: #f40612;
    --primary-glow: rgba(229, 9, 20, 0.4);
    
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1a1a1a;
    --bg-card: #181818;
    --bg-hover: #252525;
    
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #666666;
    
    --border-color: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
    
    --success: #46d369;
    --warning: #f5c518;
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    
    --transition-fast: 150ms ease;
    --transition: 250ms ease;
    --transition-slow: 400ms ease;
    
    --navbar-height: 68px;
    --navbar-height-mobile: 56px;
}

/* ========== RESET & BASE ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #333;
}

/* ========== TYPOGRAPHY ========== */
.font-logo {
    font-family: 'Bebas Neue', sans-serif;
}

/* ========== NAVBAR ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 4%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, transparent 100%);
    transition: background var(--transition);
}

.navbar.scrolled {
    background: var(--bg-primary);
    box-shadow: var(--shadow-md);
}

.navbar-brand {
    flex-shrink: 0;
}

.logo {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    color: var(--primary);
    letter-spacing: 2px;
    cursor: pointer;
    transition: transform var(--transition);
}

.logo:hover {
    transform: scale(1.02);
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-left: 2.5rem;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color var(--transition);
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.navbar-search {
    flex: 1;
    max-width: 280px;
    margin-left: auto;
    margin-right: 1rem;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    height: 36px;
    padding: 0 1rem 0 2.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all var(--transition);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    outline: none;
    background: var(--bg-secondary);
    border-color: var(--text-primary);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.875rem;
    pointer-events: none;
}

.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

.search-suggestions.active {
    display: block;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.suggestion-item:hover {
    background: var(--bg-hover);
}

.suggestion-poster {
    width: 40px;
    height: 60px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-tertiary);
}

.suggestion-info h4 {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.125rem;
}

.suggestion-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.navbar-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile Navbar */
@media (max-width: 768px) {
    .navbar {
        height: var(--navbar-height-mobile);
        padding: 0 1rem;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .navbar-nav {
        display: none;
    }
    
    .navbar-search {
        max-width: 180px;
        margin-right: 0.5rem;
    }
    
    .search-input {
        height: 32px;
        font-size: 0.8125rem;
    }
    
    .navbar-actions .navbar-btn:not(.mobile-show) {
        display: none;
    }
}

/* ========== MOBILE BOTTOM NAV ========== */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-muted);
    font-size: 0.625rem;
    font-weight: 500;
    transition: color var(--transition);
}

.mobile-nav-item i {
    font-size: 1.25rem;
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
    color: var(--text-primary);
}

.mobile-nav-item .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--primary);
    color: white;
    font-size: 0.5rem;
    padding: 0.125rem 0.25rem;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .mobile-nav {
        display: block;
    }
    
    body {
        padding-bottom: 60px;
    }
}

/* ========== HERO SECTION ========== */
.hero {
    position: relative;
    height: 80vh;
    min-height: 500px;
    max-height: 800px;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    z-index: 0;
    pointer-events: none;
    transition: opacity 0.6s ease-in-out;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
    pointer-events: auto;
}

.hero-backdrop {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(to right, rgba(10,10,10,0.95) 0%, rgba(10,10,10,0.4) 50%, transparent 100%),
        linear-gradient(to top, var(--bg-primary) 0%, transparent 50%);
}

.hero-content {
    position: absolute;
    bottom: 15%;
    left: 4%;
    max-width: 500px;
    z-index: 10;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--primary);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.75rem;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.8);
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.hero-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--success);
    font-weight: 700;
    font-size: 0.875rem;
}

.hero-rating i {
    font-size: 0.75rem;
}

.hero-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.hero-genres {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.hero-genre {
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
}

.hero-overview {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.hero-indicators {
    position: absolute;
    bottom: 5%;
    right: 4%;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.hero-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: all var(--transition);
}

.hero-dot.active {
    background: var(--text-primary);
    transform: scale(1.25);
}

/* Mobile Hero */
@media (max-width: 768px) {
    .hero {
        height: 70vh;
        min-height: 400px;
    }
    
    .hero-content {
        left: 1rem;
        right: 1rem;
        bottom: 12%;
        max-width: none;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-overview {
        -webkit-line-clamp: 2;
        font-size: 0.875rem;
    }
    
    .hero-indicators {
        right: 1rem;
    }
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: rgba(255,255,255,0.85);
}

.btn-secondary {
    background: rgba(109, 109, 110, 0.7);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(109, 109, 110, 0.5);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.5);
    background: rgba(0,0,0,0.5);
    color: var(--text-primary);
}

.btn-icon:hover {
    border-color: var(--text-primary);
    transform: scale(1.05);
}

.btn-icon.active {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

/* ========== CONTENT SECTIONS ========== */
.main-content {
    padding: 0 4%;
}

.section {
    margin-bottom: 2.5rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.section-link {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color var(--transition);
}

.section-link:hover {
    color: var(--text-primary);
}

/* ========== TABS ========== */
.tabs {
    display: flex;
    gap: 0.25rem;
    background: rgba(255,255,255,0.1);
    padding: 0.25rem;
    border-radius: var(--radius-md);
    width: fit-content;
}

.tab {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    background: var(--text-primary);
    color: var(--bg-primary);
}

/* ========== MEDIA GRID ========== */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

@media (min-width: 640px) {
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (min-width: 1024px) {
    .media-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* ========== MEDIA CARD ========== */
.media-card {
    position: relative;
    aspect-ratio: 2/3;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
}

.media-card:hover {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: var(--shadow-lg);
}

.media-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 60%);
    opacity: 0;
    transition: opacity var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0.75rem;
}

.media-card:hover .media-card-overlay {
    opacity: 1;
}

.media-card-title {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.media-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.6875rem;
    color: var(--text-secondary);
}

.media-card-rating {
    color: var(--success);
    font-weight: 600;
}

.media-card-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--transition);
}

.media-card:hover .media-card-play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.media-card-play i {
    color: var(--bg-primary);
    font-size: 1.25rem;
    margin-left: 3px;
}

/* ========== HORIZONTAL SLIDER ========== */
.slider-container {
    position: relative;
}

.slider {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 0.5rem 0;
}

.slider::-webkit-scrollbar {
    display: none;
}

.slider-item {
    flex: 0 0 150px;
}

@media (min-width: 640px) {
    .slider-item {
        flex: 0 0 180px;
    }
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(20,20,20,0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    z-index: 10;
    opacity: 0;
    transition: opacity var(--transition);
}

.slider-container:hover .slider-arrow {
    opacity: 1;
}

.slider-arrow:hover {
    background: rgba(40,40,40,0.9);
}

.slider-arrow.prev {
    left: 0;
}

.slider-arrow.next {
    right: 0;
}

/* ========== DETAILS PAGE ========== */
.details-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60vh;
    z-index: -1;
}

.details-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.details-backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(to top, var(--bg-primary) 0%, transparent 100%),
        linear-gradient(to right, var(--bg-primary) 0%, transparent 50%);
}

.details-container {
    padding-top: calc(var(--navbar-height) + 2rem);
    min-height: 100vh;
}

.details-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .details-container {
        padding-top: calc(var(--navbar-height-mobile) + 1rem);
    }
    
    .details-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.details-poster {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.details-poster img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

@media (max-width: 768px) {
    .details-poster {
        max-width: 200px;
        margin: 0 auto;
    }
}

.details-info h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.details-tagline {
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 1rem;
}

.details-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.details-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
}

.details-meta-item.rating {
    color: var(--success);
    font-weight: 700;
}

.details-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.details-genre {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    background: rgba(255,255,255,0.1);
    border-radius: 999px;
}

.details-overview {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.details-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.details-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.stat-item {
    background: rgba(255,255,255,0.05);
    padding: 1rem;
    border-radius: var(--radius-md);
}

.stat-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 0.9375rem;
    font-weight: 600;
}

/* ========== PLAYER SECTION ========== */
.player-section {
    margin-bottom: 2rem;
}

.player-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border: 1px solid var(--border-color);
    border-bottom: none;
}

.player-title {
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.player-live {
    background: var(--primary);
    color: white;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.player-servers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.server-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(255,255,255,0.1);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.server-btn:hover {
    background: rgba(255,255,255,0.15);
    color: var(--text-primary);
}

.server-btn.active {
    background: var(--primary);
    color: white;
}

.server-btn.error {
    opacity: 0.4;
    text-decoration: line-through;
}

.player-wrapper {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-top: none;
}

.player-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ========== SEASONS/EPISODES ========== */
.seasons-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    overflow: hidden;
}

.seasons-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.seasons-header h2 {
    font-size: 1.125rem;
}

.season-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    cursor: pointer;
}

.episodes-list {
    max-height: 400px;
    overflow-y: auto;
}

.episode-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.episode-item:last-child {
    border-bottom: none;
}

.episode-item:hover {
    background: rgba(255,255,255,0.05);
}

.episode-item.active {
    background: rgba(229, 9, 20, 0.1);
    border-left: 3px solid var(--primary);
}

.episode-num {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
}

.episode-item.active .episode-num {
    background: var(--primary);
}

.episode-info {
    flex: 1;
    min-width: 0;
}

.episode-title {
    font-weight: 500;
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.episode-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========== CONTINUE WATCHING ========== */
.continue-slider {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0.5rem 0;
}

.continue-slider::-webkit-scrollbar {
    display: none;
}

.continue-card {
    flex: 0 0 120px;
    aspect-ratio: 2/3;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: transform var(--transition), box-shadow var(--transition);
}

.continue-card:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.continue-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.continue-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0.5rem;
}

.continue-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
}

.continue-card:hover .continue-play {
    opacity: 1;
}

.continue-play i {
    color: var(--bg-primary);
    font-size: 0.875rem;
    margin-left: 2px;
}

.continue-info {
    z-index: 1;
}

.continue-title {
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.125rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.continue-meta {
    font-size: 0.5625rem;
    color: var(--text-secondary);
}

.continue-progress {
    height: 3px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    margin-top: 0.375rem;
    overflow: hidden;
}

.continue-progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
}

@media (min-width: 640px) {
    .continue-card {
        flex: 0 0 140px;
    }
    
    .continue-title {
        font-size: 0.75rem;
    }
    
    .continue-meta {
        font-size: 0.625rem;
    }
}

/* ========== CAST SECTION (Card Style) ========== */
.cast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
}

@media (min-width: 640px) {
    .cast-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

@media (min-width: 1024px) {
    .cast-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.cast-card-new {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
}

.cast-card-new:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.cast-card-img {
    aspect-ratio: 2/3;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.cast-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}

.cast-card-new:hover .cast-card-img img {
    transform: scale(1.05);
}

.cast-card-info {
    padding: 0.625rem;
}

.cast-card-name {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cast-card-role {
    font-size: 0.625rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Old cast slider (keeping for compatibility) */
.cast-slider {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0.5rem 0;
}

.cast-slider::-webkit-scrollbar {
    display: none;
}

.cast-card {
    flex: 0 0 100px;
    text-align: center;
}

.cast-card img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 0.5rem;
    background: var(--bg-tertiary);
}

.cast-name {
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cast-character {
    font-size: 0.6875rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== FOOTER ========== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 4%;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-section a {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    transition: color var(--transition);
}

.footer-section a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .footer {
        padding: 2rem 1rem 5rem;
    }
}

/* ========== MODALS ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem;
    transform: scale(0.95);
    transition: transform var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.modal-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-muted);
    transition: all var(--transition);
}

.modal-close:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

/* ========== TOAST NOTIFICATIONS ========== */
.toast-container {
    position: fixed;
    bottom: 80px;
    right: 1rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (min-width: 769px) {
    .toast-container {
        bottom: 1rem;
    }
}

.toast {
    background: var(--bg-tertiary);
    border-left: 4px solid var(--primary);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
    max-width: 320px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.info {
    border-left-color: #3b82f6;
}

.toast-message {
    font-size: 0.875rem;
}

/* ========== AD-BLOCKER MODAL ========== */
.adblocker-tab {
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.adblocker-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.adblocker-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.adblocker-platform {
    display: none;
}

.adblocker-platform.active {
    display: block;
}

/* Ad-blocker banner for player */
.player-adblocker-tip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(90deg, rgba(229, 9, 20, 0.1) 0%, transparent 100%);
    border-left: 3px solid var(--primary);
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.player-adblocker-tip i {
    color: var(--primary);
}

.player-adblocker-tip a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.player-adblocker-tip a:hover {
    text-decoration: underline;
}

/* ========== LOADING ========== */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ========== DOWNLOADS PAGE ========== */
.downloads-header {
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.downloads-title {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.downloads-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.downloads-grid {
    display: grid;
    gap: 0.5rem;
}

.download-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
}

.download-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-hover);
}

.download-item.folder {
    border-left: 3px solid var(--warning);
}

.download-item.file {
    border-left: 3px solid var(--primary);
}

.download-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius-sm);
    font-size: 1.125rem;
}

.download-item.folder .download-icon {
    color: var(--warning);
}

.download-item.file .download-icon {
    color: var(--primary);
}

.download-info {
    flex: 1;
    min-width: 0;
}

.download-name {
    font-weight: 500;
    margin-bottom: 0.125rem;
    word-break: break-word;
}

.download-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.download-actions {
    display: flex;
    gap: 0.5rem;
}

.download-action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition);
}

.download-action-btn:hover {
    background: var(--primary);
    color: white;
}

/* ========== UTILITY CLASSES ========== */
.hidden {
    display: none !important;
}

.text-primary {
    color: var(--primary);
}

.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }