/* ============================================================
   HiAnime - Professional Dark Theme Stylesheet
   ============================================================ */

/* --- CSS Variables --- */
:root {
    --bg-primary: #0b0b12;
    --bg-secondary: #111119;
    --bg-card: #16161f;
    --bg-card-hover: #1e1e2a;
    --bg-input: #1a1a26;
    --bg-overlay: rgba(0,0,0,0.7);
    --bg-glass: rgba(22,22,31,0.92);

    --accent: #8b5cf6;
    --accent-hover: #a78bfa;
    --accent-dark: #6d28d9;
    --accent-glow: rgba(139,92,246,0.3);
    --green: #22c55e;
    --red: #ef4444;
    --orange: #f97316;
    --yellow: #eab308;
    --cyan: #06b6d4;

    --text-primary: #f0f0f5;
    --text-secondary: #9494a8;
    --text-muted: #5e5e72;
    --text-link: #8b5cf6;

    --border: #2a2a3a;
    --border-light: #222233;

    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.6);
    --shadow-accent: 0 4px 20px rgba(139,92,246,0.2);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: all 0.3s ease;
    --max-width: 1280px;
    --nav-height: 64px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--text-link); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* --- Container --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ============================================================
   NAVIGATION
   ============================================================ */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    z-index: 1000;
    transition: var(--transition);
}
.navbar.scrolled {
    background: rgba(11,11,18,0.97);
    box-shadow: var(--shadow);
}
.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 24px;
}
.nav-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.5px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-logo i { font-size: 1.3rem; }
.nav-logo:hover { color: var(--accent-hover); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-links a {
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
    background: rgba(139,92,246,0.1);
}

.nav-search {
    flex: 1;
    max-width: 400px;
    position: relative;
}
.nav-search input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}
.nav-search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.nav-search input::placeholder { color: var(--text-muted); }
.nav-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.nav-mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 8px;
}

/* ============================================================
   HERO SLIDER
   ============================================================ */
.hero {
    margin-top: var(--nav-height);
    position: relative;
    height: 480px;
    overflow: hidden;
    background: var(--bg-secondary);
}
.hero-slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}
.hero-slide.active {
    opacity: 1;
    pointer-events: all;
}
.hero-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center top;
    filter: blur(4px) brightness(0.35);
    transform: scale(1.05);
}
.hero-gradient {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(to right, rgba(11,11,18,0.95) 0%, rgba(11,11,18,0.6) 50%, rgba(11,11,18,0.3) 100%),
                linear-gradient(to top, var(--bg-primary) 0%, transparent 40%);
}
.hero-content {
    position: relative;
    z-index: 2;
    height: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 40px;
}
.hero-poster {
    flex-shrink: 0;
    width: 200px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--border);
}
.hero-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 3/4.2;
}
.hero-info {
    flex: 1;
    max-width: 600px;
}
.hero-info .anime-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.hero-info .badge {
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-airing { background: var(--green); color: #000; }
.badge-upcoming { background: var(--orange); color: #000; }
.badge-type { background: var(--accent); color: #fff; }
.badge-score { background: rgba(234,179,8,0.2); color: var(--yellow); }
.badge-eps { background: rgba(6,182,212,0.2); color: var(--cyan); }

.hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 12px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.hero-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hero-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.hero-meta span { display: flex; align-items: center; gap: 6px; }
.hero-meta i { color: var(--accent); font-size: 0.8rem; }

.btn-watch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--accent);
    color: #fff;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: var(--transition);
    box-shadow: var(--shadow-accent);
}
.btn-watch:hover {
    background: var(--accent-hover);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(139,92,246,0.4);
}
.btn-watch i { font-size: 0.85rem; }

.hero-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}
.hero-dots button {
    width: 10px; height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: var(--transition);
}
.hero-dots button.active {
    background: var(--accent);
    width: 28px;
    border-radius: 5px;
}

/* ============================================================
   CONTENT SECTIONS
   ============================================================ */
.section {
    padding: 30px 0;
}
.section + .section {
    border-top: 1px solid var(--border-light);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 0 20px;
}
.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title i {
    color: var(--accent);
    font-size: 1.1rem;
}
.section-link {
    color: var(--accent);
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.section-link:hover { color: var(--accent-hover); gap: 10px; }

/* ============================================================
   ANIME CARDS GRID
   ============================================================ */
.anime-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    padding: 0 20px;
}

.anime-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}
.anime-card:hover {
    transform: translateY(-6px);
}
.anime-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}
.anime-card-poster {
    position: relative;
    aspect-ratio: 3/4.2;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--bg-card);
}
.anime-card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.anime-card:hover .anime-card-poster img {
    transform: scale(1.08);
}

