/**
 * StreamFlix - Main Stylesheet
 * Modern Streaming Platform Design
 */

/* ==================== CSS Variables ==================== */
:root {
    --bg-primary: #0c1220;
    --bg-secondary: #111827;
    --bg-card: #1a2332;
    --bg-card-hover: #1e293b;
    --accent-primary: #06b6d4;
    --accent-secondary: #0891b2;
    --accent-gold: #f5c518;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --gradient-card: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.95) 100%);
    --shadow-glow: 0 0 60px rgba(6, 182, 212, 0.2);
    --shadow-card: 0 8px 32px rgba(0,0,0,0.5);
    --border-subtle: rgba(255,255,255,0.06);
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 8px;
    --border-radius-lg: 12px;
}

/* ==================== Reset & Base ==================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: clip;
    max-width: 100vw;
}

body {
    font-family: 'Rubik', 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: clip;
    max-width: 100vw;
    line-height: 1.6;
}

html {
    overflow-x: clip;
}

/* RTL Support */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .announcement-close {
    right: auto;
    left: 1rem;
}

/* RTL doesn't need row-reverse for nav-links, the dir=rtl handles it */

[dir="rtl"] .search-box {
    flex-direction: row-reverse;
}

[dir="rtl"] .user-dropdown {
    left: 0;
    right: auto;
}

[dir="rtl"] .content-card-badges {
    left: auto;
    right: 0.5rem;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* ==================== Layout ==================== */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
}

main {
    min-height: calc(100vh - 300px);
    padding-top: var(--header-height, 80px);
}

/* ==================== Header ==================== */
header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1000;
    padding: 1rem 2rem;
    background: linear-gradient(180deg, rgba(12,18,32,0.98) 0%, transparent 100%);
    transition: var(--transition-smooth);
}

header.scrolled {
    background: rgba(12,18,32,0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1600px;
    margin: 0 auto;
    gap: 2.5rem;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 0 1 auto;
    min-width: 0;
}

.logo-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.3s ease;
}
.logo-icon svg {
    width: 42px;
    height: 42px;
}
.logo-icon::after {
    display: none;
}
.logo:hover .logo-icon {
    transform: scale(1.08);
}

.logo-text {
    font-size: clamp(0.75rem, 1.1vw, 1.05rem);
    font-weight: 700;
    color: #f1f5f9;
    white-space: nowrap;
}

/* Navigation Links */
.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    position: relative;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
}

.nav-links a:hover {
    color: var(--text-primary);
    background: rgba(6, 182, 212, 0.08);
}

.nav-links a.active {
    color: var(--accent-primary);
    background: rgba(6, 182, 212, 0.12);
    font-weight: 600;
}

.nav-links a.active::after {
    display: none;
}

/* Nav Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

/* Search Box */
.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 50px;
    padding: 0.6rem 1.2rem;
    gap: 0.8rem;
    transition: var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    width: 180px;
    outline: none;
    font-family: inherit;
}

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

.search-icon {
    color: var(--text-muted);
}

/* Live Search */
.search-container {
    position: relative;
}

.live-search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    min-width: 360px;
    background: #16161e;
    border: 1px solid #2a2a3a;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    z-index: 1000;
    overflow: hidden;
}

.live-search-dropdown.open { display: block; }

.live-search-filters {
    display: flex;
    gap: 4px;
    padding: 8px 10px;
    border-bottom: 1px solid #2a2a3a;
}

.live-filter {
    padding: 4px 12px;
    background: transparent;
    border: 1px solid transparent;
    color: #aaa;
    font-size: 0.75rem;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.live-filter:hover { background: rgba(255,255,255,0.05); }
.live-filter.active { background: rgba(6, 182, 212,0.15); border-color: rgba(6, 182, 212,0.3); color: #fff; }

.live-search-results {
    max-height: 350px;
    overflow-y: auto;
}

.live-search-empty {
    padding: 2rem;
    text-align: center;
    color: #666;
    font-size: 0.85rem;
}

.live-result {
    display: flex;
    gap: 10px;
    padding: 8px 12px;
    text-decoration: none;
    color: #e5e5e5;
    transition: background 0.12s;
    align-items: center;
}

.live-result:hover { background: rgba(255,255,255,0.05); }

.live-result-poster {
    width: 40px;
    height: 56px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background: #222;
}

.live-result-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-no-poster {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.live-result-info { flex: 1; min-width: 0; text-align: right; }

.live-result-title {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-result-sub {
    font-size: 0.75rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-result-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    margin-top: 2px;
    font-size: 0.7rem;
    color: #888;
}

.live-type-badge {
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
}

.live-type-badge.movie { background: rgba(6, 182, 212,0.15); color: #06b6d4; }
.live-type-badge.tv { background: rgba(52,152,219,0.15); color: #3498db; }

.live-search-all {
    display: block;
    text-align: center;
    padding: 10px;
    color: #06b6d4;
    font-size: 0.85rem;
    text-decoration: none;
    border-top: 1px solid #2a2a3a;
    transition: background 0.12s;
}

.live-search-all:hover { background: rgba(6, 182, 212,0.05); }

/* User Menu */
.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 50px;
    padding: 0.4rem 1rem 0.4rem 0.4rem;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.user-menu-btn:hover {
    background: var(--bg-card-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius);
    min-width: 200px;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition-fast);
    box-shadow: var(--shadow-card);
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.user-dropdown a:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.user-dropdown a.admin-link {
    color: var(--accent-gold);
}

.user-dropdown a.logout-link {
    color: var(--accent-primary);
}

.user-dropdown hr {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 0.5rem 0;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 0.5rem;
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    padding: 1rem 2rem;
    z-index: 1000;
}

.mobile-menu.open {
    display: block;
}

.mobile-nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-links li {
    border-bottom: 1px solid var(--border-subtle);
}

.mobile-nav-links li:last-child {
    border-bottom: none;
}

.mobile-nav-links a {
    display: block;
    padding: 0.75rem 0;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.mobile-nav-links a:hover {
    color: var(--text-primary);
}

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.8rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), #0891b2);
    color: white;
    box-shadow: 0 2px 12px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.45);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn-outline:hover {
    background: var(--bg-card);
    border-color: var(--text-muted);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
}

.btn-gold {
    background: var(--accent-gold);
    color: #000;
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
}

/* ==================== Hero Slider ==================== */
.hero-slider {
    position: relative;
    height: 85vh;
    min-height: 600px;
    overflow: hidden;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1s ease;
}

.slide.active {
    opacity: 1;
}

.slide-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
}

.slide-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(12,18,32,0.95) 0%, rgba(12,18,32,0.7) 50%, transparent 100%);
}

.slide-bg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(0deg, var(--bg-primary) 0%, transparent 100%);
}

.slide-content {
    position: relative;
    z-index: 2;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 3rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: var(--header-height, 80px);
}

.slide-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.slide-rating {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--accent-gold);
    color: #000;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 700;
}

.slide-year,
.slide-duration,
.slide-quality {
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
}

.slide-year {
    font-size: 1.05rem;
    letter-spacing: 0.03em;
}

