/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-start: #8b5cf6;
    --accent-end: #ec4899;
    --accent-gradient: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    --accent-glow: rgba(139, 92, 246, 0.3);
    --success: #10b981;
    --warning: #f59e0b;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --nav-height: 64px;
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    color: inherit;
}

ul,
ol {
    list-style: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(10, 14, 26, 0.95);
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    z-index: 10;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: white;
}

.logo-text {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo-accent {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Search Bar */
.nav-search {
    flex: 1;
    max-width: 480px;
    margin: 0 auto;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
    transition: var(--transition);
}

#searchInput {
    width: 100%;
    padding: 10px 40px 10px 42px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 50px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

#searchInput::placeholder {
    color: var(--text-muted);
}

#searchInput:focus {
    background: var(--bg-glass-hover);
    border-color: var(--accent-start);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

#searchInput:focus~.search-icon,
#searchInput:focus+.search-icon {
    color: var(--accent-start);
}

.search-clear {
    position: absolute;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-muted);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.search-clear.visible {
    opacity: 1;
    pointer-events: all;
}

.search-clear:hover {
    color: var(--text-primary);
}

/* Nav Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-search-toggle,
.nav-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-search-toggle:hover,
.nav-menu-toggle:hover {
    background: var(--bg-glass-hover);
}

.nav-search-toggle svg {
    width: 20px;
    height: 20px;
}

.nav-menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
    margin: 3px 0;
}

.nav-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(3.5px, 3.5px);
}

.nav-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(3.5px, -3.5px);
}

/* Nav Links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    white-space: nowrap;
}

.nav-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-glass-hover);
}

.nav-link.active {
    color: var(--text-primary);
    background: var(--bg-glass-hover);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--accent-gradient);
    border-radius: 1px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    min-height: calc(100vh - var(--nav-height));
    padding-top: var(--nav-height);
}

/* ===== HERO SECTION ===== */
.hero {
    position: relative;
    padding: 60px 20px 40px;
    text-align: center;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 20%, rgba(139, 92, 246, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(236, 72, 153, 0.08) 0%, transparent 50%);
    animation: heroGlow 8s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes heroGlow {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-5%, 5%);
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}

.hero h1 {
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.hero h1 .gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: clamp(14px, 2vw, 18px);
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

/* ===== SECTION ===== */
.section {
    padding: 30px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
}

.section-title {
    font-size: clamp(18px, 3vw, 24px);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title .title-icon {
    width: 32px;
    height: 32px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.section-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--accent-start);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
    white-space: nowrap;
}

.section-link:hover {
    color: var(--accent-end);
    gap: 8px;
}

/* ===== DRAMA GRID ===== */
.drama-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

.drama-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    transition: var(--transition);
    cursor: pointer;
    animation: fadeInUp 0.5s ease both;
}

.drama-card:hover {
    transform: translateY(-6px);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 12px 40px rgba(139, 92, 246, 0.15);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-poster {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: var(--bg-secondary);
}

.card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.drama-card:hover .card-poster img {
    transform: scale(1.08);
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 60%);
    opacity: 0;
    transition: var(--transition);
    display: flex;
    align-items: flex-end;
    padding: 16px 12px;
}

.drama-card:hover .card-overlay {
    opacity: 1;
}

.card-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 48px;
    height: 48px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.drama-card:hover .card-play-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.card-play-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
    margin-left: 2px;
}

.card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

.badge-episodes {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    color: var(--text-primary);
}

.badge-rank {
    position: absolute;
    top: 8px;
    right: 8px;
    left: auto;
    background: var(--accent-gradient);
    color: white;
}

.card-info {
    padding: 12px;
}

.card-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.card-tag {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg-glass);
    color: var(--text-muted);
    border: 1px solid var(--border-glass);
}

/* ===== DETAIL PAGE ===== */
.detail-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.detail-hero {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
}

.detail-backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.detail-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(30px) brightness(0.3);
    transform: scale(1.2);
}

.detail-content {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 30px;
    padding: 30px;
}

.detail-poster {
    flex-shrink: 0;
    width: 220px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.detail-poster img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
}

.detail-info {
    flex: 1;
    min-width: 0;
}

