/* ===================================
   AnimeVale - Anime Streaming Website
   Professional Modern Design
   =================================== */

:root {
    --primary-color: #e50914;
    --primary-dark: #b20710;
    --secondary-color: #141414;
    --dark-bg: #0a0a0a;
    --light-bg: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #808080;
    --border-color: #333333;
    --hover-color: #f40612;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.7);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    padding-bottom: 0;
    /* Default */
}

@media (max-width: 768px) {
    body {
        padding-bottom: 70px;
        /* Space for bottom nav */
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===================================
   Navigation
   =================================== */

.navbar {
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo a:hover {
    transform: scale(1.05);
}

.logo i {
    font-size: 2rem;
}

.logo img {
    display: inline-block;
    vertical-align: middle;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    z-index: 1001;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* ===================================
   Hero Section
   =================================== */

.hero {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.03)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* ===================================
   Series Grid
   =================================== */

.series-section {
    padding: 60px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

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

@media (max-width: 1024px) {
    .series-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .series-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.series-card {
    background: var(--light-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.series-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.series-card-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.series-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.series-card-content {
    padding: 1.5rem;
}

.series-card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.series-card-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
}

.series-card-link {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
}

.series-card-link:hover {
    background: var(--hover-color);
    transform: scale(1.05);
}

/* ===================================
   Series Detail Page
   =================================== */

.series-detail {
    padding: 40px 0;
}

.series-header {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 12px;
}

.series-poster {
    width: 100%;
    height: 450px;
    object-fit: cover;
    border-radius: 12px;
    background: var(--gradient-1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.3);
}

.series-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.series-info h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.series-info .series-desc {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* ===================================
   Episodes List
   =================================== */

.episodes-section {
    margin-top: 3rem;
}

.season-block {
    margin-top: 3rem;
}

.season-block:first-child {
    margin-top: 0;
}

.season-header {
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.1) 0%, rgba(229, 9, 20, 0.05) 100%);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.season-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color) 0%, transparent 100%);
}

.season-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.season-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.season-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.season-number {
    color: var(--primary-color);
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--hover-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.season-episode-count {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

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

.episode-card {
    background: var(--light-bg);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.episode-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.episode-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.episode-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* ===================================
   Video Player Page
   =================================== */

.video-section {
    padding: 40px 0;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 2rem;
    background: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.video-container iframe.loaded {
    opacity: 1;
}

.episode-info {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.episode-info h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.episode-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.episode-series-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.episode-series-link:hover {
    text-decoration: underline;
}

.episode-meta-divider {
    opacity: 0.7;
}

.episode-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: rgba(20, 20, 20, 0.7);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.episode-badge-season {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.episode-info .episode-desc {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.episode-nav {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    font-size: 1rem;
}

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

.btn-primary:hover {
    background: var(--hover-color);
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

/* ===================================
   Enhanced Video Layout & Buttons
   =================================== */

.video-info-header {
    margin-bottom: 2rem;
    padding: 0 0.5rem;
}

.video-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
    line-height: 1.2;
    background: linear-gradient(to right, #fff, #b3b3b3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.video-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.video-meta-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.video-meta-right {
    display: flex;
    align-items: center;
}

.btn-telegram-header {
    background: linear-gradient(135deg, #0088cc 0%, #00a2ed 100%);
    color: white !important;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.2);
}

.btn-telegram-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4);
    filter: brightness(1.1);
}

.btn-telegram-header i {
    font-size: 1.1rem;
}

.video-series-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.video-series-link:hover {
    color: var(--hover-color);
}

.video-badge {
    background: rgba(229, 9, 20, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.8rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(229, 9, 20, 0.3);
}

.video-meta-divider {
    color: var(--border-color);
}

@media (max-width: 768px) {
    .video-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .video-meta-right {
        width: 100%;
    }

    .btn-telegram-header {
        width: 100%;
        justify-content: center;
    }
}

/* Listing Telegram Button */
.telegram-card-btn {
    margin-top: 1.5rem;
    background: linear-gradient(135deg, #0088cc 0%, #00a2ed 100%);
    color: white;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.3);
    border: none;
    width: 100%;
}

.episode-card:hover .telegram-card-btn {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 136, 204, 0.5);
    background: linear-gradient(135deg, #0099e6 0%, #00b3ff 100%);
}

.telegram-card-btn i {
    font-size: 1.2rem;
}

/* Small variation for side listing */
.telegram-card-btn-small {
    margin-top: 0.8rem;
    background: rgba(0, 136, 204, 0.1);
    color: #0088cc;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(0, 136, 204, 0.2);
    transition: all 0.3s ease;
}

.ep-view-card:hover .telegram-card-btn-small {
    background: #0088cc;
    color: white;
    transform: translateX(5px);
}

@media (max-width: 768px) {
    .video-title {
        font-size: 1.6rem;
    }
}

/* ===================================
   Content Pages (About, Privacy, etc.)
   =================================== */

.content-page {
    padding: 60px 0;
    min-height: 60vh;
}

.content-page h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.content-page h2 {
    font-size: 1.8rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.content-page p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.content-page ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.content-page li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

/* ===================================
   Footer
   =================================== */

.footer {
    background: var(--secondary-color);
    padding: 60px 0 20px;
    margin-top: 80px;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

@media (max-width: 992px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
    }
}

.footer-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.footer-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-section p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover,
.footer-section ul li a.active {
    color: var(--primary-color);
}

.footer-section ul li a.active {
    font-weight: 600;
}


.footer-section ul li i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

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

.telegram-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-color);
    color: white !important;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.2);
    border: none;
    font-size: 0.9rem;
}

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

.telegram-btn i {
    font-size: 1.1rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-bottom p:first-child {
    font-size: 0.8rem;
    opacity: 0.7;
}

.footer-bottom p {
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .footer-content {
        gap: 2.5rem;
        text-align: center;
    }

    .footer-section {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-section ul {
        padding: 0;
    }

    .social-links {
        justify-content: center;
    }
}

/* ===================================
   Forms & Contact
   =================================== */

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

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

.btn-refresh {
    background: rgba(229, 9, 20, 0.1);
    border: 1px solid rgba(229, 9, 20, 0.3);
    color: var(--primary-color);
    cursor: pointer;
    margin-left: 0.8rem;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.btn-refresh:hover {
    background: var(--primary-color);
    color: white;
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--dark-bg);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

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

.captcha-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.captcha-box {
    padding: 0.8rem 1.5rem;
    background: var(--gradient-1);
    border-radius: 6px;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    letter-spacing: 3px;
    user-select: none;
    min-width: 130px;
    text-align: center;
    font-family: 'Courier New', monospace;
    order: 2;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    cursor: help;
    transition: all 0.3s ease;
}

.captcha-box:hover {
    filter: brightness(1.2);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.captcha-input {
    flex: 1;
    order: 1;
    letter-spacing: 2px;
}

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

@media (max-width: 480px) {
    .captcha-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .captcha-box {
        order: 1;
        width: 100%;
        padding: 1rem;
    }

    .captcha-input {
        order: 2;
    }
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--secondary-color);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        padding: 2rem 0;
        border-top: 1px solid var(--border-color);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .series-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .series-card-image {
        height: 300px;
    }

    .series-header {
        grid-template-columns: 1fr;
    }

    .series-poster {
        height: 300px;
    }

    .episodes-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .episode-nav {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}

/* ===================================
   Loading Animation
   =================================== */

.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60%,
    100% {
        content: '...';
    }
}

/* ===================================
   Empty State
   =================================== */

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

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

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

/* ===================================
   Search Section
   =================================== */

.search-section {
    padding: 40px 0;
    background: var(--light-bg);
    border-bottom: 1px solid var(--border-color);
}

.search-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--dark-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.1);
}

.search-box i.fa-search {
    color: var(--text-secondary);
    margin-right: 1rem;
    font-size: 1.2rem;
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    padding: 0.8rem 0;
    outline: none;
    font-family: 'Poppins', sans-serif;
}

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

.search-btn {
    background: var(--primary-color);
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    margin-left: 0.5rem;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
}

.search-btn:hover {
    background: var(--hover-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(229, 9, 20, 0.3);
}

.search-btn:active {
    transform: translateY(0);
}

.clear-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
    margin-left: 0.5rem;
}

.clear-btn:hover {
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .search-box {
        flex-direction: column;
        gap: 12px;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
    }

    .search-box i.fa-search {
        display: none;
    }

    .search-box input {
        width: 100%;
        background: var(--light-bg);
        border: 2px solid var(--border-color);
        border-radius: 12px;
        padding: 12px 16px;
        font-size: 16px;
    }

    .search-btn {
        width: 100%;
        margin-left: 0;
        justify-content: center;
        padding: 14px;
        border-radius: 12px;
        font-size: 16px;
    }

    .clear-btn {
        position: absolute;
        right: 12px;
        top: 12px;
    }
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-top: 1rem;
    max-height: 500px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow);
}

.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

.search-results::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.search-results-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--dark-bg);
    position: sticky;
    top: 0;
    z-index: 10;
}

.search-results-header h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0;
}

.search-results-content {
    padding: 1rem;
}

.search-results-section {
    margin-bottom: 1.5rem;
}

.search-results-section:last-child {
    margin-bottom: 0;
}

.search-results-section h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-results-section h4 i {
    color: var(--primary-color);
}

.search-result-item {
    padding: 1rem;
    background: var(--dark-bg);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.search-result-item:hover {
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.search-result-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

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

.search-result-item-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.search-result-item-meta a {
    color: var(--primary-color);
    text-decoration: none;
}

.search-result-item-meta a:hover {
    text-decoration: underline;
}

.search-result-item-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.search-no-results {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.search-no-results i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.search-loading {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.search-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ===================================
   Mobile App Navigation (Bottom Bar)
   =================================== */

.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(20, 20, 20, 0.98);
    backdrop-filter: blur(15px);
    height: 70px;
    display: none;
    /* Hidden by default, shown in media query */
    justify-content: space-around;
    align-items: center;
    z-index: 2000;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
    padding: 0 10px;
}

.mobile-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
    gap: 5px;
    transition: all 0.3s ease;
    height: 100%;
}

.mobile-nav a i {
    font-size: 1.2rem;
}

.mobile-nav a.active {
    color: var(--primary-color);
}

.mobile-nav a.active i {
    transform: translateY(-2px);
}

/* ===================================
   Season Switcher (Tabs & AJAX)
   =================================== */

.season-tabs-wrapper {
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}

.season-tabs-wrapper::-webkit-scrollbar {
    height: 4px;
}

.season-tabs-wrapper::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

.season-tabs-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.season-tabs {
    display: flex;
    gap: 1rem;
    min-width: max-content;
}

.season-tab {
    padding: 0.8rem 1.5rem;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.season-tab:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.season-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(229, 9, 20, 0.3);
}

.episodes-container {
    position: relative;
    min-height: 200px;
}

.season-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 12px;
    backdrop-filter: blur(2px);
}

.next-season-container {
    margin-top: 3rem;
    text-align: center;
}

.btn-next-season {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(229, 9, 20, 0.2);
    border: none;
    cursor: pointer;
}

.btn-next-season:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(229, 9, 20, 0.4);
    background: linear-gradient(135deg, var(--hover-color) 0%, var(--primary-color) 100%);
}

.btn-next-season i {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.btn-next-season:hover i {
    transform: translateX(5px);
}

@media (max-width: 768px) {
    .mobile-nav {
        display: flex;
    }

    /* Keep top menu accessible */
    .nav-toggle {
        display: flex;
    }

    .navbar {
        text-align: left;
    }

    .logo {
        width: auto;
        justify-content: flex-start;
        display: flex;
    }

    .logo a {
        font-size: 1.4rem;
    }

    .container {
        padding: 0 15px;
    }
}

/* ===================================
   Enhanced Episode Page Styles
   =================================== */

.episode-list-section {
    margin-top: 3rem;
    padding: 2.5rem;
    background: var(--light-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.section-title-alt {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ep-count {
    background: rgba(229, 9, 20, 0.1);
    color: var(--primary-color);
    padding: 0.4rem 1rem;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid rgba(229, 9, 20, 0.2);
}

.episodes-view-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.ep-view-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 1.25rem;
    border-radius: 12px;
    text-decoration: none;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ep-view-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.ep-view-card.active {
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.2) 0%, rgba(229, 9, 20, 0.05) 100%);
    border-color: var(--primary-color);
    position: relative;
    overflow: hidden;
}

.ep-view-card.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-color);
}

.ep-view-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-muted);
    min-width: 40px;
    transition: color 0.3s ease;
}

.ep-view-card:hover .ep-view-number,
.ep-view-card.active .ep-view-number {
    color: var(--primary-color);
}

.ep-view-details {
    flex: 1;
}

.ep-view-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ep-playing-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.playing-icon {
    font-size: 0.7rem;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.episode-nav .btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
}

.btn-all {
    background: rgba(255, 255, 255, 0.05) !important;
}

.btn.disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
}

/* ===================================
   Series Page Grid Improvements
   =================================== */

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.episode-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.episode-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.episode-card .episode-number {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #ff4d4d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.episode-card .episode-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .episode-list-section {
        padding: 1.5rem;
    }

    .episodes-view-grid {
        grid-template-columns: 1fr;
    }

    .section-title-alt {
        font-size: 1.4rem;
    }

    .section-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding-bottom: 1.5rem;
    }

    .ep-count {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        line-height: 1.1;
        padding: 0.5rem 1rem;
        border-radius: 12px;
        text-align: center;
        min-width: 80px;
    }

    .count-num {
        font-size: 1.3rem;
        font-weight: 800;
        display: block;
    }

    .count-text {
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 1px;
        opacity: 0.9;
    }

    .episodes-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }

    .episode-card {
        padding: 1.5rem;
    }
}

