/*
Theme Name: Anime
Theme URI: https://example.com/anime
Author: Developer
Description: Theme xem phim hoáº¡t hÃ¬nh 3D vá»›i giao diá»‡n tá»‘i chuyÃªn nghiá»‡p
Version: 2.5.0
Text Domain: anime
*/

:root {
    /* Colors */
    --bg-primary: #0d0d0d;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #252525;
    --bg-card: #1e1e1e;
    --bg-hover: #2a2a2a;

    --accent-primary: #ff6b35;
    --accent-secondary: #ff8c5a;
    --accent-gradient: linear-gradient(135deg, #ff6b35, #ff8c5a);

    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #666666;

    --border-color: #333333;
    --border-light: #444444;

    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Spacing */
    --container-width: 1400px;
    --header-height: 60px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-primary);
}

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

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

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== HEADER ========== */
.site-header {
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

/* Header Main Row */
.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    gap: 20px;
}

/* Logo */
.site-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.site-logo img {
    max-height: 44px;
    height: auto;
    width: auto;
}

.site-logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 4px;
}

.site-logo-text .logo-hoat {
    background: linear-gradient(135deg, #ff6b35, #ff8c5a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-logo-text .logo-hinh {
    color: #fff;
}

.site-logo-text .logo-3d {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Header Right Section */
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Search Box */
.header-search {
    flex: 1;
    max-width: 400px;
}

/* Mobile Search */
.header-search-mobile {
    display: none;
    padding: 0 0 12px;
}

.header-search-mobile.active {
    display: block;
}

.header-search-mobile .search-form {
    position: relative;
}

.header-search-mobile .search-close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
}

.header-search-mobile .search-close:hover {
    color: var(--text-primary);
}

.search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.search-form input {
    width: 100%;
    padding: 10px 16px 10px 44px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

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

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

.search-form .search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 16px;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 18px;
    transition: all 0.2s;
}

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

/* Responsive visibility classes */
.mobile-only {
    display: none;
}

.desktop-only {
    display: flex;
}

/* Mobile Menu Toggle - Hidden on desktop */
.mobile-menu-toggle {
    display: none;
}

/* Header Notice */
.header-notice {
    text-align: center;
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

.header-notice a {
    color: var(--accent-primary);
    font-weight: 600;
}

/* ========== NAVIGATION ========== */
.main-nav {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

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

.nav-menu li {
    flex-shrink: 0;
    position: relative;
}

.nav-menu a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
    white-space: nowrap;
}

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

.nav-menu a .icon {
    font-size: 16px;
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 420px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    padding: 12px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.nav-dropdown:hover>.nav-dropdown-content {
    display: grid;
}

.nav-dropdown-content a {
    display: block;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.nav-dropdown-content a:hover {
    background: var(--bg-tertiary);
}

/* ========== SECTION TITLE ========== */
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-title .icon {
    font-size: 18px;
}

.section-title a {
    margin-left: auto;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: none;
}

/* ========== TRENDING SECTION ========== */
.trending-section {
    padding: 30px 0 20px;
}

.trending-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.trending-item {
    position: relative;
}

.trending-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 3/4;
    background: var(--bg-card);
    display: block;
}

.trending-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    z-index: 1;
    pointer-events: none;
}

.trending-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.3s ease;
}

.trending-card:hover img {
    transform: scale(1.08);
    filter: brightness(1.1);
}

.trending-rank {
    position: absolute;
    bottom: 0;
    left: 5px;
    font-size: 5rem;
    font-weight: 900;
    color: transparent;
    -webkit-text-stroke: 3px #fff;
    text-stroke: 3px #fff;
    z-index: 10;
    line-height: 1;
    pointer-events: none;
}

.trending-score {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-gradient);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 700;
    z-index: 2;
}

.trending-info {
    padding: 10px 0 0 50px;
    min-height: 50px;
}

.trending-info h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 3px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-primary);
}