.slide-quality {
    background: var(--bg-card);
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.slide-title {
    font-size: clamp(2rem, 3.5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    max-width: 700px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.slide-title-en {
    font-size: clamp(1.2rem, 2vw, 2.5rem);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    max-width: 800px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.slide-title-en-inline {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

.slide-genres {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.genre-tag {
    background: rgba(255,255,255,0.1);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.slide-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.7;
    max-width: 600px;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.slide-actions {
    display: flex;
    gap: 1rem;
}

/* Slider Controls */
.slider-controls {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 2rem;
    z-index: 10;
}

.slider-nav {
    display: flex;
    gap: 1rem;
}

.slider-nav button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-nav button:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.slider-dots {
    display: flex;
    gap: 0.5rem;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    cursor: pointer;
    transition: var(--transition-fast);
}

.slider-dot.active,
.slider-dot:hover {
    background: var(--accent-primary);
}

.slider-progress {
    width: 150px;
    height: 3px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}

.slider-progress-bar {
    height: 100%;
    background: var(--accent-primary);
    width: 0%;
    transition: width 0.1s linear;
}

/* ==================== Sections ==================== */
section {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

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

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.section-link {
    color: var(--accent-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ==================== Content Cards ==================== */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.content-card {
    position: relative;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    background: var(--bg-card);
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
}

.content-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(6, 182, 212, 0.3);
    border-color: rgba(6, 182, 212, 0.2);
}

.content-card-poster {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: var(--bg-card);
    flex-shrink: 0;
    margin-bottom: -1px;
}

.content-card-poster img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% + 1px);
    object-fit: cover;
    display: block;
    transition: var(--transition-smooth);
}

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

.content-card-overlay {
    position: absolute;
    inset: 0;
    background: var(--gradient-card);
    opacity: 0;
    transition: var(--transition-fast);
}

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

.content-card-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent-primary), #0891b2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.4);
    backdrop-filter: blur(4px);
}

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

.content-card-badges {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
    display: flex;
    justify-content: space-between;
    z-index: 2;
}

.badge {
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-rating {
    background: var(--accent-gold);
    color: #000;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.badge-quality {
    background: var(--accent-primary);
    color: white;
}

.badge-new {
    background: #22c55e;
    color: white;
}

.content-card-info {
    padding: 0.65rem 0.6rem 0.5rem;
    background: var(--bg-card);
}

.content-card-title {
    font-weight: 600;
    font-size: 0.92rem;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.content-card-subtitle {
    color: var(--text-muted);
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.15rem;
    font-style: italic;
}

.content-card-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.content-card-title .title-en {
    font-weight: 400;
    font-size: 0.82em;
    color: var(--text-muted);
    opacity: 0.7;
}

/* Horizontal Scroll */
.content-scroll {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 1rem;
}

.content-scroll::-webkit-scrollbar {
    display: none;
}

.content-scroll .content-card {
    flex: 0 0 200px;
    scroll-snap-align: start;
}

/* ==================== Episode Cards ==================== */
.episode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.episode-card {
    display: flex;
    gap: 1rem;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition-fast);
}

.episode-card:hover {
    background: var(--bg-card-hover);
}

.episode-thumb {
    position: relative;
    width: 160px;
    flex-shrink: 0;
    aspect-ratio: 16/9;
}

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

.episode-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-fast);
}

.episode-card:hover .episode-play {
    opacity: 1;
}

.episode-duration {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.8);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.episode-new {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: var(--accent-primary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.episode-info {
    padding: 1rem 1rem 1rem 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.episode-show {
    color: var(--accent-primary);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.episode-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.episode-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ==================== Category Cards ==================== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.category-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: var(--transition-fast);
    cursor: pointer;
    border: 1px solid transparent;
}

.category-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    transform: translateY(-4px);
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.category-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.category-count {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ==================== Tabs ==================== */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 50px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.tab-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ==================== Content Page ==================== */
.content-hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: flex-end;
    padding: 2rem;
    margin-top: calc(var(--header-height, 80px) * -1);
    padding-top: calc(var(--header-height, 80px) + 40px);
}

.content-backdrop {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
}

.content-backdrop::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, var(--bg-primary) 0%, rgba(12,18,32,0.7) 50%, rgba(12,18,32,0.5) 100%);
}

.content-hero-inner {
    position: relative;
    z-index: 2;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    gap: 3rem;
}

.content-poster {
    flex-shrink: 0;
    width: 300px;
    aspect-ratio: 2/3;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    position: relative;
}

.content-poster img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.content-details {
    flex: 1;
}

.content-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.content-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.content-tagline {
    color: var(--text-secondary);
    font-size: 1.2rem;
    font-style: italic;
    margin-bottom: 1rem;
}

.content-genres {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.content-overview {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
    max-width: 800px;
    margin-bottom: 2rem;
}

.content-crew-line {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.content-crew-line strong {
    color: var(--text-primary);
    margin-left: 0.5rem;
}

.content-crew-line a {
    color: var(--accent-primary);
    text-decoration: none;
}

.content-crew-line a:hover {
    text-decoration: underline;
}

.content-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ==================== Subtitle Overlay System ==================== */
#subsOverlay {
    position: absolute;
    bottom: var(--subs-bottom, 8%);
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    text-align: center;
    pointer-events: none;
    z-index: 100;
}

#subsText {
    display: inline-block;
    padding: var(--subs-padding, 8px 18px);
    background: var(--subs-bg, rgba(0, 0, 0, 0.9));
    color: var(--subs-color, #fff);
    font-size: var(--subs-size, 1.6rem);
    font-weight: 500;
    border-radius: 4px;
    text-shadow: 1px 1px 3px #000, -1px -1px 3px #000;
    line-height: 1.4;
    max-width: 100%;
    direction: rtl;
}

#subsText:empty {
    display: none;
}

/* Subtitle style settings gear */
#subsStyleBtn {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 10001;
    background: rgba(0,0,0,0.7);
    border: 2px solid rgba(255,255,255,0.5);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s;
    opacity: 0;
    line-height: 1;
}
.player-wrapper:hover #subsStyleBtn,
.player-wrapper-full:hover #subsStyleBtn { opacity: 1; }
#subsStyleBtn:hover { background: rgba(0,212,255,0.8); border-color: #00d4ff; }

/* Subtitle style panel */
#subsStylePanel {
    position: absolute;
    bottom: 50px;
    left: 10px;
    z-index: 10002;
    background: rgba(15, 15, 15, 0.95);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    padding: 14px 16px;
    min-width: 240px;
    display: none;
    backdrop-filter: blur(12px);
    direction: rtl;
    pointer-events: auto;
}
#subsStylePanel.open { display: block; }
#subsStylePanel .sp-title { font-size: 0.82rem; font-weight: 600; color: #fff; margin-bottom: 10px; }
#subsStylePanel .sp-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 8px; }
#subsStylePanel .sp-label { font-size: 0.75rem; color: rgba(255,255,255,0.7); white-space: nowrap; }
#subsStylePanel input[type="range"] { flex: 1; max-width: 110px; accent-color: #06b6d4; height: 4px; }
#subsStylePanel input[type="color"] { width: 28px; height: 28px; border: 1px solid rgba(255,255,255,0.3); border-radius: 4px; padding: 1px; cursor: pointer; background: transparent; }
#subsStylePanel .sp-val { font-size: 0.7rem; color: rgba(255,255,255,0.5); min-width: 30px; text-align: center; font-family: monospace; }
#subsStylePanel .sp-reset { font-size: 0.72rem; color: #06b6d4; cursor: pointer; background: none; border: 1px solid rgba(6, 182, 212,0.3); padding: 4px 10px; border-radius: 4px; margin-top: 4px; }
#subsStylePanel .sp-reset:hover { background: rgba(6, 182, 212,0.15); }

/* Mobile responsive subtitle scaling */
@media (max-width: 768px) {
    #subsOverlay { bottom: 4%; width: 96%; }
    #subsText {
        font-size: var(--subs-size, 12px);
        padding: 4px 10px !important;
        line-height: 1.3;
    }
    #subsStyleBtn { opacity: 0.7; padding: 4px 7px; font-size: 0.9rem; }
    #subsStylePanel { min-width: 200px; padding: 10px 12px; bottom: 40px; }
}
@media (max-width: 480px) {
    #subsText {
        font-size: var(--subs-size, 12px);
        padding: 3px 8px !important;
    }
    #subsStylePanel { min-width: 180px; left: 4px; right: 4px; }
}

#subsFullscreenBtn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 10000;
    background: rgba(0,0,0,0.7);
    border: 2px solid #fff;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
    opacity: 0;
    line-height: 1;
}

/* Always show fullscreen button on touch devices (no hover) */
@media (hover: none), (pointer: coarse) {
    #subsFullscreenBtn {
        opacity: 0.8;
    }
}

.player-wrapper:hover #subsFullscreenBtn,
.player-wrapper-full:hover #subsFullscreenBtn {
    opacity: 1;
}

#subsFullscreenBtn:hover {
    background: rgba(0,212,255,0.8);
    border-color: #00d4ff;
}

/* Fullscreen styles */
.player-wrapper:fullscreen,
.player-wrapper:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    background: #000;
    border-radius: 0;
}

.player-wrapper:fullscreen iframe,
.player-wrapper:-webkit-full-screen iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block !important;
}

.player-wrapper:fullscreen #subsOverlay,
.player-wrapper:-webkit-full-screen #subsOverlay {
    bottom: 80px;
    z-index: 9999;
}

.player-wrapper:fullscreen #subsText,
.player-wrapper:-webkit-full-screen #subsText {
    font-size: var(--subs-size-fs, 2.4rem);
    padding: 12px 28px;
}

.player-wrapper:fullscreen #subsStyleBtn,
.player-wrapper:-webkit-full-screen #subsStyleBtn {
    bottom: 20px;
    left: 20px;
    opacity: 0;
    z-index: 10001;
}
.player-wrapper:fullscreen:hover #subsStyleBtn,
.player-wrapper:-webkit-full-screen:hover #subsStyleBtn { opacity: 1; }

.player-wrapper:fullscreen #subsStylePanel,
.player-wrapper:-webkit-full-screen #subsStylePanel {
    bottom: 60px;
    left: 20px;
}

.player-wrapper:fullscreen #subsFullscreenBtn,
.player-wrapper:-webkit-full-screen #subsFullscreenBtn {
    bottom: 20px;
    right: 20px;
    opacity: 0;
    z-index: 10000;
}

/* iOS fake fullscreen (position:fixed since iOS doesn't support div.requestFullscreen) */
.player-wrapper.ios-fullscreen,
.player-wrapper-full.ios-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    background: #000 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.player-wrapper.ios-fullscreen iframe,
.player-wrapper-full.ios-fullscreen iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block !important;
}

.player-wrapper.ios-fullscreen #subsOverlay,
.player-wrapper-full.ios-fullscreen #subsOverlay {
    bottom: 80px;
    z-index: 9999;
}

.player-wrapper.ios-fullscreen #subsText,
.player-wrapper-full.ios-fullscreen #subsText {
    font-size: var(--subs-size-fs, 2.4rem);
    padding: 12px 28px;
}

.player-wrapper.ios-fullscreen #subsStyleBtn,
.player-wrapper-full.ios-fullscreen #subsStyleBtn {
    bottom: 20px;
    left: 20px;
    opacity: 0;
    z-index: 10001;
}
.player-wrapper.ios-fullscreen:hover #subsStyleBtn,
.player-wrapper.ios-fullscreen #subsStyleBtn:focus,
.player-wrapper-full.ios-fullscreen:hover #subsStyleBtn,
.player-wrapper-full.ios-fullscreen #subsStyleBtn:focus { opacity: 1; }

.player-wrapper.ios-fullscreen #subsStylePanel,
.player-wrapper-full.ios-fullscreen #subsStylePanel {
    bottom: 60px;
    left: 20px;
}

.player-wrapper.ios-fullscreen #subsFullscreenBtn,
.player-wrapper-full.ios-fullscreen #subsFullscreenBtn {
    bottom: 20px;
    right: 20px;
    opacity: 1;
    z-index: 10000;
}

.player-wrapper:fullscreen:hover #subsFullscreenBtn,
.player-wrapper:-webkit-full-screen:hover #subsFullscreenBtn {
    opacity: 1;
}

.player-wrapper:fullscreen .player-placeholder,
.player-wrapper:-webkit-full-screen .player-placeholder {
    display: none;
}

/* Subtitle Selector Dropdown */
.subs-selector {
    display: flex;
    align-items: center;
}

.subs-selector select {
    padding: 0.3rem 0.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.75rem;
    max-width: 220px;
    cursor: pointer;
}

.subs-selector select:hover {
    border-color: var(--primary);
}

/* Subtitle version picker - redesigned */
.subs-version-picker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: 8px;
    padding: 6px 12px;
}

.subs-version-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
    font-weight: 500;
}

.subs-select-wrap {
    position: relative;
}

.subs-select-wrap select {
    appearance: none;
    -webkit-appearance: none;
    padding: 6px 32px 6px 12px;
    background: var(--bg-primary);
    border: 1px solid rgba(6, 182, 212, 0.4);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.82rem;
    min-width: 180px;
    max-width: 300px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.subs-select-wrap select:hover,
.subs-select-wrap select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.15);
    outline: none;
}

.subs-select-wrap::after {
    content: '▾';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    pointer-events: none;
    font-size: 0.85rem;
}

.subs-hint {
    font-size: 0.78rem;
    color: #f0c040;
    background: rgba(240, 192, 64, 0.1);
    border: 1px solid rgba(240, 192, 64, 0.25);
    border-radius: 6px;
    padding: 4px 10px;
    white-space: normal;
    animation: subsHintPulse 3s ease-in-out 1;
}