.detail-title {
    font-size: clamp(22px, 4vw, 32px);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.detail-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.detail-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.detail-stat svg {
    width: 16px;
    height: 16px;
}

.detail-stat .stat-value {
    font-weight: 600;
    color: var(--text-primary);
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.detail-tag {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    transition: var(--transition);
}

.detail-tag:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

.detail-synopsis {
    margin-bottom: 24px;
}

.detail-synopsis h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.detail-synopsis p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.detail-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-glass-hover);
}

.btn svg {
    width: 18px;
    height: 18px;
}

/* Episodes Section */
.episodes-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.episodes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.episodes-title {
    font-size: 20px;
    font-weight: 700;
}

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.episode-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.episode-card:hover {
    background: var(--bg-glass-hover);
    border-color: var(--accent-start);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.episode-card.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 16px var(--accent-glow);
}

/* ===== WATCH PAGE ===== */
.watch-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.watch-info {
    margin-bottom: 24px;
}

.watch-title {
    font-size: clamp(18px, 3vw, 24px);
    font-weight: 700;
    margin-bottom: 8px;
}

.watch-episode-label {
    font-size: 14px;
    color: var(--accent-start);
    font-weight: 600;
}

.watch-nav {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
}

/* ===== TIKTOK-STYLE SCROLL PLAYER (Mobile) ===== */
.scroll-player {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: #000;
    z-index: 2000;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.scroll-player::-webkit-scrollbar {
    display: none;
}

.scroll-slide {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
}

.scroll-slide video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.scroll-slide-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 80px 16px 24px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    pointer-events: none;
    z-index: 10;
}

.scroll-slide-overlay * {
    pointer-events: auto;
}

.scroll-ep-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.scroll-ep-number {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-start);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* Action buttons on right side */
.scroll-actions {
    position: absolute;
    right: 12px;
    bottom: 120px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    z-index: 10;
}

.scroll-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #fff;
    cursor: pointer;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
}

.scroll-action-btn svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: white;
    stroke-width: 2;
}

.scroll-action-btn span {
    font-size: 10px;
    font-weight: 600;
}

/* Close & nav buttons */
.scroll-close {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 2010;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    border: none;
}

.scroll-ep-indicator {
    position: fixed;
    top: 16px;
    right: 12px;
    z-index: 2010;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

/* Swipe hint animation */
.scroll-hint {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2010;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.6);
    animation: swipeHintAnim 2s ease-in-out infinite;
    pointer-events: none;
}

.scroll-hint svg {
    width: 24px;
    height: 24px;
    stroke: rgba(255, 255, 255, 0.6);
    fill: none;
    stroke-width: 2;
}

.scroll-hint span {
    font-size: 11px;
    font-weight: 500;
}

@keyframes swipeHintAnim {

    0%,
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    50% {
        opacity: 0.4;
        transform: translateX(-50%) translateY(-10px);
    }
}

.scroll-hint.hidden {
    display: none;
}

/* Loading spinner in scroll slides */
.scroll-slide .spinner-small {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-start);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Hide scroll player on desktop */
@media (min-width: 769px) {
    .scroll-player {
        display: none !important;
    }
}

/* When scroll player is active, hide navbar and other elements */
body.scroll-player-active {
    overflow: hidden;
}

body.scroll-player-active .navbar,
body.scroll-player-active .main-content,
body.scroll-player-active .footer,
body.scroll-player-active .back-to-top,
body.scroll-player-active .mobile-nav {
    display: none !important;
}