.anime-card-score {
    position: absolute;
    top: 8px; left: 8px;
    padding: 3px 8px;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--yellow);
    display: flex;
    align-items: center;
    gap: 4px;
}
.anime-card-score i { font-size: 0.65rem; }

.anime-card-type {
    position: absolute;
    top: 8px; right: 8px;
    padding: 3px 8px;
    background: var(--accent);
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
}

.anime-card-eps {
    position: absolute;
    bottom: 8px; right: 8px;
    padding: 2px 7px;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--cyan);
}

.anime-card-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(139,92,246,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}
.anime-card:hover .anime-card-overlay {
    opacity: 1;
}
.anime-card-overlay i {
    font-size: 2rem;
    color: #fff;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

.anime-card-info {
    padding: 10px 2px 4px;
}
.anime-card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: var(--transition);
}
.anime-card:hover .anime-card-title {
    color: var(--accent);
}

/* ============================================================
   GENRE CHIPS
   ============================================================ */
.genre-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    padding: 0 20px;
}
.genre-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.88rem;
    transition: var(--transition);
    text-decoration: none;
}
.genre-chip:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-accent);
}
.genre-chip i { font-size: 1rem; width: 20px; text-align: center; }

/* ============================================================
   ANIME DETAIL PAGE
   ============================================================ */
.anime-detail {
    margin-top: var(--nav-height);
    padding: 40px 20px;
}
.anime-detail-hero {
    display: flex;
    gap: 32px;
    margin-bottom: 40px;
}
.anime-detail-poster {
    flex-shrink: 0;
    width: 260px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--border);
}
.anime-detail-poster img {
    width: 100%;
    aspect-ratio: 3/4.2;
    object-fit: cover;
}
.anime-detail-info {
    flex: 1;
    min-width: 0;
}
.anime-detail-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.25;
}
.anime-detail-info .anime-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 32px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}
.detail-meta-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.detail-meta-item .label {
    color: var(--text-muted);
    font-weight: 600;
    min-width: 80px;
}
.detail-meta-item .value {
    color: var(--text-secondary);
}
.detail-meta-item .value a {
    color: var(--accent);
}

.anime-synopsis {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

.anime-genres-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.genre-tag {
    padding: 6px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
}
.genre-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(139,92,246,0.1);
}

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

/* ============================================================
   EPISODES SECTION
   ============================================================ */
.episodes-section {
    margin-top: 40px;
}
.episodes-section .section-title {
    margin-bottom: 20px;
}

/* Tabs for servers */
.server-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.server-tab {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}
.server-tab:hover, .server-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.server-tab .ep-count {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 50px;
}

.episode-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 8px;
}

.episode-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-primary);
}
.episode-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateX(4px);
}
.episode-item.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.episode-num {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(139,92,246,0.15);
    font-size: 0.82rem;
    font-weight: 700;
    flex-shrink: 0;
}
.episode-item.active .episode-num,
.episode-item:hover .episode-num {
    background: rgba(255,255,255,0.2);
    color: inherit;
}
.episode-title-text {
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.no-episodes {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.no-episodes i {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
    color: var(--border);
}

/* ============================================================
   WATCH PAGE
   ============================================================ */
.watch-page {
    margin-top: var(--nav-height);
}
.video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: #000;
    border-bottom: 2px solid var(--border);
}
.video-container iframe,
.video-container video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}
.video-placeholder {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 16px;
    background: var(--bg-secondary);
}
.video-placeholder i { font-size: 4rem; color: var(--border); }
.video-placeholder p { font-size: 1.1rem; }

/* Server switch on watch page */
.server-switch {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
    align-items: center;
}
.server-switch-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 8px;
}
.server-btn {
    padding: 8px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}
.server-btn i {
    font-size: 0.9rem;
}
.server-btn:hover, .server-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-accent);
}
.server-btn.loading {
    opacity: 0.8;
    pointer-events: none;
    background: var(--bg-card-hover);
    border-color: var(--accent);
    color: var(--accent);
}
.server-btn.error {
    background: rgba(239,68,68,0.1);
    border-color: var(--red);
    color: var(--red);
    opacity: 0.7;
}
.server-btn.error:hover {
    opacity: 1;
    background: rgba(239,68,68,0.2);
    cursor: pointer;
}