@keyframes subsHintPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; border-color: rgba(240, 192, 64, 0.6); }
}

.placeholder-subs-msg {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    margin-top: 12px;
    padding: 6px 16px;
    background: rgba(6, 182, 212,0.15);
    border-radius: 20px;
    border: 1px solid rgba(6, 182, 212,0.3);
}

/* Subtitle Controls */
.subs-controls {

    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 0 0 8px 8px;
    margin-top: -8px;
    flex-wrap: wrap;
}

.subs-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.subs-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff4444;
    transition: all 0.3s;
}

.subs-dot.active {
    background: #00ff88;
    box-shadow: 0 0 10px #00ff88;
}

.subs-time {
    font-family: 'Consolas', monospace;
    font-size: 1rem;
    background: #111;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #333;
    min-width: 100px;
    text-align: center;
    color: #0f0;
}

.subs-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-right: auto;
}

.subs-sync-btns {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.subs-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
    line-height: 1.4;
}

.subs-btn:hover {
    background: rgba(6, 182, 212,0.5);
}

.subs-offset-display {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    min-width: 35px;
    text-align: center;
    font-family: monospace;
}

.subs-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
}

.subs-toggle input {
    width: 16px;
    height: 16px;
}

.subs-offset {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
}

.subs-offset label {
    color: var(--text-muted);
    margin-left: 0.25rem;
}

.subs-offset button {
    padding: 0.2rem 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
}

.subs-offset button:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.subs-offset input[type="number"] {
    width: 50px;
    padding: 0.2rem 0.4rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-primary);
    text-align: center;
    font-size: 0.8rem;
}

.subs-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    background: rgba(0, 212, 255, 0.05);
    border-radius: 0 0 8px 8px;
    margin-top: -8px;
}

.subs-help strong {
    color: var(--text-secondary);
}

/* Delay toggle button */
.delay-off {
    background: rgba(255, 68, 68, 0.2) !important;
    border-color: #ff4444 !important;
    color: #ff6666 !important;
    font-weight: 600;
    min-width: 55px;
}

.delay-on {
    background: rgba(0, 255, 136, 0.2) !important;
    border-color: #00ff88 !important;
    color: #00ff88 !important;
    font-weight: 600;
    min-width: 55px;
}

/* ==================== Player Section ==================== */
.player-section {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

.player-container {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    position: relative;
}

.player-container.redirect-mode {
    background: var(--bg-card);
    padding: 1.5rem;
}

.player-container > .player-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: var(--bg-secondary);
}

.player-placeholder-icon {
    width: 80px;
    height: 80px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.player-placeholder-icon:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-glow);
}

.player-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.server-list {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.server-btn {
    padding: 0.6rem 1.2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.server-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.server-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* ==================== Cast Section ==================== */
.cast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
}

.cast-scroll {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-snap-type: x mandatory;
    direction: rtl;
}

.cast-scroll .cast-hidden {
    display: none;
}

.cast-scroll.show-all {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    overflow-x: visible;
    direction: rtl;
    gap: 1.5rem;
    padding-bottom: 1rem;
}

.cast-scroll.show-all .cast-card {
    width: auto;
    flex-shrink: 1;
}

.cast-scroll.show-all .cast-photo {
    width: 90px;
    height: 90px;
}

.cast-scroll.show-all .cast-hidden {
    display: block;
}

.cast-scroll.show-all .cast-name,
.cast-scroll.show-all .cast-role {
    white-space: normal;
    word-wrap: break-word;
    overflow: visible;
    text-overflow: clip;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cast-scroll::-webkit-scrollbar {
    height: 6px;
}

.cast-scroll::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.cast-scroll::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 3px;
}

.cast-card {
    text-align: center;
    flex-shrink: 0;
    width: 130px;
    scroll-snap-align: start;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
    direction: ltr;
}

.cast-card:hover {
    transform: translateY(-4px);
}

.cast-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 0.75rem;
    background: var(--bg-card);
    border: 3px solid var(--border-subtle);
    transition: border-color 0.2s;
}

.cast-card:hover .cast-photo {
    border-color: var(--accent-primary);
}