.trending-info h3 a {
    color: inherit;
}

.trending-info h3 a:hover {
    color: var(--accent-primary);
}

.trending-info .original-title {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* Schedule Tabs - Separate row below trending */
.schedule-tabs {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.schedule-tab {
    text-align: center;
    padding: 12px 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.schedule-tab:hover {
    background: var(--bg-tertiary);
}

.schedule-tab.active {
    background: var(--accent-gradient);
}

.schedule-tab .day-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.schedule-tab.active .day-label {
    color: white;
}

.schedule-tab .day-name {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}

.schedule-tab.active .day-name {
    color: rgba(255, 255, 255, 0.85);
}

/* ========== SCHEDULE TABS ========== */
.schedule-section {
    padding: 20px 0;
}

.schedule-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 25px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-secondary);
}

.schedule-tab {
    flex: 1;
    padding: 12px 16px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

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

.schedule-tab.active {
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-md);
}

.schedule-tab .day-name {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.schedule-tab.active .day-name {
    color: rgba(255, 255, 255, 0.8);
}

/* ========== ANIME GRID ========== */
.anime-section {
    padding: 20px 0 40px;
}

.anime-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

.anime-card {
    display: flex;
    flex-direction: column;
    background: transparent;
}

.anime-card-poster {
    position: relative;
    display: block;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 10px;
}

.anime-card-poster::before {
    content: '';
    display: block;
    padding-top: 140%;
}

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

.anime-card-poster:hover img {
    transform: scale(1.08);
    filter: brightness(0.85);
}

/* Gradient overlay at bottom for better text visibility */
.anime-card-poster::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.anime-card-poster:hover::after {
    opacity: 1;
}

/* Badges on poster */
.anime-badge {
    position: absolute;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    z-index: 2;
}

.badge-episode {
    top: 8px;
    left: 8px;
    background: var(--accent-gradient);
    color: white;
}

.badge-score {
    top: 8px;
    right: 8px;
    background: var(--accent-gradient);
    color: white;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Play Overlay */
.anime-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 5;
}

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

.play-btn {
    width: 56px;
    height: 56px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    transform: scale(0.8);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
}

.anime-card-poster:hover .play-btn {
    transform: scale(1);
}

.play-btn:hover {
    box-shadow: 0 6px 30px rgba(255, 107, 53, 0.6);
}

/* Card Title & Info */
.anime-card-info {
    padding: 0;
}

.anime-card-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.anime-card-title a {
    color: var(--text-primary);
    text-decoration: none;
}

.anime-card-title a:hover {
    color: var(--accent-primary);
}

/* Audio Type Badges */
.audio-badges {
    display: flex;
    gap: 6px;
}

.audio-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
}

.audio-badge.vietsub {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.audio-badge.thuyet-minh {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.audio-badge.thuyet-minh {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

/* ========== SIDEBAR ========== */
.main-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    padding: 30px 0;
}

.main-content.no-sidebar {
    grid-template-columns: 1fr;
}

.content-area {
    min-width: 0;
}

.sidebar {
    position: sticky;
    top: calc(var(--header-height) + 20px);
    height: fit-content;
}

.sidebar-widget {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
}

.widget-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Top Anime List */
.top-anime-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.top-anime-item {
    display: flex;
    gap: 12px;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    transition: background 0.2s;
}

.top-anime-item:hover {
    background: var(--bg-hover);
}

.top-anime-rank {
    width: 30px;
    height: 30px;
    background: var(--accent-gradient);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.top-anime-rank.rank-1 {
    background: linear-gradient(135deg, #ffd700, #ffb700);
}

.top-anime-rank.rank-2 {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
}

.top-anime-rank.rank-3 {
    background: linear-gradient(135deg, #cd7f32, #b5651d);
}

.top-anime-poster {
    width: 50px;
    height: 70px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.top-anime-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.top-anime-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.top-anime-info h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    word-break: break-word;
}

.top-anime-info .views {
    font-size: 11px;
    color: var(--text-muted);
}

/* ========== FOOTER ========== */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-about h3 {
    font-size: 1.25rem;
    margin-bottom: 15px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.footer-links h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
}

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

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    font-size: 13px;
    color: var(--text-secondary);
}

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

/* ========== SINGLE ANIME ========== */
.anime-detail-header {
    position: relative;
    padding: 40px 0;
    margin-bottom: 30px;
}

.anime-backdrop {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.anime-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.4);
}

.anime-backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-primary) 0%, rgba(13, 13, 13, 0.85) 40%, rgba(0, 0, 0, 0.7) 100%);
}

.anime-detail-content {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 30px;
    align-items: end;
}

.anime-detail-poster {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.anime-detail-info h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.anime-detail-original {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.anime-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

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

.meta-item .icon {
    color: var(--accent-primary);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 107, 53, 0.4);
}

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

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

/* ========== EPISODE LIST ========== */
.episode-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 30px;
}

.episode-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.episode-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.episode-section-title .icon {
    color: var(--accent-primary);
}

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

/* Episode Search Input */
.episode-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.episode-search-input {
    width: 180px;
    padding: 8px 12px 8px 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    transition: all 0.2s;
}

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

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

.episode-search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 13px;
    pointer-events: none;
}