/* Scroll player ads */
.scroll-ad-banner {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.scroll-ad-pause {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    border-radius: 12px;
    overflow: hidden;
    display: none;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    padding: 12px;
    text-align: center;
}

.scroll-ad-pause.visible {
    display: block;
}

.scroll-ad-pause .ad-label {
    position: static;
    display: block;
    margin-bottom: 6px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

.scroll-preroll {
    position: absolute;
    inset: 0;
    z-index: 25;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.scroll-preroll .preroll-timer {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.scroll-preroll .preroll-skip {
    padding: 8px 20px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: none;
}

.scroll-preroll .preroll-skip.visible {
    display: block;
}

/* ===== LOADING / SKELETON ===== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-glass-hover) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-card {
    border-radius: var(--radius-md);
    overflow: hidden;
}

.skeleton-poster {
    aspect-ratio: 3/4;
    background: linear-gradient(90deg, var(--bg-secondary) 25%, rgba(255, 255, 255, 0.05) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-text {
    height: 14px;
    margin: 12px;
    border-radius: 4px;
}

.skeleton-text-sm {
    height: 10px;
    width: 60%;
    margin: 0 12px 12px;
    border-radius: 4px;
}

/* ===== PAGE HEADER (for trending/latest/dubindo pages) ===== */
.page-header {
    padding: 40px 20px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.page-header h1 {
    font-size: clamp(22px, 4vw, 32px);
    font-weight: 800;
}

.page-header p {
    color: var(--text-secondary);
    margin-top: 8px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ===== LOADING SPINNER ===== */
.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-glass);
    border-top-color: var(--accent-start);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== BACK TO TOP ===== */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px var(--accent-glow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-3px);
}

.back-to-top svg {
    width: 20px;
    height: 20px;
    color: white;
}

/* ===== FOOTER ===== */
.footer {
    border-top: 1px solid var(--border-glass);
    padding: 40px 20px;
    margin-top: 40px;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    margin-bottom: 20px;
}

.footer-brand .logo-icon,
.footer-brand .logo-text {
    display: inline-flex;
    vertical-align: middle;
}

.footer-desc {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 12px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.footer-bottom p {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== SEARCH RESULTS PAGE ===== */
.search-results-header {
    padding: 40px 20px 0;
    max-width: 1400px;
    margin: 0 auto;
}

.search-results-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.search-results-header .search-query {
    color: var(--accent-start);
}

/* ===== RESPONSIVE ===== */

/* Tablet */
@media (max-width: 1024px) {
    .detail-poster {
        width: 180px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --nav-height: 56px;
    }

    .nav-search {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: var(--nav-height);
        max-width: 100%;
        background: rgba(10, 14, 26, 0.98);
        backdrop-filter: blur(20px);
        padding: 8px 16px;
        display: none;
        align-items: center;
        z-index: 1001;
    }

    .nav-search.active {
        display: flex;
    }

    .nav-search-toggle,
    .nav-menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: rgba(10, 14, 26, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-glass);
        display: flex;
        align-items: center;
        justify-content: space-around;
        gap: 0;
        z-index: 1000;
        padding: 0 8px;
    }

    .nav-link {
        flex-direction: column;
        gap: 2px;
        padding: 6px 12px;
        font-size: 10px;
        position: relative;
    }

    .nav-link svg {
        width: 20px;
        height: 20px;
    }

    .main-content {
        padding-bottom: 60px;
    }

    .drama-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 12px;
    }

    .hero {
        padding: 40px 16px 20px;
    }

    .detail-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px;
    }

    .detail-poster {
        width: 180px;
    }

    .detail-tags {
        justify-content: center;
    }

    .detail-actions {
        justify-content: center;
    }

    .detail-stats {
        justify-content: center;
    }

    .episodes-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }

    .episode-card {
        padding: 10px 8px;
        font-size: 13px;
    }

    .section {
        padding: 20px 16px;
    }

    .watch-nav {
        flex-wrap: wrap;
    }

    .back-to-top {
        bottom: 76px;
    }
}

@media (max-width: 480px) {
    .drama-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .card-info {
        padding: 8px;
    }

    .card-title {
        font-size: 11px;
    }

    .card-tag {
        font-size: 9px;
    }
}

/* Landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 20px 16px 10px;
    }

    .hero h1 {
        font-size: 24px;
    }
}

/* ===== AD CONTAINERS ===== */
.ad-container {
    max-width: 1400px;
    margin: 10px auto;
    padding: 0 20px;
    text-align: center;
}

.ad-slot {
    position: relative;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 12px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ad-slot-banner {
    min-height: 100px;
}

.ad-slot-video {
    margin-top: 16px;
    min-height: 90px;
}

.ad-slot-native {
    min-height: 250px;
}

.ad-label {
    position: absolute;
    top: 4px;
    right: 8px;
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
}

.ad-slot:empty::after {
    content: '';
    display: none;
}

@media (max-width: 768px) {
    .ad-container {
        padding: 0 16px;
    }

    .ad-slot-native {
        min-height: 200px;
    }
}