/* ===================================
   Server Switcher
   =================================== */
.server-switcher {
    background: var(--light-bg);
    padding: 1.5rem 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    border: 1px solid var(--border-color);
}

.switcher-label {
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.switcher-label i {
    color: var(--primary-color);
}

.switcher-buttons {
    display: flex;
    gap: 1rem;
}

.btn-switch {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

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

.btn-switch.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.3);
}

.btn-switch i {
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .server-switcher {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem;
    }

    .switcher-buttons {
        width: 100%;
    }

    .btn-switch {
        flex: 1;
        justify-content: center;
    }
}

/* Telegram Direct Button */
.telegram-direct-action {
    margin-bottom: 2.5rem;
    display: flex;
    justify-content: center;
}

.btn-telegram-direct {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
    max-width: 500px;
    padding: 1.25rem 2rem;
    background: linear-gradient(135deg, #0088cc 0%, #00a2ed 50%, #00b3ff 100%);
    background-size: 200% auto;
    color: white !important;
    text-decoration: none !important;
    border-radius: 16px;
    font-weight: 800;
    font-size: 1.2rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(0, 136, 204, 0.4);
    border: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-telegram-direct:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 136, 204, 0.6);
    background-position: right center;
    color: white !important;
}

.btn-telegram-direct:active {
    transform: translateY(-2px) scale(0.98);
}