.watch-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 0;
    min-height: calc(100vh - var(--nav-height) - 56.25vw);
}

.watch-info-panel {
    padding: 24px;
    border-right: 1px solid var(--border-light);
}
.watch-anime-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 12px;
}
.watch-episode-title {
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 16px;
}
.watch-synopsis {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 20px;
}
.watch-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}
.watch-meta span { display: flex; align-items: center; gap: 6px; }

.watch-episode-list {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(100vh - var(--nav-height) - 100px);
}
.watch-episode-list h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}
.watch-episode-list .episode-list {
    display: grid;
    gap: 6px;
}
/* Scrollbar for episode sidebar */
#episodeList::-webkit-scrollbar { width: 5px; }
#episodeList::-webkit-scrollbar-track { background: var(--bg-secondary); border-radius: 4px; }
#episodeList::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
#episodeList::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ============================================================
   SEARCH PAGE
   ============================================================ */
.search-page {
    margin-top: calc(var(--nav-height) + 20px);
    padding: 0 20px;
}
.search-header {
    margin-bottom: 24px;
}
.search-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.search-count {
    color: var(--text-muted);
    font-size: 0.9rem;
}
.search-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.filter-select {
    padding: 10px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.88rem;
    outline: none;
    cursor: pointer;
    min-width: 140px;
}
.filter-select:focus {
    border-color: var(--accent);
}

/* ============================================================
   GENRE PAGE
   ============================================================ */
.genre-page {
    margin-top: calc(var(--nav-height) + 20px);
    padding: 0 20px;
}
.genre-page-header {
    margin-bottom: 24px;
}
.genre-page-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
}
.genre-page-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}
.genre-subnav {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 8px;
}
.genre-subnav a {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    transition: var(--transition);
}
.genre-subnav a:hover, .genre-subnav a.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 40px 20px;
}
.page-btn {
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.88rem;
    transition: var(--transition);
    text-decoration: none;
}
.page-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    color: var(--accent);
}
.page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.page-dots {
    padding: 10px 8px;
    color: var(--text-muted);
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb ol {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.breadcrumb li::before {
    content: '/';
    margin-right: 8px;
    color: var(--border);
}
.breadcrumb li:first-child::before { display: none; }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .active { color: var(--accent); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    margin-top: 60px;
    padding: 48px 20px 24px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
}
.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer-brand h3 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 12px;
}
.footer-brand p {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.7;
}
.footer-col h4 {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul a {
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: var(--transition);
}
.footer-col ul a:hover { color: var(--accent); padding-left: 4px; }
.footer-bottom {
    max-width: var(--max-width);
    margin: 0 auto;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.footer-bottom-links {
    display: flex;
    gap: 16px;
}
.footer-bottom-links a { color: var(--text-muted); }
.footer-bottom-links a:hover { color: var(--accent); }

/* ============================================================
   LOADING & EMPTY STATES
   ============================================================ */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.loading-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 4rem;
    margin-bottom: 16px;
    color: var(--border);
    display: block;
}
.empty-state h3 {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
    .anime-grid { grid-template-columns: repeat(5, 1fr); }
    .genre-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1024px) {
    .anime-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
    .watch-layout { grid-template-columns: 1fr; }
    .watch-episode-list { max-height: 400px; border-top: 1px solid var(--border-light); }
    .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--nav-height);
        left: 0; right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
        padding: 16px;
        gap: 4px;
    }
    .nav-mobile-toggle { display: block; }

    .hero { height: 420px; }
    .hero-poster { width: 140px; }
    .hero-title { font-size: 1.5rem; }
    .hero-desc { font-size: 0.85rem; -webkit-line-clamp: 2; }
    .hero-content { gap: 20px; }

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

    .anime-detail-hero { flex-direction: column; align-items: center; }
    .anime-detail-poster { width: 200px; }
    .anime-detail-title { font-size: 1.5rem; text-align: center; }
    .detail-meta-grid { grid-template-columns: 1fr; }

    .footer-inner { grid-template-columns: 1fr; gap: 24px; }
    .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}
@media (max-width: 480px) {
    .anime-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .genre-grid { grid-template-columns: repeat(2, 1fr); }
    .hero { height: 380px; }
    .hero-poster { width: 110px; }
    .hero-title { font-size: 1.2rem; }
    .hero-meta { gap: 10px; font-size: 0.78rem; }
    .section-title { font-size: 1.1rem; }
    .episode-list { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   UTILITY
   ============================================================ */
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.fw-bold { font-weight: 700; }