/* Next Episode Button */
.btn-next-episode {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-next-episode:hover {
    transform: translateX(3px);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.btn-next-episode i {
    font-size: 11px;
    transition: transform 0.2s;
}

.btn-next-episode:hover i {
    transform: translateX(2px);
}

/* Episode Count */
.episode-count {
    font-size: 13px;
    color: var(--text-muted);
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

/* Episode Item Hidden State */
.episode-btn.hidden {
    display: none;
}

/* Episode No Results */
.episode-no-results {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.episode-no-results i {
    margin-right: 8px;
    color: var(--text-muted);
}

.episode-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.episode-tab {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.episode-tab:hover {
    border-color: var(--text-secondary);
}

.episode-tab.active.vietsub {
    background: #22c55e;
    color: white;
    border-color: #22c55e;
}

.episode-tab.active.thuyet-minh {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

/* Episode Grid Container - Scrollable */
.episode-list {
    max-height: 220px;
    overflow-y: auto;
    padding-right: 8px;
    scroll-behavior: smooth;
}

.episode-list::-webkit-scrollbar {
    width: 6px;
}

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

.episode-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
    transition: background 0.2s;
}

.episode-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

.episode-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 8px;
}

@media (max-width: 1200px) {
    .episode-grid {
        grid-template-columns: repeat(10, 1fr);
    }
}

@media (max-width: 992px) {
    .episode-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

@media (max-width: 768px) {
    .episode-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 480px) {
    .episode-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.episode-btn {
    padding: 12px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: block;
    position: relative;
    overflow: hidden;
}

.episode-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.episode-btn:hover::before {
    left: 100%;
}

.episode-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.episode-btn.active {
    background: var(--accent-gradient);
    border-color: var(--accent-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.episode-btn:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

color: var(--text-primary);
}

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

/* ========== VIDEO PLAYER ========== */
.player-section {
    margin-bottom: 30px;
}

.player-wrapper {
    position: relative;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16/9;
}

.player-wrapper iframe,
.player-wrapper video {
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
}

.player-wrapper video {
    object-fit: contain;
}

/* Player placeholder for empty/pending episodes */
.player-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.placeholder-content {
    text-align: center;
    padding: 40px;
}

.placeholder-content i {
    font-size: 4rem;
    color: var(--accent-primary);
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

.placeholder-content h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.placeholder-content p {
    color: var(--text-secondary);
    font-size: 14px;
}

@keyframes pulse {

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

    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

.server-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin-top: -5px;
}

.server-list-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.server-btn {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

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

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.pagination a:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

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

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
    .trending-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .anime-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .schedule-tabs {
        grid-template-columns: repeat(8, 1fr);
    }

    .main-content {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }
}

@media (max-width: 992px) {
    .trending-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .trending-item:nth-child(5) {
        display: none;
    }

    .anime-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }

    .trending-rank {
        font-size: 4rem;
    }

    .trending-info {
        padding-left: 40px;
    }

    .schedule-tabs {
        grid-template-columns: repeat(4, 1fr);
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    /* Header Mobile Layout */
    .header-main {
        gap: 12px;
    }

    .site-logo img {
        max-height: 36px;
    }

    .site-logo-text {
        font-size: 1.1rem;
    }

    /* Fix iOS zoom on input focus - font-size must be 16px+ */
    .search-form input,
    .header-search-mobile input,
    input[type="text"],
    input[type="search"],
    input[type="email"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Show/Hide elements */
    .mobile-only {
        display: flex !important;
    }

    .desktop-only {
        display: none !important;
    }

    /* Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: flex !important;
    }

    /* Header buttons smaller on mobile */
    .header-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    /* Hide desktop nav on mobile */
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        z-index: 999;
    }

    .main-nav.active {
        display: block;
    }

    .main-nav .nav-menu {
        flex-direction: column;
        padding: 10px 0;
    }

    .main-nav .nav-menu li {
        border-bottom: 1px solid var(--border-color);
    }

    .main-nav .nav-menu li:last-child {
        border-bottom: none;
    }

    .main-nav .nav-menu a {
        display: block;
        padding: 14px 20px;
        font-size: 14px;
        text-align: left;
    }

    .nav-dropdown-content {
        position: static;
        box-shadow: none;
        background: var(--bg-tertiary);
        padding: 0;
        display: none;
        grid-template-columns: 1fr;
    }

    .nav-dropdown:hover>.nav-dropdown-content,
    .nav-dropdown.active>.nav-dropdown-content {
        display: block;
    }

    .nav-dropdown-content a {
        padding: 12px 20px 12px 36px;
        text-align: left;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-dropdown-content a:last-child {
        border-bottom: none;
    }

    .trending-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .trending-item:nth-child(n+4) {
        display: none;
    }

    .trending-rank {
        font-size: 3rem;
        bottom: -20px;
    }

    .trending-info {
        padding-left: 35px;
    }

    .schedule-tabs {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .schedule-tab {
        padding: 10px 5px;
    }

    .schedule-tab .day-label {
        font-size: 12px;
    }

    .schedule-tab .day-name {
        font-size: 10px;
    }

    .anime-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .anime-detail-content {
        grid-template-columns: 140px 1fr;
        gap: 20px;
    }

    .anime-detail-info h1 {
        font-size: 1.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .trending-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .trending-item:nth-child(n+3) {
        display: none;
    }

    .trending-rank {
        font-size: 2.5rem;
        bottom: -15px;
    }

    .trending-info {
        padding-left: 28px;
        font-size: 12px;
    }

    .schedule-tabs {
        grid-template-columns: repeat(4, 1fr);
    }

    .anime-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .anime-card-info {
        padding: 8px;
    }

    .anime-card-title {
        font-size: 12px;
    }

    .anime-detail-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .anime-detail-poster {
        max-width: 180px;
        margin: 0 auto;
    }

    .anime-detail-actions {
        justify-content: center;
    }

    /* Episode search responsive */
    .episode-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .episode-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .episode-search-input {
        width: 130px;
        padding: 6px 10px 6px 32px;
        font-size: 12px;
    }

    .btn-next-episode {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* ========== UTILITIES ========== */
.text-center {
    text-align: center;
}

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

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

/* Focus States for Accessibility */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Smooth page transitions */
.site-main {
    animation: fadeIn 0.3s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Spinner */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

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

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

/* No Poster Placeholder */
.no-poster {
    width: 100%;
    height: 100%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 12px;
}