.btn-telegram-direct i {
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

@media (max-width: 768px) {
    .btn-telegram-direct {
        padding: 1rem;
        font-size: 1rem;
        border-radius: 12px;
    }

    .btn-telegram-direct i {
        font-size: 1.4rem;
    }
}

/* ===================================
   PWA Install Popup (Modern Compact Design)
   =================================== */
.pwa-install-popup {
    position: fixed;
    bottom: -120%;
    left: 15px;
    right: 15px;
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    z-index: 10000;
    padding: 12px 15px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6);
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.pwa-install-popup.show {
    bottom: 85px; /* Above mobile bottom nav */
}

@media (min-width: 768px) {
    .pwa-install-popup {
        width: 380px;
        left: auto;
        right: 25px;
        bottom: -150px;
    }

    .pwa-install-popup.show {
        bottom: 25px;
    }
}

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pwa-install-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3);
}

.pwa-install-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pwa-install-info {
    flex-grow: 1;
}

.pwa-install-info h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.pwa-install-info p {
    margin: 2px 0 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.pwa-install-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pwa-btn-install {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(229, 9, 20, 0.3);
}

.pwa-btn-install:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(229, 9, 20, 0.5);
    filter: brightness(1.1);
}

.pwa-btn-close {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pwa-btn-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    transform: rotate(90deg);
}