/* 
 * Premium Movie Platform - Core Design System
 * 2026 Hyper-Sensory Dark Mode
 */

:root { 
    --movie-bg: #111319; 
    --movie-card-bg: #1c1e24; 
    --movie-text: #ffffff; 
    --movie-text-muted: #999999; 
    --movie-primary: #3b82f6; 
    --movie-accent: #ef4444;
    --movie-border: rgba(255, 255, 255, 0.05);
}

body { background: var(--movie-bg); color: var(--movie-text); margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; width: 100%; overflow-x: hidden; }
body::before, body::after { content: none !important; } /* Kill any rogue overlays */

.movie-wrap { width: 1400px; max-width: 95%; margin: 0 auto; padding: 0 20px; box-sizing: border-box; position: relative; }

/* --- Navigation Header --- */
.mov-header { height: 64px; background: #111319; border-bottom: 1px solid var(--movie-border); position: sticky; top: 0; z-index: 1000; width: 100%; box-shadow: 0 4px 20px rgba(0,0,0,0.5); }
.mov-nav-container { width: 1400px; max-width: 95%; margin: 0 auto; height: 100%; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; box-sizing: border-box; }
.mov-nav-left { flex: none; display: flex; align-items: center; gap: 30px; }
.mov-logo { font-size: 20px; font-weight: bold; color: var(--movie-primary); text-decoration: none; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.mov-menu { display: flex; align-items: center; gap: 24px; }
.mov-menu-item { color: var(--movie-text); text-decoration: none; font-size: 15px; font-weight: normal; opacity: 0.8; transition: all 0.2s; white-space: nowrap; }
.mov-menu-item:hover, .mov-menu-item.active { opacity: 1; color: var(--movie-primary); font-weight: 500; }
.mov-nav-center { flex: 1; display: flex; justify-content: center; margin: 0 40px; }
.mov-search-box { position: relative; width: 100%; max-width: 450px; }
.mov-search-input { width: 100%; height: 40px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; padding: 0 20px 0 45px; color: #fff; font-size: 14px; outline: none; transition: all 0.3s; }
.mov-search-input:focus { border-color: var(--movie-primary); background: rgba(255,255,255,0.08); box-shadow: 0 0 15px rgba(59,130,246,0.2); }
.mov-search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--movie-text-muted); font-size: 16px; }
.mov-nav-right { flex: none; display: flex; align-items: center; gap: 20px; }
.mov-nav-link { color: var(--movie-text-muted); text-decoration: none; font-size: 14px; display: flex; align-items: center; gap: 6px; transition: color 0.2s; }
.mov-nav-link:hover { color: #fff; }
.mov-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--movie-card-bg); display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; }
.mov-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* --- Hero Section & Carousel --- */
.hero-box { display: grid; grid-template-columns: 2.5fr 1fr; gap: 20px; margin-top: 25px; margin-bottom: 40px; }
.hero-featured { position: relative; border-radius: 8px; overflow: hidden; background: var(--movie-card-bg); height: 400px; }
.hero-featured img { width: 100%; height: 100%; object-fit: cover; }
.hero-feat-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(17,19,25, 0.95) 0%, rgba(17,19,25, 0.4) 50%, transparent 100%); display: flex; flex-direction: column; justify-content: flex-end; padding: 30px; }
.h-title { font-size: 28px; font-weight: bold; color: #fff; margin-bottom: 6px; }
.h-sub { font-size: 14px; color: #ccc; margin-bottom: 12px; }
.h-desc { font-size: 13px; color: #999; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-list { display: flex; flex-direction: column; gap: 15px; }
.h-item { display: flex; gap: 15px; background: rgba(255,255,255,0.02); border-radius: 6px; text-decoration: none; overflow: hidden; height: 123px; transition: background 0.3s; }
.h-item:hover { background: rgba(255,255,255,0.05); }
.h-item-thumb { width: 85px; height: 100%; flex-shrink: 0; position: relative; overflow: hidden; }
.h-item-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.h-item:hover .h-item-thumb img { transform: scale(1.05); }
.h-item-info { flex: 1; padding: 15px 15px 15px 0; display: flex; flex-direction: column; justify-content: center; }
.h-item-name { color: #fff; font-size: 15px; font-weight: bold; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.h-item-meta { font-size: 12px; color: var(--movie-text-muted); }

/* --- Grid & Card System --- */
.sec-head { display: flex; justify-content: space-between; align-items: center; margin: 30px 0 15px; border-bottom: 1px solid var(--movie-border); padding-bottom: 15px; }
.sec-title { font-size: 20px; font-weight: bold; color: #fff; }
.sec-more { font-size: 13px; color: var(--movie-text-muted); text-decoration: none; display: flex; align-items: center; gap: 4px; transition: color 0.2s; }
.sec-more:hover { color: var(--movie-primary); }
.mov-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; width: 100%; }
.mov-card { text-decoration: none; display: flex; flex-direction: column; position: relative; min-width: 0; width: 100%; }
.mov-poster { width: 100%; position: relative; aspect-ratio: 2/3; border-radius: 6px; overflow: hidden; background: var(--movie-card-bg); flex-shrink: 0; }
.mov-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.mov-card:hover .mov-poster img { transform: scale(1.05); }
.badge-q-top { position: absolute; top: 6px; right: 6px; display: flex; flex-direction: column; gap: 4px; }
.q-tag { background: rgba(0,0,0,0.75); color: #ccc; font-size: 11px; padding: 2px 4px; border-radius: 2px; border: 1px solid rgba(255,255,255,0.1); line-height: 1.2; text-align: center; }
.badge-bottom { position: absolute; bottom: 0; left: 0; right: 0; padding: 20px 8px 8px; background: linear-gradient(to top, rgba(0,0,0,0.9), transparent); display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #fff; }
.badge-score-left { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.8); }
.badge-score-left .star { color: #ccc; font-size: 12px; margin-right: 2px; }
.mov-info { margin-top: 10px; width: 100%; }
.mov-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.mov-title { font-size: 14px; color: #efefef; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; margin-right: 10px; transition: color 0.2s; }
.mov-card:hover .mov-title { color: var(--movie-primary); }
.mov-score-text { color: var(--movie-accent); font-weight: bold; font-size: 14px; flex-shrink: 0; }
.mov-meta { font-size: 12px; color: var(--movie-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- Playback Page Layout --- */
.movie-page { background: var(--movie-bg); min-height: 100vh; padding-bottom: 80px; color: var(--movie-text); }
.play-layout { display: flex; gap: 20px; margin-top: 20px; }
.play-left { flex: 7; display: flex; flex-direction: column; background: var(--movie-card-bg); border-radius: 8px; overflow: hidden; }
.play-title-bar { padding: 15px 20px; font-size: 18px; font-weight: bold; border-bottom: 1px solid var(--movie-border); display: flex; justify-content: space-between; align-items: center; }
.play-title-bar span { color: var(--movie-primary); font-size: 14px; font-weight: normal; }
.player-box { width: 100%; aspect-ratio: 16/9; background: #000; position: relative; }
#dplayer { width: 100%; height: 100%; }
.play-right { flex: 3; background: var(--movie-card-bg); border-radius: 8px; display: flex; flex-direction: column; }
.pr-header { padding: 15px 20px; border-bottom: 1px solid var(--movie-border); }
.pr-drama-title { font-size: 18px; font-weight: bold; color: var(--movie-primary); margin-bottom: 10px; }
.pr-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.source-select { background: #111319; color: #fff; border: 1px solid var(--movie-border); padding: 5px 10px; border-radius: 4px; font-size: 13px; }
.pr-body { flex: 1; padding: 15px; overflow-y: auto; max-height: 540px; }
.epi-grid { display: none; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.epi-grid.active { display: grid; }
.epi-btn { background: #111319; color: #ccc; padding: 10px 5px; text-align: center; border-radius: 4px; font-size: 13px; transition: all 0.2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 1px solid transparent; }
.epi-btn:hover { background: #22242b; color: #fff; }
.epi-btn.active { color: var(--movie-primary); border-color: rgba(59, 130, 246, 0.3); background: rgba(59, 130, 246, 0.05); }

/* Playback Info Sections */
.info-layout { display: flex; gap: 30px; margin-top: 30px; background: var(--movie-card-bg); padding: 30px; border-radius: 8px; }
.info-poster { width: 160px; flex-shrink: 0; }
.info-poster img { width: 100%; border-radius: 6px; }
.btn-fav { width: 100%; margin-top: 15px; background: linear-gradient(90deg, #1e88e5, #3b82f6); color: #fff; padding: 10px 0; border: none; border-radius: 4px; font-weight: bold; cursor: pointer; transition: all 0.2s; }
.btn-fav.favorited { background: linear-gradient(90deg, #ef4444, #dc2626); }
.info-content { flex: 1; }
.info-title { font-size: 24px; font-weight: bold; margin-bottom: 10px; }
.info-meta { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.meta-row { display: flex; }
.meta-lbl { color: #999; width: 60px; }
.meta-val { color: #ccc; }
.info-score-area { width: 180px; flex-shrink: 0; display: flex; flex-direction: column; gap: 15px; }
.score-box { background: #111319; border-radius: 8px; padding: 15px; display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--movie-border); }
.score-num { font-size: 24px; font-weight: bold; color: var(--movie-accent); }
.desc-section { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--movie-border); }
.desc-title { font-size: 18px; font-weight: bold; margin-bottom: 15px; }
.desc-content { color: #999; line-height: 1.8; font-size: 14px; }

/* Related Section (Recommendation) */
.related-sec { margin-top: 40px; }

/* Common Components */
.mov-switch { position: relative; width: 32px; height: 16px; }
.mov-switch input { opacity: 0; width: 0; height: 0; }
.mov-switch label { position: absolute; cursor: pointer; inset: 0; background-color: #333; border-radius: 10px; transition: .3s; }
.mov-switch label:before { position: absolute; content: ""; height: 12px; width: 12px; left: 2px; bottom: 2px; background-color: #eee; border-radius: 50%; transition: .3s; }
.mov-switch input:checked + label { background-color: var(--movie-primary); }
.mov-switch input:checked + label:before { transform: translateX(16px); }

/* Animation */
@keyframes fadeInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* --- LayUI Dark Theme Overrides --- */
body .layui-layer { background-color: #1c1e24 !important; border: 1px solid rgba(255,255,255,0.08) !important; box-shadow: 0 10px 30px rgba(0,0,0,0.6) !important; color: #fff !important; }
body .layui-layer-title { background-color: #111319 !important; color: #fff !important; border-bottom: 1px solid rgba(255,255,255,0.08) !important; border-top-left-radius: 4px; border-top-right-radius: 4px; }
body .layui-layer-content { color: #fff !important; }
body .layui-layer-setwin .layui-layer-close { color: #999 !important; text-decoration: none !important; }
body .layui-layer-setwin .layui-layer-close:hover { color: #fff !important; }
body .layui-layer-btn { border-top: none !important; background-color: #1c1e24 !important; }
body .layui-layer-btn a { background-color: #3b82f6 !important; border-color: #3b82f6 !important; color: #fff !important; height: 32px; line-height: 32px; padding: 0 16px; border-radius: 4px; }
body .layui-layer-btn .layui-layer-btn1 { background-color: transparent !important; border-color: rgba(255,255,255,0.2) !important; color: #ccc !important; }
body .layui-layer-btn .layui-layer-btn1:hover { color: #fff !important; border-color: rgba(255,255,255,0.4) !important; box-shadow: none !important; }
body .layui-layer-msg { background-color: #1c1e24 !important; border: 1px solid rgba(255,255,255,0.08) !important; }
body .layui-layer-msg .layui-layer-content { background-color: transparent !important; color: #fff !important; }

/* --- List Page Styles --- */
.list-header { padding: 40px 0 20px; border-bottom: 1px solid var(--movie-border); margin-bottom: 30px; }
.list-title { font-size: 24px; font-weight: bold; color: #fff; }
.list-meta { font-size: 14px; color: var(--movie-text-muted); margin-top: 8px; }
.cat-filter-container { margin-bottom: 30px; padding: 10px 15px; background: rgba(255,255,255,0.02); border-radius: 8px; border: 1px solid var(--movie-border); display: flex; flex-direction: column; gap: 8px; }
.cat-row { display: flex; align-items: flex-start; }
.cat-label { width: 80px; flex-shrink: 0; color: #666; font-size: 14px; padding: 5px 0; }
.cat-list { display: flex; flex-wrap: wrap; gap: 10px; flex: 1; }
.cat-item { padding: 5px 15px; border-radius: 4px; color: #999; font-size: 14px; text-decoration: none; transition: all 0.2s; }
.cat-item:hover, .cat-item.active { color: #fff; background: var(--movie-primary); }
.pagination-box { margin-top: 60px; text-align: center; }
.page-btn { display: inline-block; padding: 8px 16px; margin: 0 4px; border-radius: 4px; background: rgba(255,255,255,0.05); color: #999; text-decoration: none; transition: all 0.2s; border: 1px solid var(--movie-border); font-size: 14px; }
.page-btn:hover, .page-btn.active { background: var(--movie-primary); color: #fff; border-color: var(--movie-primary); }

/* --- Favorites & History Styles --- */
.page-header { display: flex; align-items: center; justify-content: space-between; margin: 30px 0 25px; }
.page-header h2 { font-size: 22px; font-weight: bold; color: #fff; display: flex; align-items: center; gap: 10px; }
.page-header h2 i { color: var(--movie-primary); }
.page-header .count-badge { background: var(--movie-primary); color: #fff; font-size: 12px; padding: 2px 10px; border-radius: 12px; font-weight: normal; }

.movie-card-del { position: absolute; top: 8px; left: 8px; width: 28px; height: 28px; background: rgba(0,0,0,0.7); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity 0.2s; color: #ef4444; font-size: 16px; z-index: 10; }
.mov-card:hover .movie-card-del { opacity: 1; }

.empty-state { text-align: center; padding: 80px 20px; color: #666; }
.empty-state i { font-size: 64px; color: #333; margin-bottom: 20px; display: block; }
.empty-state p { font-size: 16px; margin-bottom: 20px; }
.empty-state a { color: var(--movie-primary); text-decoration: none; font-size: 14px; }

.btn-clear-history { background: rgba(239,68,68,0.15); color: #ef4444; border: 1px solid rgba(239,68,68,0.3); padding: 8px 18px; border-radius: 6px; font-size: 13px; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 6px; }
.btn-clear-history:hover { background: rgba(239,68,68,0.25); }
.movie-card-episode { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,0.8)); padding: 8px 12px 6px; text-align: right; z-index: 5; }
.movie-card-episode span { background: var(--movie-primary); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 3px; }

/* Responsive Grid */
@media (max-width: 1200px) { .mov-grid { grid-template-columns: repeat(4, 1fr); } .hero-box { grid-template-columns: 1fr; } .hero-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; } .hero-featured { height: 350px; } .play-layout { flex-direction: column; } .play-right { height: auto; } }
@media (max-width: 992px) { .info-layout { flex-direction: column; } .info-poster, .info-score-area { width: 100%; } .info-score-area { flex-direction: row; } .score-box { flex: 1; } }
@media (max-width: 768px) { .mov-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; } .hero-list { display: none; } }
@media (max-width: 480px) { .mov-grid { grid-template-columns: repeat(2, 1fr); } .epi-grid { grid-template-columns: repeat(3, 1fr); } }
