/* ============================================
   a002 - Emerald Dark Immersive Theme
   Accent: #10b981 (Emerald)  Background: #0f0f0f
   Netflix-style dark immersive design
   ============================================ */

/* Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif; font-size: 14px; color: #e5e5e5; background: #0f0f0f; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; transition: color .2s; }
a:hover { color: #10b981; }
ul, ol { list-style: none; }
img { max-width: 100%; border: 0; vertical-align: middle; display: block; }
input, button { border: none; outline: none; font-family: inherit; -webkit-appearance: none; }
.hide { display: none !important; }

/* Layout */
.layout { max-width: 1400px; margin: 0 auto; padding: 0 24px; }

/* ============================================
   Header - Fixed dark transparent bar
   ============================================ */
.header { position: fixed; top: 0; left: 0; right: 0; z-index: 2000; background: linear-gradient(to bottom, rgba(0,0,0,.9) 0%, transparent 100%); padding: 16px 0; transition: background .3s; }
.header-inner { display: flex; align-items: center; justify-content: space-between; max-width: 1400px; margin: 0 auto; padding: 0 24px; }
.logo { font-size: 24px; font-weight: 700; color: #10b981; letter-spacing: -0.5px; }
.logo:hover { color: #10b981; }

/* Nav */
.nav-main { display: flex; gap: 8px; }
.nav-main a { padding: 8px 16px; font-size: 14px; color: #b3b3b3; border-radius: 4px; transition: all .2s; }
.nav-main a:hover { color: #fff; background: rgba(255,255,255,.1); }
.nav-main a.active { color: #fff; font-weight: 600; }

/* Header Actions */
.header-actions { display: flex; align-items: center; gap: 12px; }

/* Search Box */
.search-box { display: flex; align-items: center; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.1); border-radius: 4px; overflow: hidden; transition: border-color .2s, background .2s; }
.search-box:focus-within { border-color: #10b981; background: rgba(16,185,129,.1); }
.search-box input { width: 160px; height: 36px; padding: 0 12px; background: transparent; color: #fff; font-size: 13px; }
.search-box input::placeholder { color: #666; }
.search-box button { width: 36px; height: 36px; background: transparent; color: #999; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: color .2s; }
.search-box button:hover { color: #10b981; }
.search-box svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }

/* Menu Toggle */
.menu-toggle { display: none; width: 40px; height: 40px; background: transparent; cursor: pointer; position: relative; }
.menu-toggle span, .menu-toggle::before, .menu-toggle::after { content: ""; position: absolute; left: 10px; width: 20px; height: 2px; background: #fff; transition: .2s; }
.menu-toggle::before { top: 13px; }
.menu-toggle span { top: 19px; }
.menu-toggle::after { top: 25px; }
.menu-toggle.active::before { top: 19px; transform: rotate(45deg); }
.menu-toggle.active span { opacity: 0; }
.menu-toggle.active::after { top: 19px; transform: rotate(-45deg); }

/* ============================================
   Main Content
   ============================================ */
main { padding-top: 80px; min-height: 100vh; }

/* Sections */
.featured-section { padding: 24px 0; }
.category-section { padding: 32px 0; }
.related-block { padding: 40px 0 24px; }

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title { font-size: 20px; font-weight: 600; color: #fff; margin-bottom: 20px; }
.section-header .section-title { margin-bottom: 0; }
.more-link { font-size: 13px; color: #666; transition: color .2s; }
.more-link:hover { color: #10b981; }

.page-header { padding: 24px 0 20px; }
.page-header h1 { font-size: 28px; font-weight: 700; color: #fff; }

/* ============================================
   Video Grid - Netflix card style
   ============================================ */
.video-grid { display: grid; gap: 16px; }
.cols-5 { grid-template-columns: repeat(5, 1fr); }

.card { position: relative; border-radius: 6px; overflow: hidden; background: #1a1a1a; transition: transform .3s, box-shadow .3s; }
.card:hover { transform: scale(1.05); z-index: 10; box-shadow: 0 8px 40px rgba(0,0,0,.6); }

.card-thumb { position: relative; display: block; padding-bottom: 150%; overflow: hidden; }
.card-thumb img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-thumb img { transform: scale(1.1); }

.card-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.8) 0%, transparent 50%); opacity: 0; transition: opacity .3s; display: flex; align-items: center; justify-content: center; }
.card:hover .card-overlay { opacity: 1; }
.play-icon { width: 50px; height: 50px; border-radius: 50%; background: rgba(16,185,129,.9); display: flex; align-items: center; justify-content: center; transform: scale(0); transition: transform .3s; }
.play-icon::after { content: ""; border-style: solid; border-width: 8px 0 8px 14px; border-color: transparent transparent transparent #fff; margin-left: 3px; }
.card:hover .play-icon { transform: scale(1); }

.card-badge { position: absolute; top: 8px; right: 8px; padding: 4px 8px; background: rgba(16,185,129,.9); color: #fff; font-size: 11px; font-weight: 600; border-radius: 3px; }

.card-body { padding: 12px; }
.card-title { font-size: 14px; color: #e5e5e5; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.card-title:hover { color: #10b981; }

/* ============================================
   Breadcrumb
   ============================================ */
.breadcrumb { padding: 16px 0; font-size: 13px; color: #666; }
.breadcrumb a { color: #999; }
.breadcrumb a:hover { color: #10b981; }
.breadcrumb .sep { margin: 0 8px; color: #444; }

/* ============================================
   Detail Page - Hero style with backdrop
   ============================================ */
.detail-hero { position: relative; margin: 0 -24px; padding: 60px 24px 40px; overflow: hidden; }
.detail-backdrop { position: absolute; inset: 0; background-size: cover; background-position: center; filter: blur(30px) brightness(0.3); transform: scale(1.2); }
.detail-backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to right, rgba(15,15,15,.95) 30%, rgba(15,15,15,.7) 100%); }

.detail-content { position: relative; display: flex; gap: 40px; max-width: 1400px; margin: 0 auto; }
.detail-poster { width: 260px; flex-shrink: 0; border-radius: 8px; overflow: hidden; box-shadow: 0 8px 40px rgba(0,0,0,.5); }
.detail-poster img { width: 100%; display: block; }

.detail-info { flex: 1; padding: 16px 0; }
.detail-info h1 { font-size: 32px; font-weight: 700; color: #fff; margin-bottom: 16px; }
.score { display: inline-flex; align-items: baseline; gap: 4px; margin-bottom: 20px; }
.score-num { font-size: 36px; font-weight: 700; color: #10b981; }
.score-label { font-size: 14px; color: #10b981; }

.meta-tags { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.meta-tags li { padding: 4px 12px; background: rgba(255,255,255,.1); border-radius: 4px; font-size: 12px; color: #ccc; }

.meta-info { margin-bottom: 24px; }
.meta-info p { color: #999; margin-bottom: 8px; font-size: 14px; }
.meta-info .label { color: #666; }

.btn-play { display: inline-flex; align-items: center; gap: 8px; padding: 14px 36px; background: #10b981; color: #fff; font-size: 16px; font-weight: 600; border-radius: 6px; transition: background .2s, transform .2s; }
.btn-play:hover { background: #059669; transform: scale(1.03); color: #fff; }
.btn-play.disabled { background: #333; color: #666; cursor: not-allowed; }

/* Source & Episodes - Horizontal scroll */
.source-block { padding: 24px 0; border-bottom: 1px solid #222; }
.source-name { font-size: 15px; color: #10b981; margin-bottom: 16px; }
.ep-scroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; scrollbar-color: #333 transparent; }
.ep-scroll::-webkit-scrollbar { height: 4px; }
.ep-scroll::-webkit-scrollbar-track { background: transparent; }
.ep-scroll::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }
.ep-item { flex-shrink: 0; padding: 10px 20px; background: #1a1a1a; color: #ccc; font-size: 13px; border-radius: 4px; border: 1px solid #333; transition: all .2s; white-space: nowrap; }
.ep-item:hover { background: #222; border-color: #10b981; color: #10b981; }
.ep-item.current { background: #10b981; color: #fff; border-color: #10b981; font-weight: 600; }

/* Description */
.desc-block { padding: 32px 0; }
.desc-block h3 { font-size: 18px; color: #fff; margin-bottom: 16px; }
.desc-block p { color: #999; line-height: 1.8; }

/* ============================================
   Player - Full width dark
   ============================================ */
.player-wrap { background: #000; }
.player-container { position: relative; width: 100%; max-width: 900px; margin: 0 auto; aspect-ratio: 16/9; background: #000; }
.player-container iframe, .player-container video, .player-container embed, .player-container object { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.player-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #111; z-index: 2; color: #666; gap: 16px; }
.spinner { width: 48px; height: 48px; border: 3px solid #222; border-top-color: #10b981; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.play-title { font-size: 22px; color: #fff; padding: 24px 0 16px; }

/* ============================================
   Paging - Minimal arrow style
   ============================================ */
.paging { display: flex; justify-content: center; align-items: center; padding: 40px 0; gap: 16px; }
.paging ul { display: flex; gap: 8px; align-items: center; }
.paging ul li a, .paging a { display: inline-block; min-width: 36px; height: 36px; line-height: 36px; text-align: center; padding: 0 12px; background: #1a1a1a; color: #999; font-size: 13px; border-radius: 4px; transition: all .2s; }
.paging ul li a:hover, .paging a:hover { background: #222; color: #10b981; }
.paging ul li.active a, .paging .active a { background: #10b981; color: #fff; font-weight: 600; }
.paging ul li.disabled a, .paging .disabled a { background: #111; color: #444; cursor: not-allowed; }

/* Empty State */
.empty-state { text-align: center; padding: 60px 0; color: #666; }

/* ============================================
   Footer
   ============================================ */
.footer { margin-top: 60px; padding: 40px 0; background: #0a0a0a; border-top: 1px solid #1a1a1a; text-align: center; }
.footer-nav { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.footer-nav a { color: #666; font-size: 13px; }
.footer-nav a:hover { color: #10b981; }
.footer-nav .dot { color: #333; }
.footer-copy { font-size: 12px; color: #444; }

/* ============================================
   Responsive
   ============================================ */

/* Tablet ≤1024px */
@media (max-width: 1024px) {
    .cols-5 { grid-template-columns: repeat(4, 1fr); }
    .detail-poster { width: 200px; }
    .detail-info h1 { font-size: 26px; }
    .nav-main { display: none; position: fixed; top: 60px; left: 0; right: 0; background: rgba(15,15,15,.98); backdrop-filter: blur(20px); flex-direction: column; padding: 24px; gap: 0; z-index: 1999; }
    .nav-main.show { display: flex; }
    .nav-main a { padding: 16px 0; border-bottom: 1px solid #222; font-size: 16px; color: #ccc; border-radius: 0; }
    .nav-main a.active { background: transparent; color: #10b981; }
    .menu-toggle { display: block; }
}

/* Mobile ≤768px */
@media (max-width: 768px) {
    .layout { padding: 0 16px; }
    .header-inner { padding: 0 16px; }
    main { padding-top: 70px; }
    .cols-5 { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .search-box { display: none; }
    .detail-hero { padding: 30px 16px; }
    .detail-content { flex-direction: column; gap: 24px; }
    .detail-poster { width: 140px; }
    .detail-info h1 { font-size: 22px; }
    .score-num { font-size: 28px; }
    .page-header h1 { font-size: 22px; }
    .section-title { font-size: 18px; }
}

/* Small phone ≤480px */
@media (max-width: 480px) {
    .cols-5 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .card-body { padding: 10px; }
    .card-title { font-size: 13px; }
    .ep-item { padding: 8px 14px; font-size: 12px; }
    .paging ul li a, .paging a { min-width: 32px; height: 32px; line-height: 32px; padding: 0 10px; font-size: 12px; }
}