.cast-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cast-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.cast-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cast-role {
    color: var(--text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Cast Show More */
.cast-container {
    position: relative;
}

.cast-show-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    width: fit-content;
}

.cast-show-more:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

/* ==================== Seasons & Episodes ==================== */
.season-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.season-tab {
    padding: 0.6rem 1.2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.season-tab:hover {
    background: var(--bg-card-hover);
}

.season-tab.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.episodes-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.episode-item {
    display: flex;
    gap: 1.5rem;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition-fast);
}

.episode-item:hover {
    background: var(--bg-card-hover);
}

.episode-item-thumb {
    position: relative;
    width: 200px;
    flex-shrink: 0;
    aspect-ratio: 16/9;
}

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

.episode-item-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.episode-item-content {
    padding: 1.5rem 1.5rem 1.5rem 0;
    flex: 1;
}

.episode-item-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.episode-item-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.episode-item-runtime {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.episode-item-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.episode-item-overview {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==================== Comments ==================== */
.comments-section {
    padding: 2rem 3rem;
    max-width: 1600px;
    margin: 0 auto;
}

.comment-form {
    margin-bottom: 2rem;
}

.comment-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    margin-bottom: 1rem;
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.comment-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comment-options {
    display: flex;
    gap: 1rem;
}

.comment-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.comment-option input[type="checkbox"] {
    accent-color: var(--accent-primary);
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment-wrapper {
    margin-bottom: 1.5rem;
}

.comment-wrapper.comment-admin .comment {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 12px;
    padding: 1rem;
}

.comment-wrapper.comment-mod .comment {
    background: rgba(52, 152, 219, 0.1);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 12px;
    padding: 1rem;
}

.comment {
    display: flex;
    gap: 1rem;
}

.comment-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: 600;
}

.comment-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.comment-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--accent-gold);
    font-size: 0.85rem;
}

.comment-text {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

/* Legacy spoiler placeholder - handled by .comment-wrapper.spoiler */

.comment-actions {
    display: flex;
    gap: 1rem;
}

.comment-action {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
    background: none;
    border: none;
}

.comment-action:hover {
    color: var(--text-primary);
}

.comment-action.liked {
    color: var(--accent-primary);
}

.comment-replies {
    margin-top: 1.5rem;
    margin-right: 3rem;
    border-right: 2px solid var(--border-subtle);
    padding-right: 1.5rem;
}

/* Limit nesting depth - after 3 levels, stop indenting */
.comment-replies .comment-replies .comment-replies .comment-replies {
    margin-right: 0;
    border-right: none;
    padding-right: 0;
}

/* Style for deeply nested comments */
.comment-replies .comment-replies .comment-replies .comment-replies .comment {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
}

/* Avatar Initial (fallback when no image) */
.avatar-initial {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Role Badges */
.role-badge {
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.admin-badge {
    background: var(--accent-primary);
    color: white;
}

.mod-badge {
    background: #3498db;
    color: white;
}

.vip-badge {
    background: rgba(241, 196, 15, 0.15);
    color: var(--vip-color, #f1c40f);
    border: 1px solid rgba(241, 196, 15, 0.3);
}

.group-badge {
    background: rgba(153, 153, 153, 0.12);
    color: var(--group-color, #999);
    border: 1px solid rgba(153, 153, 153, 0.25);
}

.comment-wrapper.comment-vip .comment {
    background: rgba(241, 196, 15, 0.06);
    border: 1px solid rgba(241, 196, 15, 0.2);
    border-radius: 12px;
    padding: 1rem;
}

.comment-wrapper.comment-vip .comment-author {
    color: #f1c40f;
}

.vip-crown {
    margin-inline-end: 2px;
    font-size: 0.85em;
}

/* Comment Like Button */
.comment-like {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 0.9rem;
}

.comment-like:hover {
    color: var(--accent-primary);
}

.comment-like.liked {
    color: var(--accent-primary);
}

.comment-like .like-icon {
    font-size: 1rem;
}

/* Comment Form Improvements */
.comment-form-inner {
    display: flex;
    gap: 1rem;
}

.comment-form-inner .comment-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.comment-input-wrapper {
    flex: 1;
}

/* Guest name input */
.comment-form input[name="guest_name"] {
    padding: 0.55rem 0.75rem;
    background: var(--bg-card, #1a1a2e);
    border: 1px solid var(--border-subtle, #2a2a3e);
    border-radius: 8px;
    color: var(--text-primary, #e5e5e5);
    font-size: 0.85rem;
    font-family: inherit;
    margin-bottom: 0.5rem;
    width: 100%;
    transition: border-color 0.2s;
}

.comment-form input[name="guest_name"]:focus {
    outline: none;
    border-color: var(--accent-primary, #06b6d4);
}

.comment-form input[name="guest_name"]::placeholder {
    color: var(--text-muted, #666);
}

/* Rate-limit / cooldown notice */
.comment-cooldown-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    margin-bottom: 0.6rem;
    background: rgba(243, 156, 18, 0.1);
    border: 1px solid rgba(243, 156, 18, 0.25);
    border-radius: 8px;
    color: #f0c040;
    font-size: 0.82rem;
    line-height: 1.4;
    animation: cooldownSlideIn 0.25s ease;
}

.comment-cooldown-notice .cooldown-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

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

.spoiler-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
    user-select: none;
}

.spoiler-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.spoiler-toggle input[type="checkbox"]:checked + span {
    color: var(--warning);
}

/* Spoiler Badge - Beautiful */
.spoiler-badge {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 6px rgba(243, 156, 18, 0.3);
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

/* Comment Delete Button */
.comment-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.25rem;
    opacity: 0.5;
    transition: opacity 0.2s;
    margin-right: auto;
}

.comment-delete-btn:hover {
    opacity: 1;
}

/* Spoiler comment blur effect - on wrapper level */
.comment-wrapper.spoiler .comment-text {
    position: relative;
    cursor: pointer;
    user-select: none;
    min-height: 2.2rem;
    overflow: hidden;
}

.comment-wrapper.spoiler .comment-text .comment-text-inner {
    filter: blur(8px);
    -webkit-filter: blur(8px);
    opacity: 0.4;
    transition: filter 0.3s ease, opacity 0.3s ease;
    display: block;
}

.comment-wrapper.spoiler .comment-text::after {
    content: '🔒 העבר עכבר לחשיפה';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(30, 30, 50, 0.85);
    border: 1px solid rgba(243, 156, 18, 0.35);
    color: #f39c12;
    padding: 0.3rem 0.75rem;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    z-index: 2;
    pointer-events: none;
}

.comment-wrapper.spoiler:hover .comment-text .comment-text-inner,
.comment-wrapper.spoiler.revealed .comment-text .comment-text-inner {
    filter: none;
    -webkit-filter: none;
    opacity: 1;
}

.comment-wrapper.spoiler:hover .comment-text,
.comment-wrapper.spoiler.revealed .comment-text {
    cursor: default;
    user-select: auto;
    overflow: visible;
}

.comment-wrapper.spoiler:hover .comment-text::after,
.comment-wrapper.spoiler.revealed .comment-text::after {
    display: none;
}

/* Comment Pinned Badge */
.comment-pinned {
    background: var(--accent-primary);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Comment Like Button */
.comment-like {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.comment-like:hover {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent-primary);
}

.comment-like.liked {
    color: var(--accent-primary);
}

.comment-like .like-icon {
    font-size: 1rem;
}

/* Comment Reply Button */
.comment-reply-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.comment-reply-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Episode Thumb Placeholder */
.episode-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    min-height: 150px;
}

/* ==================== Forms ==================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-error {
    color: var(--accent-primary);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.form-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* ==================== Auth Pages ==================== */
.auth-page {
    min-height: 100vh;
}

.auth-page main {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 300px);
    padding: 2rem;
}

.auth-page .site-footer {
    margin-top: 0;
}

.auth-section {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 2rem;
}

.auth-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-card);
    margin: 0 auto;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.auth-logo .logo-icon {
    width: 40px;
    height: 40px;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-form .form-group {
    margin-bottom: 1.25rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.auth-form .input-with-icon {
    position: relative;
}

.auth-form .input-with-icon svg {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.auth-form .input-with-icon input {
    width: 100%;
    padding: 0.875rem 1rem;
    padding-right: 3rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-form .input-with-icon input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.auth-form .input-with-icon input::placeholder {
    color: var(--text-muted);
}

.auth-form .password-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.375rem;
}

.auth-form .form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.auth-form .form-check input[type="checkbox"] {
    margin-top: 0.125rem;
}

.auth-form .form-check label {
    margin: 0;
    font-weight: 400;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-form .form-check a {
    color: var(--accent-primary);
}

.auth-form .btn-primary {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 600;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-secondary);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
}

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

/* ==================== Alerts ==================== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin: 1rem 3rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

/* ==================== Announcements ==================== */
.announcement {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    position: relative;
    z-index: 1001;
}

.announcement-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.announcement-info { background: #1e40af; }
.announcement-warning { background: #b45309; }
.announcement-success { background: #15803d; }
.announcement-error { background: #b91c1c; }

.announcement-dot,
.blinking-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.announcement-text,
.announcement-message {
    font-weight: 500;
    font-size: 0.9rem;
}

.announcement-close,
.announcement-dismiss {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: white;
    opacity: 0.7;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    font-size: 1.25rem;
}

[dir="rtl"] .announcement-close,
[dir="rtl"] .announcement-dismiss {
    right: auto;
    left: 1rem;
}

.announcement-close:hover,
.announcement-dismiss:hover {
    opacity: 1;
}

/* Under-slider announcements */
.under-slider-announcements {
    max-width: 1400px;
    margin: 1rem auto;
    padding: 0 2rem;
}

.under-slider-announcements .announcement {
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

/* Adjust body when announcement is present */
body.has-announcement {
    padding-top: 40px;
}

body.has-announcement header {
    top: 40px;
}

body.has-announcement .main-content {
    padding-top: 120px;
}

/* ==================== Pagination ==================== */
/* ==================== Infinite Scroll ==================== */

/* Card fade-in animation for lazy loading */
.listing-page .content-card {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.listing-page .content-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Page section divider */
.infinite-page-section {
    display: contents;
}

.infinite-page-divider {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0 0.3rem;
}

.infinite-page-divider::before,
.infinite-page-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border, #2a2a3e);
}

.infinite-page-divider span {
    font-size: 0.72rem;
    color: var(--text-muted, #888);
    white-space: nowrap;
    font-weight: 500;
}

/* Loading spinner */
.infinite-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1.5rem;
    color: var(--text-muted, #888);
    font-size: 0.82rem;
}

.infinite-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border, #333);
    border-top-color: var(--accent-primary, #06b6d4);
    border-radius: 50%;
    animation: infSpin 0.7s linear infinite;
}

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

/* Sticky page navigation bar */
.page-nav-sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background: var(--bg-card, #1a1a2e);
    border-top: 1px solid var(--border, #2a2a3e);
    padding: 0.45rem 1rem;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
}

.page-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.page-nav-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border, #333);
    color: var(--text-primary, #e5e5e5);
    border-radius: 6px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}

.page-nav-btn:hover:not(:disabled) {
    background: var(--accent-primary, #06b6d4);
    border-color: var(--accent-primary, #06b6d4);
}

.page-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-nav-info {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted, #aaa);
}

.page-nav-select {
    background: #1a1a2e;
    border: 1px solid var(--border, #333);
    color: var(--text-primary, #e5e5e5);
    border-radius: 4px;
    padding: 0.25rem 0.4rem;
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    min-width: 48px;
    text-align: center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M5 6L0 0h10z' fill='%23888'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 6px center;
    padding-left: 20px;
    padding-right: 8px;
}

.page-nav-select option {
    background: #1a1a2e;
    color: #e5e5e5;
}

.page-nav-select:focus {
    outline: none;
    border-color: var(--accent-primary, #06b6d4);
}

/* Add bottom padding to listing page so content isn't hidden behind sticky nav */
.listing-page .content-listing {
    padding-bottom: 60px;
}

@media (max-width: 480px) {
    .page-nav-sticky {
        padding: 0.35rem 0.5rem;
    }
    .page-nav-btn {
        width: 30px;
        height: 30px;
    }
    .page-nav-info {
        font-size: 0.72rem;
    }
    .page-nav-select {
        font-size: 0.72rem;
        min-width: 40px;
    }
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.pagination-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.pagination-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

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

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-numbers a,
.pagination-numbers .current {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-secondary);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition-fast);
}

.pagination-numbers a:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.pagination-numbers .current {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.pagination-numbers .ellipsis {
    padding: 0 0.5rem;
    color: var(--text-muted);
}

.pagination .prev,
.pagination .next {
    padding: 0 1rem;
    gap: 0.5rem;
}

/* ==================== Footer ==================== */
footer {
    background: linear-gradient(180deg, #0f1726 0%, #0a1018 100%);
    border-top: 2px solid;
    border-image: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.4), transparent) 1;
    padding: 3rem 2rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand p {
    color: var(--text-secondary);
    margin-top: 1rem;
    max-width: 300px;
}

.footer-brand .logo-text {
    font-size: clamp(0.75rem, 1.1vw, 1.05rem);
}

.footer-links h4 {
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
}

.footer-bottom p {
    color: var(--text-muted);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 50%;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.social-link:hover {
    background: var(--accent-primary);
    color: white;
}

/* ==================== 404 Page ==================== */
.error-page .main-content {
    min-height: calc(100vh - 300px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.error-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    flex: 1;
}

.error-content {
    max-width: 500px;
}

.error-icon {
    margin-bottom: 2rem;
    color: var(--text-muted);
}

.error-code {
    font-size: 8rem;
    font-weight: 900;
    color: var(--accent-primary);
    line-height: 1;
    margin-bottom: 1rem;
}

.error-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.error-message {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 500px;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ==================== Loading ==================== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

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

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

/* ==================== Responsive ==================== */
@media (max-width: 1200px) {
    .slide-title {
        font-size: 3rem;
    }
    
    .content-hero-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .content-poster {
        width: 250px;
    }
    
    .content-meta,
    .content-genres,
    .content-actions {
        justify-content: center;
    }
    
    .report-btn-label {
        display: none;
    }
}

@media (max-width: 992px) {
    header {
        padding: 1rem 1.5rem;
        background: rgba(12,18,32,0.98);
    }
    
    nav {
        gap: 0.75rem;
    }
    
    .logo {
        flex: 1 1 0;
        min-width: 0;
    }
    
    .logo-text {
        white-space: normal;
        line-height: 1.2;
    }
    
    .nav-actions {
        flex-shrink: 0;
    }
    
    .nav-links {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    section {
        padding: 2rem 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-slider {
        height: 70vh;
    }
    
    .slide-content {
        padding: 0 1.5rem;
    }
    
    .slide-title {
        font-size: 2.5rem;
    }
    
    .slide-title-en {
        font-size: 1.75rem;
    }
    
    .content-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .search-box {
        display: none;
    }
    
    .btn:not(.btn-sm) {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .hero-slider {
        height: 60vh;
        min-height: 500px;
    }
    
    .slide-title {
        font-size: 2rem;
    }
    
    .slide-title-en {
        font-size: 1.5rem;
    }
    
    .slider-controls {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
        bottom: 0.75rem;
        padding: 0 0.5rem;
    }
    
    .slider-nav {
        display: none;
    }
    
    .slider-dots {
        gap: 0.35rem;
    }
    
    .slider-dot {
        width: 8px;
        height: 8px;
    }
    
    .slider-progress {
        width: 100px;
    }
    
    .slide-actions {
        margin-bottom: 3.5rem;
    }
    
    .slide-actions .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .slide-description {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .content-hero {
        min-height: auto;
        padding: calc(var(--header-height, 80px) + 16px) 1.5rem 2rem;
    }
    
    .content-poster {
        width: 180px;
    }
    
    .episode-item {
        flex-direction: column;
    }
    
    .episode-item-thumb {
        width: 100%;
    }
    
    .episode-item-content {
        padding: 1rem;
    }
    
    .comment-replies {
        margin-left: 1.5rem;
    }
}

@media (max-width: 576px) {
    .logo {
        flex-direction: row;
        align-items: center;
    }
    
    .logo-text {
        font-size: 0.85rem;
    }
    
    .logo-icon {
        width: 34px;
        height: 34px;
        min-width: 34px;
    }
    
    .nav-actions > a.btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.75rem 1rem;
        background: rgba(12,18,32,0.98);
    }
    
    .logo-text {
        font-size: 0.75rem;
    }
    
    .logo-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }
    .logo-icon::after {
        border-width: 5px 0 5px 9px;
    }
    
    .nav-actions {
        gap: 0.5rem;
    }
    
    .nav-actions > .btn {
        padding: 0.35rem 0.55rem;
        font-size: 0.72rem;
    }
    
    .user-name {
        display: none;
    }
    
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .content-scroll .content-card {
        flex: 0 0 150px;
    }
    
    .auth-card {
        padding: 2rem 1.5rem;
    }
    
    .slide-title {
        font-size: 1.5rem;
    }
    
    .slide-title-en {
        font-size: 1.2rem;
    }
    
    .slider-progress {
        width: 50px;
    }
    
    .slider-controls {
        padding: 0 0.5rem;
        bottom: 0.5rem;
    }
    
    .slide-actions {
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 3rem;
    }
    
    .slide-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==================== Report Issue ==================== */
.report-issue {
    margin-top: 2rem;
    text-align: right;
}

[dir="rtl"] .report-issue {
    text-align: left;
}

.report-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.875rem;
    transition: var(--transition-fast);
}

.report-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

/* ==================== Modal ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-card);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

.report-form .form-group {
    margin-bottom: 1rem;
}

.report-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.report-form select,
.report-form textarea {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.report-form select:focus,
.report-form textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.report-form textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

[dir="rtl"] .form-actions {
    justify-content: flex-start;
}

/* ==================== Watchlist & History Pages ==================== */
.watchlist-page,
.history-page {
    padding: 2rem 3rem;
    max-width: 1600px;
    margin: 0 auto;
}

.watchlist-page .page-header,
.history-page .page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.watchlist-page .page-header h1,
.history-page .page-header h1 {
    font-size: 2rem;
    font-weight: 700;
}

.watchlist-page .subtitle,
.history-page .subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.filter-bar,
.type-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

/* ==================== Listing Page Filters ==================== */
.listing-page .page-header {
    padding: 3rem 2rem 2rem;
    text-align: right;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, transparent 100%);
}

.listing-page .page-header .page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.listing-page .page-header .page-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.filters-section {
    padding: 0 2rem 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

.filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 180px;
    flex: 1;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-group select {
    padding: 0.75rem 1rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 35px;
}

.filter-group select:hover,
.filter-group select:focus {
    border-color: var(--accent-primary);
    outline: none;
}

.filter-group select option {
    background: #1a1a2e;
    color: #ffffff;
    padding: 10px;
}

.filter-group select optgroup {
    background: #1a1a2e;
    color: #ffffff;
}

@media (max-width: 768px) {
    .filters-form {
        flex-direction: column;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .listing-page .page-header .page-title {
        font-size: 1.75rem;
    }
}

.type-tab {
    padding: 0.5rem 1.25rem;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.type-tab:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.type-tab.active {
    background: var(--accent-primary);
    color: white;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state .empty-icon {
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 1rem;
}

.empty-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-date {
    font-size: 0.875rem;
    color: var(--text-muted);
    padding: 0.75rem 0;
    margin-top: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.history-date:first-child {
    margin-top: 0;
}

.history-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
}

.history-item:hover {
    background: var(--bg-card-hover);
}

.history-item-poster {
    width: 80px;
    flex-shrink: 0;
}

.history-item-poster img {
    width: 100%;
    border-radius: 4px;
}

.history-item-content {
    flex: 1;
    min-width: 0;
}

.history-item-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.history-item-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.clear-form {
    margin-right: auto;
}

[dir="rtl"] .clear-form {
    margin-right: 0;
    margin-left: auto;
}

/* ==================== Search Page ==================== */
.search-header {
    padding: 3rem 0;
    text-align: center;
}

.search-header .page-title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.search-form-large {
    display: flex;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.search-input-wrapper {
    flex: 1;
    min-width: 280px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper .search-icon {
    position: absolute;
    right: 1rem;
    color: var(--text-muted);
    pointer-events: none;
}

[dir="ltr"] .search-input-wrapper .search-icon {
    left: 1rem;
    right: auto;
}

.search-input-wrapper input {
    width: 100%;
    padding: 1rem 3rem;
    background: var(--bg-card);
    border: 2px solid var(--border-subtle);
    border-radius: var(--border-radius-lg);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-card-hover);
}

.search-input-wrapper .clear-search {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    padding: 0.25rem;
    opacity: 0.7;
    transition: var(--transition-fast);
}

[dir="ltr"] .search-input-wrapper .clear-search {
    right: 1rem;
    left: auto;
}

.search-input-wrapper .clear-search:hover {
    opacity: 1;
    color: var(--text-primary);
}

.search-filters {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 0.5rem 1.25rem;
    background: var(--bg-card);
    border-radius: 50px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.filter-chip:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.filter-chip.active {
    background: var(--accent-primary);
    color: white;
}

.search-results {
    padding: 2rem 3rem;
    max-width: 1600px;
    margin: 0 auto;
}

.results-count {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.search-suggestions {
    padding: 2rem 3rem;
    text-align: center;
}

.search-suggestions h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.suggestion-tags {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.suggestion-tag {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.suggestion-tag:hover {
    background: var(--accent-primary);
    color: white;
}

/* ==================== Content Scroll Fix ==================== */
.content-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 1rem;
    margin-right: -3rem;
    padding-right: 3rem;
}

[dir="rtl"] .content-scroll {
    margin-right: 0;
    margin-left: -3rem;
    padding-right: 0;
    padding-left: 3rem;
}

/* ==================== Profile Page ==================== */
.profile-page {
    padding: 2rem 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar .avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
}

.profile-info h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.profile-info .username {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.profile-info .member-since {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.profile-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    border: none;
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.tab-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent-primary);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.settings-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
}

.settings-card h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.profile-form .form-group {
    margin-bottom: 1.5rem;
}

.profile-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.profile-form input,
.profile-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.profile-form input:focus,
.profile-form textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== Title English Subtitle ==================== */
.content-card-title .title-en {
    font-size: 0.85em;
    color: inherit;
    opacity: 0.85;
    font-weight: 400;
}

.content-title .title-en {
    font-size: 0.7em;
    color: inherit;
    opacity: 0.9;
}

/* ==================== Server Tabs Enhancements ==================== */
.server-tab.highlighted {
    background: linear-gradient(135deg, var(--accent-primary), #818cf8) !important;
    color: white !important;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
}

.server-tab.highlighted:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.5);
}

a.server-tab {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.redirect-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    color: var(--text-muted);
    text-align: center;
}

.redirect-notice svg {
    color: var(--accent-primary);
}

.server-quality {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    margin-right: 6px;
}

/* ==================== Rating Stars ==================== */
.user-rating-section {
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: 12px;
}

.rating-stars {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.rating-star {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
}

.rating-star:hover,
.rating-star.hover {
    color: #ffc107;
    transform: scale(1.1);
}

.rating-star.active {
    color: #ffc107;
}

.rating-star svg {
    transition: fill 0.15s;
}

.rating-value {
    margin-right: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==================== Details Grid Improved ==================== */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-weight: 500;
    color: var(--text-primary);
}

.detail-value a {
    color: var(--accent-primary);
    text-decoration: none;
}

.detail-value a:hover {
    text-decoration: underline;
}

/* ==================== Server Buttons for Redirect Mode ==================== */
.servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
}

.server-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    background: var(--bg-card);
    border: 2px solid var(--border-subtle);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
    text-align: center;
}

.server-btn:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

.server-btn.highlighted {
    background: linear-gradient(135deg, var(--accent-primary), #818cf8);
    border-color: transparent;
    color: white;
}

.server-btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.server-btn.highlighted .server-btn-icon {
    background: rgba(255,255,255,0.2);
}

.server-btn-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.server-btn-quality {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    color: var(--text-muted);
}

.server-btn.highlighted .server-btn-quality {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* External link icon */
.server-btn-external {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.server-btn.highlighted .server-btn-external {
    color: rgba(255,255,255,0.8);
}

/* ==================== Improved Details Section ==================== */
.details-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 1rem;
    font-weight: 500;
}

.detail-value.rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--warning);
}

.detail-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.external-link {
    opacity: 0.7;
    transition: opacity 0.2s;
}

.external-link:hover {
    opacity: 1;
}

/* ==================== Improved Rating Section ==================== */
.user-rating-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.rating-prompt {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.rating-input {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.rating-star {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--text-muted);
    transition: all 0.15s ease;
}

.rating-star:hover,
.rating-star.active {
    color: var(--warning);
    transform: scale(1.1);
}

.rating-star svg {
    display: block;
}

.rating-display {
    margin-top: 1rem;
    font-size: 0.95rem;
}

.your-rating {
    color: var(--warning);
}

.no-rating {
    color: var(--text-muted);
}

/* ==================== Cast Scroll Improvements ==================== */
.cast-scroll {
    display: flex !important;
    flex-direction: row !important;
    gap: 1.25rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-snap-type: x mandatory;
}

.cast-scroll.expanded {
    flex-wrap: wrap;
    overflow-x: visible;
}

/* ==================== Server Buttons Grid ==================== */
.servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.server-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.server-button:hover {
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
    transform: translateY(-2px);
}

.server-button.highlighted {
    background: linear-gradient(135deg, var(--accent-primary), #818cf8);
    border-color: transparent;
    color: white;
}

.server-button.highlighted:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.server-button .server-icon {
    width: 24px;
    height: 24px;
}

.server-button .server-name {
    flex: 1;
}

.server-button .server-quality {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

/* ==================== User Rating Card ==================== */
.user-rating-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.rating-prompt {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.rating-input {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.rating-display {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.rating-display .your-rating {
    color: #ffc107;
}

.rating-display .your-rating strong {
    color: var(--text-primary);
}

/* ==================== Server Buttons (Redirect Mode) ==================== */
.servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.server-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.server-btn:hover {
    border-color: var(--accent-primary);
    background: rgba(6, 182, 212, 0.1);
    transform: translateY(-2px);
}

.server-btn.highlighted {
    background: linear-gradient(135deg, var(--accent-primary), #818cf8);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.server-btn.highlighted:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.server-btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
}

.server-btn-name {
    flex: 1;
    font-size: 1rem;
}

.server-btn-quality {
    font-size: 0.7rem;
    padding: 3px 8px;
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
    text-transform: uppercase;
}

.server-btn-external {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .servers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .server-btn {
        flex-direction: row;
        padding: 0.6rem 0.7rem;
        gap: 0.5rem;
        border-radius: 8px;
        border-width: 1px;
    }
    
    .server-btn-icon {
        width: 28px;
        height: 28px;
        min-width: 28px;
    }
    
    .server-btn-icon svg {
        width: 14px;
        height: 14px;
    }
    
    .server-btn-name {
        font-size: 0.8rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .server-btn-quality {
        display: none;
    }
    
    .server-btn-external {
        display: none;
    }
    
    .server-btn-note {
        display: none;
    }
}

@media (max-width: 480px) {
    .servers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
        padding: 0.5rem;
    }
    
    .server-btn {
        padding: 0.5rem 0.6rem;
    }
    
    .server-btn-name {
        font-size: 0.75rem;
    }
}

/* ==================== Cast Grid Layout ==================== */
.cast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 1.25rem;
}

.cast-card {
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
}

.cast-card:hover {
    transform: translateY(-4px);
}

.cast-card.hidden-cast {
    display: none;
}

.cast-section.show-all .cast-card.hidden-cast {
    display: block;
}

.cast-photo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 0.75rem;
    background: var(--bg-card);
    border: 3px solid var(--border-subtle);
    transition: border-color 0.2s;
}

.cast-card:hover .cast-photo {
    border-color: var(--accent-primary);
}

.cast-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cast-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.cast-info {
    padding: 0 0.25rem;
}

.cast-name {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.cast-character {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.2;
}

/* ==================== Details Table ==================== */
.details-table {
    width: 100%;
    border-collapse: collapse;
}

.details-table tr {
    border-bottom: 1px solid var(--border-subtle);
}

.details-table tr:last-child {
    border-bottom: none;
}

.details-table td {
    padding: 0.875rem 0;
}

.details-table .detail-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    width: 40%;
    text-align: right;
    padding-left: 1rem;
}

.details-table .detail-value {
    font-weight: 500;
    text-align: right;
}

.rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(245, 197, 24, 0.15);
    color: #f5c518;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.detail-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-subtle);
}

.external-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.2s;
}

.external-link:hover {
    background: var(--bg-dark);
}

/* ==================== User Rating Card ==================== */
.user-rating-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.rating-prompt {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.rating-input {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.rating-star {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--text-muted);
    transition: all 0.15s;
}

.rating-star:hover,
.rating-star.hover {
    color: #f5c518;
    transform: scale(1.15);
}

.rating-star.active {
    color: #f5c518;
}

.rating-display {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.your-rating {
    color: var(--text-primary);
}

.your-rating strong {
    color: #f5c518;
    font-size: 1.1em;
}

/* Player Header */
.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.player-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.player-close {
    background: var(--bg-tertiary);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.player-close:hover {
    background: var(--error);
}

/* ==================== NEW Cast Section ==================== */
.cast-container {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    direction: ltr; /* Override RTL for horizontal display */
}

.cast-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: inherit;
    padding: 0.5rem;
    border-radius: 8px;
    transition: transform 0.2s, background 0.2s;
}

.cast-item:hover {
    transform: translateY(-4px);
    background: var(--bg-card);
}

.cast-item .cast-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    border: 2px solid var(--border);
}

.cast-item .cast-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cast-item .cast-photo svg {
    color: var(--text-muted);
}

.cast-item .cast-name {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cast-item .cast-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cast-item.cast-hidden {
    display: none;
}

.cast-container.show-all .cast-item.cast-hidden {
    display: flex;
}

/* ==================== NEW Details Section ==================== */
.details-box {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.details-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.25rem;
}

.detail-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-row .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.detail-row .value {
    font-size: 0.95rem;
    font-weight: 500;
}

.detail-row .value a {
    color: var(--accent-primary);
}

/* ==================== NEW Rating Section ==================== */
.rating-box {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.rating-box h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.stars-container {
    display: inline-flex;
    gap: 4px;
    direction: ltr;
    margin-bottom: 0.75rem;
}

.star-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
}

.star-btn:hover,
.star-btn.active {
    color: #ffc107;
    transform: scale(1.15);
}

.star-btn svg {
    width: 28px;
    height: 28px;
    display: block;
}

.rating-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.rating-text strong {
    color: #ffc107;
}

/* Locked Rating Display */
.rating-locked {
    text-align: center;
}

.rating-locked-display {
    display: inline-flex;
    gap: 4px;
    direction: ltr;
    margin-bottom: 0.75rem;
}

.star-display {
    padding: 4px;
    color: var(--text-muted);
}

.star-display.active {
    color: #ffc107;
}

.star-display svg {
    width: 28px;
    height: 28px;
    display: block;
}

.rating-text.locked {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.rating-text.locked .lock-icon {
    font-size: 1rem;
}

/* ==================== Server Tabs for Iframe Mode ==================== */
.server-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-secondary, #1a1a1a);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.server-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card, #2a2a2a);
    border: 1px solid var(--border, #333);
    border-radius: 6px;
    color: var(--text, #fff);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-wrap: wrap;
    position: relative;
}

.server-tab:hover {
    background: var(--bg-tertiary, #333);
    border-color: var(--accent-primary, #06b6d4);
}

.server-tab.active {
    background: var(--accent-primary, #06b6d4);
    border-color: var(--accent-primary, #06b6d4);
    color: #fff;
}

.server-tab.highlighted {
    border-color: #ffc107;
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.3);
}

.server-note {
    display: block;
    width: 100%;
    font-size: 0.65rem;
    opacity: 0.75;
    margin-top: 2px;
    line-height: 1.2;
}

.server-tab.active .server-note {
    opacity: 0.9;
}

.server-btn-note {
    display: block;
    width: 100%;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.6);
    margin-top: 4px;
    text-align: center;
}

/* ==================== Server Subtitle Indicators ==================== */

/* Blinking dot next to server name */
.srv-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-left: 2px;
    flex-shrink: 0;
    vertical-align: middle;
}

.srv-dot-blue {
    background: #3b82f6;
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.6);
    animation: srvPulseBlue 2s ease-in-out infinite;
}

.srv-dot-yellow {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
    animation: srvPulseYellow 2s ease-in-out infinite;
}

@keyframes srvPulseBlue {
    0%, 100% { box-shadow: 0 0 4px rgba(59,130,246,0.4); }
    50% { box-shadow: 0 0 10px rgba(59,130,246,0.8); }
}

@keyframes srvPulseYellow {
    0%, 100% { box-shadow: 0 0 4px rgba(245,158,11,0.4); }
    50% { box-shadow: 0 0 10px rgba(245,158,11,0.8); }
}

/* Spoiler-style badge on server notes */
.srv-badge {
    display: inline-block !important;
    width: auto !important;
    padding: 0.15rem 0.5rem;
    border-radius: 5px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
    opacity: 1;
    margin-top: 3px;
}

.srv-badge-blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.srv-badge-yellow {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

/* ==================== Subs Help Button (in player) ==================== */
.subs-help-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 25;
    background: rgba(245, 158, 11, 0.9);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(6px);
    box-shadow: 0 3px 12px rgba(0,0,0,0.4);
    transition: all 0.2s;
    font-family: inherit;
    animation: helpBtnPulse 3s ease-in-out infinite;
}

.subs-help-btn:hover {
    background: rgba(245, 158, 11, 1);
    transform: scale(1.05);
}

@keyframes helpBtnPulse {
    0%, 100% { box-shadow: 0 3px 12px rgba(0,0,0,0.4); }
    50% { box-shadow: 0 3px 20px rgba(245,158,11,0.5); }
}

.subs-help-dismiss {
    position: absolute;
    top: 10px;
    left: 130px;
    z-index: 26;
    background: rgba(0,0,0,0.5);
    color: #999;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 0.65rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.subs-help-dismiss:hover {
    background: rgba(6, 182, 212, 0.8);
    color: #fff;
}

/* ==================== Subs Help Modal ==================== */
.subs-help-modal {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 60;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* In fullscreen, use fixed positioning to cover the entire screen */
:fullscreen .subs-help-modal,
:-webkit-full-screen .subs-help-modal {
    position: fixed;
    padding: 1rem;
}

.subs-help-modal.open {
    display: flex;
}

.subs-help-content {
    background: var(--bg-card, #1e1e2e);
    border: 1px solid var(--border, #2a2a3e);
    border-radius: 12px;
    max-width: 420px;
    width: 100%;
    padding: 1.1rem 1.2rem;
    position: relative;
    direction: rtl;
    text-align: right;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    animation: modalSlideIn 0.25s ease-out;
    max-height: 100%;
    overflow-y: auto;
    margin: auto;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.subs-help-modal-close {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(255,255,255,0.08);
    border: none;
    color: var(--text-muted, #888);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.subs-help-modal-close:hover {
    background: rgba(6, 182, 212, 0.3);
    color: #fff;
}

.subs-help-content h3 {
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

.shm-desc {
    font-size: 0.78rem;
    color: var(--text-muted, #aaa);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.shm-option {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
    align-items: flex-start;
}

.shm-option-num {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 50%;
    background: var(--accent-primary, #06b6d4);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}

.shm-option-body h4 {
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.shm-option-body p {
    font-size: 0.75rem;
    color: var(--text-muted, #aaa);
    line-height: 1.4;
}

.shm-cc-badge {
    display: inline-block;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    vertical-align: middle;
}

.shm-subs-list {
    margin-top: 0.4rem;
    max-height: 110px;
    overflow-y: auto;
    border: 1px solid var(--border, #2a2a3e);
    border-radius: 6px;
}

.shm-sub-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0.6rem;
    text-decoration: none;
    color: var(--text-primary, #e5e5e5);
    border-bottom: 1px solid var(--border, #2a2a3e);
    font-size: 0.7rem;
    transition: background 0.15s;
}

.shm-sub-item:last-child { border-bottom: none; }

.shm-sub-item:hover {
    background: rgba(255,255,255,0.05);
}

.shm-sub-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shm-sub-dl {
    flex-shrink: 0;
    background: var(--accent-primary, #06b6d4);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 600;
    margin-right: 0.4rem;
}

.shm-dismiss-btn {
    width: 100%;
    padding: 0.5rem;
    margin-top: 0.5rem;
    background: var(--accent-primary, #06b6d4);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.shm-dismiss-btn:hover {
    background: #c70811;
}

@media (max-width: 480px) {
    .subs-help-content {
        padding: 0.75rem 0.85rem;
        border-radius: 10px;
    }
    .subs-help-content h3 {
        font-size: 0.85rem;
        margin-bottom: 0.25rem;
    }
    .shm-desc {
        font-size: 0.7rem;
        margin-bottom: 0.5rem;
    }
    .shm-option {
        gap: 0.4rem;
        margin-bottom: 0.4rem;
    }
    .shm-option-num {
        width: 18px;
        height: 18px;
        min-width: 18px;
        font-size: 0.6rem;
    }
    .shm-option-body h4 {
        font-size: 0.73rem;
    }
    .shm-option-body p {
        font-size: 0.67rem;
        line-height: 1.3;
    }
    .shm-cc-badge {
        font-size: 0.6rem;
        padding: 0 5px;
    }
    .shm-subs-list {
        max-height: 80px;
    }
    .shm-sub-item {
        padding: 0.25rem 0.5rem;
        font-size: 0.63rem;
    }
    .shm-sub-dl {
        font-size: 0.55rem;
        padding: 1px 5px;
    }
    .shm-dismiss-btn {
        padding: 0.4rem;
        font-size: 0.72rem;
        margin-top: 0.35rem;
    }
    .subs-help-btn {
        font-size: 0.7rem;
        padding: 5px 10px;
    }
    .subs-help-dismiss {
        left: 100px;
    }
    .srv-dot {
        width: 6px;
        height: 6px;
    }
    .srv-badge {
        font-size: 0.55rem;
        padding: 0.1rem 0.4rem;
    }
}

/* Extra-small: landscape phone player is very short */
@media (max-height: 400px) {
    .subs-help-content {
        padding: 0.5rem 0.7rem;
    }
    .subs-help-content h3 {
        font-size: 0.8rem;
    }
    .shm-desc {
        font-size: 0.65rem;
        margin-bottom: 0.3rem;
    }
    .shm-option {
        margin-bottom: 0.3rem;
    }
    .shm-option-body h4 {
        font-size: 0.7rem;
    }
    .shm-option-body p {
        font-size: 0.63rem;
    }
    .shm-subs-list {
        max-height: 60px;
    }
    .shm-dismiss-btn {
        padding: 0.3rem;
        font-size: 0.68rem;
    }
}

/* Force-newtab server links styled as tabs */
a.server-tab.newtab-server,
a.server-btn.newtab-server {
    text-decoration: none;
    color: var(--text, #fff);
    border-style: dashed;
}

a.server-tab.newtab-server:hover,
a.server-btn.newtab-server:hover {
    border-style: solid;
}

/* Subtitle Download Bar */
.subs-download-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary, #1a1a1a);
    border: 1px solid var(--border-subtle, #333);
    border-radius: 8px;
    flex-wrap: wrap;
}

.subs-download-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-primary, #e5e5e5);
}

.subs-download-info svg {
    color: var(--primary, #06b6d4);
}

.subs-download-count {
    font-size: 0.75rem;
    color: var(--text-muted, #666);
    background: rgba(255,255,255,0.05);
    padding: 2px 8px;
    border-radius: 10px;
}

.subs-download-dropdown {
    position: relative;
}

.subs-download-btn {
    padding: 8px 18px;
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    transition: all 0.2s;
}

.subs-download-btn:hover {
    background: rgba(6, 182, 212, 0.3);
    border-color: var(--primary, #06b6d4);
}

.subs-download-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 6px;
    min-width: 300px;
    max-height: 250px;
    overflow-y: auto;
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
    z-index: 100;
    padding: 4px;
}

.subs-download-dropdown.open .subs-download-menu {
    display: block;
}

.subs-download-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 8px 12px;
    color: #e5e5e5;
    text-decoration: none;
    font-size: 0.8rem;
    border-radius: 5px;
    transition: background 0.15s;
}

.subs-download-item:hover {
    background: rgba(6, 182, 212, 0.15);
}

.subs-dl-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    direction: ltr;
    text-align: right;
}

.subs-dl-ext {
    font-size: 0.65rem;
    font-weight: 600;
    color: #00cc66;
    background: rgba(0, 204, 102, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
}

.server-separator {
    width: 2px;
    height: 32px;
    background: var(--border-subtle, #444);
    margin: 0 0.5rem;
    align-self: center;
}

.servers-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0 1rem;
    gap: 1rem;
}

.servers-divider::before,
.servers-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle, #444);
}

.servers-divider span {
    font-size: 0.85rem;
    color: var(--text-muted, #888);
    white-space: nowrap;
}

.auto-embed-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    color: #ffc107;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.auto-embed-notice svg {
    flex-shrink: 0;
}

.server-quality {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    margin-left: 0.5rem;
}

/* Player wrapper */
.player-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.player-wrapper .player-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #888;
    gap: 1rem;
    z-index: 2;
    background: #000;
}

.player-wrapper .player-placeholder.hidden {
    display: none;
}

.player-wrapper .player-placeholder svg {
    opacity: 0.5;
}

.player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    z-index: 1;
}

/* No sources message */
.no-sources {
    text-align: center;
    padding: 3rem;
    color: #888;
}

.no-sources svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ==================== No Seasons Message ==================== */
.no-seasons-message {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-card, #1a1a1a);
    border-radius: 12px;
    color: var(--text-muted, #888);
}

.no-seasons-message svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-seasons-message p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.no-seasons-message .btn {
    margin-top: 0.5rem;
}

/* ==================== Episode Page Styles ==================== */
.episode-page {
    background: var(--bg-primary);
}

.episode-servers-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
}

.episode-servers-section .servers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.episode-servers-section .servers-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.episode-info-badge {
    background: var(--bg-secondary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.episode-player-section {
    background: var(--bg-secondary);
    padding: 0;
    margin-bottom: 2rem;
}

.episode-player-section .player-wrapper-full {
    background: #000;
}

.episode-player-section .episode-servers-section {
    background: var(--bg-card);
}

.player-wrapper-full {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    aspect-ratio: 16/9;
    background: #000;
}

/* Fullscreen styles for player-wrapper-full */
.player-wrapper-full:fullscreen,
.player-wrapper-full:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    aspect-ratio: unset;
}

.player-wrapper-full:fullscreen iframe,
.player-wrapper-full:-webkit-full-screen iframe {
    width: 100%;
    height: 100%;
}

/* Subtitle styles for player-wrapper-full */
.player-wrapper-full #subsOverlay {
    position: absolute;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    text-align: center;
    pointer-events: none;
    z-index: 100;
}

.player-wrapper-full #subsText {
    display: inline-block;
    padding: var(--subs-padding, 8px 18px);
    background: var(--subs-bg, rgba(0, 0, 0, 0.9));
    color: var(--subs-color, #fff);
    font-size: var(--subs-size, 1.6rem);
    font-weight: 500;
    border-radius: 4px;
    text-shadow: 1px 1px 3px #000, -1px -1px 3px #000;
    direction: rtl;
}

.player-wrapper-full #subsText:empty { display: none; }

.player-wrapper-full #subsStyleBtn {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 10001;
    background: rgba(0,0,0,0.7);
    border: 2px solid rgba(255,255,255,0.5);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s;
    opacity: 0;
    line-height: 1;
}
.player-wrapper-full:hover #subsStyleBtn { opacity: 1; }
.player-wrapper-full #subsStyleBtn:hover { background: rgba(0,212,255,0.8); border-color: #00d4ff; }

.player-wrapper-full:fullscreen #subsOverlay,
.player-wrapper-full:-webkit-full-screen #subsOverlay {
    bottom: 80px;
    z-index: 9999;
}

.player-wrapper-full:fullscreen #subsText,
.player-wrapper-full:-webkit-full-screen #subsText {
    font-size: 2.4rem;
    padding: 12px 28px;
}

.player-wrapper-full:fullscreen #subsFullscreenBtn,
.player-wrapper-full:-webkit-full-screen #subsFullscreenBtn {
    bottom: 20px;
    right: 20px;
    opacity: 0;
    z-index: 10000;
}

.player-wrapper-full:fullscreen:hover #subsFullscreenBtn,
.player-wrapper-full:-webkit-full-screen:hover #subsFullscreenBtn {
    opacity: 1;
}

.player-wrapper-full:fullscreen .player-placeholder,
.player-wrapper-full:-webkit-full-screen .player-placeholder {
    display: none;
}

.player-wrapper-full .player-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    overflow: hidden;
}

.player-wrapper-full .player-placeholder .placeholder-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    /* For img tag */
    object-fit: cover;
    object-position: center;
    display: block;
    /* For div with background-image */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.player-wrapper-full .player-placeholder .placeholder-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
}

.player-wrapper-full .player-placeholder:not(.active) {
    display: none;
}

.player-wrapper-full iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: none;
}

.play-button-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
}

.play-button-large:hover {
    transform: scale(1.1);
    background: var(--accent-hover);
}

.placeholder-text {
    color: white;
    margin-top: 1rem;
    font-size: 1rem;
}

.no-sources-full {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    color: var(--text-muted);
}

.server-selector {
    background: var(--bg-secondary);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.server-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.server-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.server-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.server-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.server-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.server-btn .quality {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-left: 0.25rem;
}

/* Episode Info Section */
.episode-info-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

.episode-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.episode-show-info .show-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
}

.show-poster-mini {
    width: 50px;
    height: 75px;
    object-fit: cover;
    border-radius: 4px;
}

.episode-navigation {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s;
}

.nav-btn:hover:not(.disabled) {
    background: var(--bg-tertiary);
}

.nav-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.episode-selector select {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    cursor: pointer;
    max-width: 300px;
}

/* Episode Title */
.episode-title-main {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.episode-name-subtitle {
    display: block;
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.episode-meta-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.episode-meta-row .meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.episode-meta-row .meta-item.rating {
    color: var(--accent-gold);
}

.episode-overview-full {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.episode-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Episodes Scroll */
.episodes-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scrollbar-width: thin;
}

.episode-mini-card {
    flex: 0 0 150px;
    text-decoration: none;
    color: var(--text-primary);
}

.episode-mini-card.current {
    opacity: 0.5;
}

.episode-mini-thumb {
    position: relative;
    aspect-ratio: 16/9;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

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

.episode-mini-number {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.7);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.episode-mini-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==================== Mobile Search ==================== */
.mobile-search-btn {
    display: none; /* shown in 768px media query */
}

.mobile-search-bar {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(12,18,32,0.98);
    backdrop-filter: blur(12px);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    z-index: 999;
    animation: mobileSearchSlide 0.15s ease-out;
}

.mobile-search-bar.open {
    display: block;
}

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

.mobile-search-form {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 25px;
    padding: 0.55rem 1rem;
}

.mobile-search-form svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.mobile-search-form input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    font-family: inherit;
    min-width: 0;
}

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

.mobile-search-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
}

.mobile-search-close:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.1);
}

/* Mobile search results */
.mobile-search-results {
    display: none;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-card, #16161e);
    border-radius: 0 0 12px 12px;
    margin-top: 0.5rem;
}

.mobile-search-results.open {
    display: block;
}

.mobile-search-results .live-result {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.15s;
}

.mobile-search-results .live-result:hover,
.mobile-search-results .live-result:active {
    background: rgba(255,255,255,0.05);
}

.mobile-search-results .live-result-poster {
    width: 40px;
    height: 56px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255,255,255,0.05);
}

.mobile-search-results .live-result-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-search-results .live-result-info {
    flex: 1;
    min-width: 0;
}

.mobile-search-results .live-result-title {
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-search-results .live-result-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-search-results .live-result-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.mobile-search-results .live-type-badge {
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
}
.mobile-search-results .live-type-badge.movie {
    background: rgba(6, 182, 212,0.2);
    color: #ff6b6b;
}
.mobile-search-results .live-type-badge.tv {
    background: rgba(59,130,246,0.2);
    color: #60a5fa;
}

.mobile-search-results .live-search-all {
    display: block;
    text-align: center;
    padding: 0.65rem;
    color: var(--accent-primary, #06b6d4);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.mobile-search-results .live-search-empty {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.mobile-search-results .live-no-poster {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* ==================== MOBILE OVERFLOW FIXES ==================== */
/* Fix horizontal overflow on mobile devices */

@media (max-width: 768px) {
    /* --- Announcement bar mobile --- */
    .announcement {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        gap: 0.5rem;
    }
    
    .announcement-text,
    .announcement-message {
        font-size: 0.78rem;
        line-height: 1.3;
    }
    
    .announcement-close,
    .announcement-dismiss {
        padding: 0.3rem;
        font-size: 1rem;
    }

    /* --- Global containment --- */
    header {
        padding: 0.75rem 1rem;
    }

    nav {
        gap: 0.5rem;
        max-width: 100vw;
    }

    .logo-text {
        font-size: clamp(0.85rem, 1.8vw, 1.3rem);
    }
    
    .logo-icon {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    .nav-actions {
        gap: 0.5rem;
    }

    .nav-actions .btn {
        padding: 0.4rem 0.7rem;
        font-size: 0.8rem;
    }

    .mobile-menu {
        padding: 0.75rem 1rem;
    }

    /* --- Mobile search button --- */
    .mobile-search-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: var(--text-primary);
        padding: 0.4rem;
        cursor: pointer;
        border-radius: 50%;
        transition: background 0.2s;
    }
    .mobile-search-btn:hover {
        background: rgba(255,255,255,0.1);
    }

    section {
        padding: 1.5rem 0.75rem;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .container {
        padding: 0 0.75rem;
    }

    main {
        padding-top: 60px;
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* --- Player section (movie page) --- */
    .player-section {
        padding: 1rem 0.5rem;
    }

    .player-container.redirect-mode {
        padding: 1rem;
    }

    /* --- Server tabs (movie page) --- */
    .server-tabs {
        padding: 0.75rem;
        gap: 0.4rem;
    }

    .server-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        gap: 0.3rem;
    }

    /* --- Server selector (episode page) --- */
    .server-selector {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .server-buttons {
        gap: 0.35rem;
        width: 100%;
    }

    .server-buttons .server-btn {
        padding: 0.4rem 0.65rem;
        font-size: 0.78rem;
    }

    /* --- Server grid (redirect mode) --- */
    .servers-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.6rem;
    }

    /* --- Episode player section --- */
    .episode-player-section {
        margin-bottom: 1rem;
        overflow-x: hidden;
        max-width: 100vw;
    }

    .episode-servers-section {
        padding: 1rem;
    }

    /* --- Episode info section --- */
    .episode-info-section {
        padding: 0 0.75rem 1.5rem;
        overflow-x: hidden;
    }

    .episode-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .episode-navigation {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .nav-btn {
        padding: 0.4rem 0.7rem;
        font-size: 0.82rem;
    }

    .episode-selector select {
        max-width: 100%;
        width: 100%;
    }

    .episode-title-main {
        font-size: 1.3rem;
    }

    .episode-name-subtitle {
        font-size: 1rem;
    }

    .episode-actions {
        gap: 0.5rem;
    }

    .episode-actions .btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.82rem;
    }

    /* --- Subtitle controls --- */
    .subs-controls {
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }

    .subs-time {
        min-width: 80px;
        font-size: 0.85rem;
        padding: 4px 8px;
    }

    .subs-version-picker {
        width: 100%;
        padding: 5px 8px;
    }

    .subs-select-wrap select {
        min-width: 140px;
        max-width: 100%;
        font-size: 0.78rem;
    }

    .subs-hint {
        white-space: normal;
        font-size: 0.72rem;
        line-height: 1.3;
    }

    /* --- Download bar --- */
    .subs-download-bar {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }

    .subs-download-menu {
        min-width: 0;
        max-width: calc(100vw - 2rem);
        right: 0;
        left: auto;
        max-height: 220px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .subs-download-dropdown {
        width: 100%;
    }

    /* --- Content hero --- */
    .content-hero {
        padding: calc(var(--header-height, 80px) + 16px) 0.75rem 1.5rem;
        overflow-x: hidden;
    }

    .content-hero-inner {
        max-width: 100%;
        overflow-x: hidden;
    }

    .content-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* --- Report modal fix --- */
    .modal-content {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
        width: 100%;
    }

    /* --- Footer --- */
    footer {
        padding: 2rem 0.75rem;
        overflow-x: hidden;
    }

    /* --- Auto-embed notice --- */
    .auto-embed-notice {
        margin: 0.5rem 0.75rem 0;
        font-size: 0.75rem;
    }

    /* --- Content sections inline padding --- */
    .content-section {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        overflow-x: clip;
    }

    /* --- Server buttons overflow fix --- */
    .server-buttons {
        max-width: 100%;
    }

    .server-buttons .server-btn {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* --- Episode meta overflow --- */
    .episode-meta-row {
        flex-wrap: wrap;
    }

    .episode-title-main {
        word-break: break-word;
        overflow-wrap: break-word;
    }
}

@media (max-width: 480px) {
    /* Force overflow containment on smallest screens */
    html, body {
        overflow-x: clip !important;
        max-width: 100vw !important;
    }

    main {
        overflow-x: hidden;
    }

    header {
        padding: 0.5rem 0.65rem;
        max-width: 100vw;
    }

    section {
        padding: 1rem 0.5rem;
        overflow-x: hidden;
    }

    .container {
        padding: 0 0.5rem;
    }

    .player-section {
        padding: 0.5rem 0.25rem;
    }

    /* Server tabs even tighter */
    .server-tabs {
        padding: 0.5rem;
        gap: 0.3rem;
    }

    .server-tab {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }

    /* Server selector in episode page */
    .server-selector {
        padding: 0.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
        overflow: hidden;
    }

    .server-buttons {
        width: 100%;
        max-width: 100%;
    }

    .server-buttons .server-btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.72rem;
        max-width: 100%;
    }

    .servers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    /* Episode info */
    .episode-info-section {
        padding: 0 0.5rem 1rem;
        overflow-x: hidden;
    }

    .episode-title-main {
        font-size: 1.15rem;
        word-break: break-word;
    }

    .episode-name-subtitle {
        font-size: 0.9rem;
    }

    .nav-btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.75rem;
        gap: 0.3rem;
    }

    /* Subtitle controls */
    .subs-controls {
        padding: 0.4rem 0.5rem;
        gap: 0.4rem;
        font-size: 0.8rem;
        overflow: hidden;
    }

    .subs-time {
        min-width: 70px;
        font-size: 0.78rem;
        padding: 3px 6px;
    }

    .subs-version-picker {
        padding: 4px 6px;
        max-width: 100%;
    }

    .subs-select-wrap select {
        min-width: 120px;
        font-size: 0.75rem;
        padding: 4px 24px 4px 8px;
    }

    .subs-version-label {
        font-size: 0.72rem;
    }

    .subs-hint {
        font-size: 0.65rem;
        white-space: normal;
    }

    /* Content hero */
    .content-hero {
        padding: calc(var(--header-height, 80px) + 8px) 0.5rem 1rem;
        overflow: hidden;
    }

    .content-hero-inner {
        max-width: 100%;
    }

    .content-title {
        font-size: 1.5rem;
        word-break: break-word;
    }

    .content-poster {
        width: 140px;
    }

    /* Report modal */
    .modal-content {
        margin: 0.25rem;
        padding: 1rem;
        max-width: calc(100vw - 0.5rem);
    }

    /* Footer */
    footer {
        padding: 1.5rem 0.5rem;
        overflow-x: hidden;
    }

    .content-section {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        overflow-x: clip;
    }

    /* Episode servers section */
    .episode-servers-section {
        padding: 0.75rem;
        overflow: hidden;
    }

    .episode-servers-section .servers-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Download menu on mobile */
    .subs-download-menu {
        min-width: 0;
        max-width: calc(100vw - 1rem);
        width: 100%;
        max-height: 220px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Live search dropdown on mobile */
    .live-search-dropdown {
        min-width: 0;
        max-width: calc(100vw - 1rem);
    }

    /* Episode player section */
    .episode-player-section {
        overflow: hidden;
    }

    /* Content info long text */
    .content-overview,
    .episode-overview-full {
        word-break: break-word;
        overflow-wrap: break-word;
    }
}

/* header-overlap-fix-2026 */
nav { gap: 1.25rem; }
.logo { flex: 1 1 0; min-width: 0; max-width: min(480px, 38%); }
.logo-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.nav-links { flex: 0 0 auto; gap: 1.15rem; margin-inline: 0.25rem 0.75rem; }
.nav-actions { flex-shrink: 0; }
@media (max-width: 1100px) {
    .logo { max-width: min(280px, 32%); }
    .nav-links { gap: 0.7rem; }
}
