@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap');

:root {
    --bg: #0f0f0f;
    --card-bg: #181818;
    --primary: #e50914; /* Đỏ Netflix */
    --text: #fff;
    --text-gray: #b3b3b3;
    --border: #333;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Roboto', sans-serif; -webkit-tap-highlight-color: transparent; }
body { background: var(--bg); color: var(--text); padding-top: 60px; overflow-x: hidden; display: flex; flex-direction: column; min-height: 100vh; }

/* --- HEADER --- */
header { position: fixed; top: 0; width: 100%; height: 60px; background: rgba(0,0,0,0.95); z-index: 1000; border-bottom: 1px solid #222; box-shadow: 0 4px 10px rgba(0,0,0,0.5); }
.nav-container { max-width: 1600px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; height: 100%; }
.logo { font-size: 26px; font-weight: 900; color: var(--primary); cursor: pointer; text-transform: uppercase; letter-spacing: 1px; }
.logo span { color: white; }

/* MENU */
.nav-menu { display: flex; list-style: none; gap: 25px; }
.nav-menu li { cursor: pointer; font-size: 15px; color: #ccc; font-weight: 500; padding: 20px 0; position: relative; transition: 0.3s; }
.nav-menu li:hover { color: var(--primary); }

.dropdown-content { display: none; position: absolute; top: 100%; left: 0; background: #1a1a1a; min-width: 500px; max-height: 400px; overflow-y: auto; border: 1px solid #333; grid-template-columns: repeat(4, 1fr); padding: 15px; gap: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.8); z-index: 1001; border-radius: 0 0 8px 8px; }
.dropdown:hover .dropdown-content { display: grid; }
.dropdown-content div { padding: 8px; font-size: 13px; color: #bbb; border-bottom: 1px solid #2a2a2a; cursor: pointer; transition: 0.2s; }
.dropdown-content div:hover { color: var(--primary); transform: translateX(5px); }

.search-box { background: #222; padding: 6px 15px; border-radius: 50px; display: flex; align-items: center; border: 1px solid #333; }
.search-box input { background: transparent; border: none; color: white; outline: none; width: 220px; font-size: 14px; }
.search-box i { cursor: pointer; color: #888; }

/* --- GLOBAL TITLE STYLES (ĐẸP & TRỰC QUAN) --- */
.section-header h2, .sidebar-title, .server-label {
    font-size: 22px;
    font-weight: 800;
    text-transform: uppercase;
    color: #fff;
    border-left: 5px solid var(--primary);
    padding-left: 15px;
    margin-bottom: 20px;
    line-height: 1.2;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

/* --- MOBILE SIDEBAR --- */
.hamburger-btn { display: none; font-size: 30px; cursor: pointer; color: white; }
.mobile-sidebar { 
    position: fixed; top: 0; left: 0; width: 300px; height: 100vh; 
    background: #111; z-index: 2000; transform: translateX(-100%); 
    transition: transform 0.3s ease; border-right: 1px solid #222; 
    overflow-y: auto; box-shadow: 5px 0 20px rgba(0,0,0,0.7);
}
.mobile-sidebar.active { transform: translateX(0); }
.mobile-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 1500; display: none; backdrop-filter: blur(3px); }
.mobile-overlay.active { display: block; }

.sidebar-header { padding: 20px; border-bottom: 1px solid #222; display: flex; justify-content: space-between; align-items: center; background: #0a0a0a; }
.sidebar-header span { font-weight: 900; font-size: 20px; color: var(--primary); }
.mobile-search { padding: 15px; display: flex; gap: 10px; border-bottom: 1px solid #222; background: #151515; }
.mobile-search input { width: 100%; background: #222; border: 1px solid #333; color: white; padding: 10px; border-radius: 4px; }
.mobile-search button { background: var(--primary); border: none; color: white; padding: 0 15px; border-radius: 4px; }

.mobile-nav { list-style: none; padding: 0; }
.mobile-nav li { padding: 15px 20px; border-bottom: 1px solid #222; cursor: pointer; font-size: 15px; color: #ddd; font-weight: 500; }
.mobile-label { background: #1a1a1a; color: var(--primary); font-weight: bold; padding: 15px 20px; font-size: 14px; text-transform: uppercase; cursor: default !important; border-bottom: 1px solid #222; margin-top: 0; }
.mobile-sub-menu { display: grid; grid-template-columns: 1fr 1fr; background: #0f0f0f; }
.mobile-sub-menu div { padding: 12px 20px; font-size: 13px; color: #999; border-bottom: 1px solid #1a1a1a; border-right: 1px solid #1a1a1a; }

/* --- HERO HOME --- */
.hero { height: 65vh; position: relative; display: flex; align-items: center; background-size: cover; background-position: center; margin-bottom: 40px; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to top, var(--bg) 0%, transparent 100%), linear-gradient(to right, #000 30%, transparent 100%); }
.hero-content { position: relative; z-index: 10; padding-left: 5%; width: 50%; }
.hero-content h1 { font-size: 3.5rem; text-shadow: 2px 2px 10px black; margin-bottom: 15px; font-weight: 900; line-height: 1.1; text-transform: uppercase; }
.hero-desc { font-size: 15px; color: #ccc; margin-bottom: 25px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; max-width: 650px; text-shadow: 1px 1px 3px rgba(0,0,0,0.8); }
.btn-primary { background: var(--primary); color: white; border: none; padding: 12px 35px; border-radius: 4px; cursor: pointer; font-weight: bold; font-size: 16px; box-shadow: 0 5px 15px rgba(229, 9, 20, 0.4); transition: 0.3s; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(229, 9, 20, 0.6); }

/* --- GRID HOME --- */
main { max-width: 1600px; margin: 0 auto; padding: 0 20px 40px; }
.movie-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 20px; }
.movie-card { background: var(--card-bg); border-radius: 8px; overflow: hidden; cursor: pointer; transition: 0.3s; position: relative; border: 1px solid #222; }
.movie-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.5); border-color: #444; }
.movie-card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; }
.movie-name { padding: 12px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #eee; font-weight: 500; text-align: center; }

/* --- INTRO PAGE --- */
.info-banner { position: relative; width: 100%; height: 650px; background-size: cover; background-position: center top; display: flex; align-items: center; margin-bottom: 40px; }
.info-overlay { position: absolute; inset: 0; background: linear-gradient(to right, #0a0a0a 25%, rgba(10,10,10,0.8) 55%, transparent 100%), linear-gradient(to top, var(--bg) 0%, transparent 20%); display: flex; align-items: center; padding: 0 5%; }
.info-content-pc { display: flex; gap: 50px; z-index: 10; max-width: 1400px; width: 100%; align-items: flex-start; margin-top: 50px; }
.poster-pc { width: 300px; border-radius: 8px; box-shadow: 0 20px 50px rgba(0,0,0,0.8); border: 1px solid #333; }
.text-pc { color: white; max-width: 800px; }
.text-pc h1 { font-size: 4rem; margin-bottom: 20px; line-height: 1; font-weight: 900; text-transform: uppercase; letter-spacing: -1px; }
.meta-tags { display: flex; gap: 10px; margin-bottom: 25px; flex-wrap: wrap; }
.tag { background: rgba(255,255,255,0.1); padding: 6px 14px; border-radius: 4px; font-size: 14px; font-weight: 600; border: 1px solid rgba(255,255,255,0.15); backdrop-filter: blur(5px); }
.desc-pc { font-size: 16px; line-height: 1.8; color: #ccc; margin-bottom: 30px; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.btn-watch-pc { background: var(--primary); color: white; border: none; padding: 15px 60px; border-radius: 50px; font-weight: bold; font-size: 18px; cursor: pointer; box-shadow: 0 10px 30px rgba(229, 9, 20, 0.5); transition: 0.3s; display: inline-flex; align-items: center; gap: 10px; }
.btn-watch-pc:hover { transform: scale(1.05); background: #ff0f1f; }

/* Intro Details */
.intro-details-container { max-width: 1400px; margin: 0 auto; padding: 0 20px 40px; display: grid; grid-template-columns: 2.5fr 1fr; gap: 50px; }
.section-box { margin-bottom: 40px; }

/* CAST GRID (Tròn, đều) */
.cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 20px; margin-top: 20px; }
.cast-item { text-align: center; }
.cast-item img { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; margin: 0 auto 10px; border: 3px solid #222; display: block; transition: 0.2s; background: #222; }
.cast-item:hover img { border-color: var(--primary); }
.cast-item p { font-size: 13px; color: #bbb; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }

/* INTRO EPISODES (Full List) */
.episode-grid-intro { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 10px; max-height: 400px; overflow-y: auto; padding-right: 5px; }
.ep-btn-intro { background: #222; border: 1px solid #333; color: #ccc; padding: 10px 0; border-radius: 4px; cursor: pointer; text-align: center; font-size: 14px; font-weight: 600; transition: 0.2s; }
.ep-btn-intro:hover { background: #333; color: white; border-color: #666; }

/* --- WATCH PAGE (LAYOUT FIX) --- */
.watch-container { max-width: 1600px; margin: 30px auto; padding: 0 20px; }
/* Tỷ lệ Player 70% - Sidebar 30% */
.main-watch-area { display: grid; grid-template-columns: 2.5fr 1fr; gap: 30px; align-items: start; }

.player-wrapper { background: #000; width: 100%; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; margin-bottom: 20px; box-shadow: 0 0 40px rgba(0,0,0,0.8); }
#video-frame { width: 100%; height: 100%; border: none; }
#watch-title { font-size: 24px; margin-bottom: 20px; color: #fff; border-left: 5px solid var(--primary); padding-left: 15px; font-weight: 800; }

/* SERVER & EPISODES UI (Ảnh 2 Style) */
.server-section { background: #151515; padding: 25px; border-radius: 8px; border: 1px solid #222; }
.server-label { font-size: 15px; color: #999; margin-bottom: 12px; display: block; border: none; padding: 0; }

.server-list { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 25px; }
.server-btn { background: #252525; color: #ccc; border: 1px solid #333; padding: 10px 20px; border-radius: 4px; cursor: pointer; font-weight: 600; transition: 0.2s; font-size: 13px; text-transform: uppercase; }
.server-btn:hover { background: #333; color: white; }
.server-btn.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 10px rgba(229, 9, 20, 0.3); }

.server-note { background: rgba(245, 197, 24, 0.05); color: #f5c518; padding: 12px 15px; font-size: 13px; border-left: 3px solid #f5c518; margin-bottom: 25px; display: flex; align-items: center; gap: 8px; border-radius: 4px; }

/* Episode Grid Watch */
.episode-grid-watch { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 10px; max-height: 400px; overflow-y: auto; padding-right: 5px; }
.ep-btn { background: #252525; color: #ccc; border: 1px solid #333; padding: 10px 0; border-radius: 4px; cursor: pointer; text-align: center; font-size: 13px; transition: 0.2s; font-weight: 500; }
.ep-btn:hover { background: #333; border-color: #555; color: white; }
.ep-btn.active { background: var(--primary); color: white; border-color: var(--primary); font-weight: bold; }

/* Sidebar Related */
.sidebar-box { background: #151515; padding: 20px; border-radius: 8px; border: 1px solid #222; }
.related-list { display: flex; flex-direction: column; gap: 15px; }
.related-item { display: flex; gap: 15px; cursor: pointer; padding: 10px; background: #1e1e1e; border-radius: 6px; transition: 0.2s; border: 1px solid transparent; }
.related-item:hover { transform: translateX(5px); border-color: #333; }
.related-item img { width: 70px; aspect-ratio: 2/3; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.related-info { display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.related-name { font-size: 14px; font-weight: 700; color: #eee; margin-bottom: 5px; line-height: 1.3; }
.related-sub { font-size: 12px; color: #888; }

/* FOOTER */
#footer { background: #080808; border-top: 1px solid #222; padding: 60px 20px 30px; margin-top: auto; }
.footer-content { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 60px; }
.footer-logo { font-size: 32px; font-weight: 900; color: var(--primary); margin-bottom: 20px; display: flex; align-items: center; gap: 10px; text-transform: uppercase; }
.footer-left p { color: #666; font-size: 14px; line-height: 1.8; max-width: 400px; margin-bottom: 30px; }
.footer-socials { display: flex; gap: 15px; }
.footer-socials a { width: 40px; height: 40px; background: #1a1a1a; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-size: 20px; transition: 0.3s; }
.footer-socials a:hover { background: var(--primary); transform: translateY(-3px); }
.footer-links h4 { color: #fff; font-size: 18px; margin-bottom: 25px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.footer-links a { display: block; color: #888; font-size: 14px; margin-bottom: 12px; text-decoration: none; transition: 0.2s; }
.footer-links a:hover { color: var(--primary); padding-left: 5px; }
.footer-bottom { border-top: 1px solid #222; margin-top: 50px; padding-top: 20px; text-align: center; font-size: 13px; color: #444; }

/* --- PAGINATION (PHÂN TRANG ĐẸP) --- */
.pagination { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 8px; /* Khoảng cách giữa các nút */
    margin-top: 40px; 
    padding-bottom: 40px; 
    flex-wrap: wrap; /* Cho phép xuống dòng trên điện thoại nếu quá dài */
}

.page-btn { 
    background: #1a1a1a; 
    border: 1px solid #333; 
    color: #b3b3b3; 
    min-width: 40px; /* Quan trọng: Dùng min-width để số hàng nghìn (1440) không bị mất chữ */
    height: 40px; 
    padding: 0 14px; /* Đệm 2 bên để số thoáng hơn */
    cursor: pointer; 
    border-radius: 6px; 
    font-weight: 500; 
    font-size: 14px; 
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover { 
    background: #333; 
    color: #fff; 
    border-color: #555; 
    transform: translateY(-2px); /* Hiệu ứng nổi nhẹ khi di chuột */
}

.page-btn.active { 
    background: var(--primary); 
    border-color: var(--primary); 
    color: white; 
    font-weight: bold; 
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.4); /* Bóng đỏ đẹp mắt */
}

/* Style riêng cho nút 3 chấm (...) để không bị xấu */
.page-btn.dots { 
    background: transparent; 
    border: none; 
    cursor: default; 
    color: #666;
    min-width: auto;
    padding: 0 5px;
}
.page-btn.dots:hover {
    background: transparent;
    transform: none;
    border: none;
}

/* --- MOBILE RESPONSIVE FIXES --- */
.mobile-detail-header { display: none; }

@media (max-width: 1024px) {
    .main-watch-area, .intro-details-container { grid-template-columns: 1fr; }
    .info-banner { min-height: 400px; }
    .text-pc h1 { font-size: 2.5rem; }
    .footer-content { grid-template-columns: 1fr; text-align: center; }
    .footer-logo, .footer-socials { justify-content: center; }
    .footer-left p { margin: 0 auto 20px; }
}

@media (max-width: 768px) {
    .hamburger-btn { display: block; }
    .desktop-only { display: none !important; }
    
    .hero { height: 45vh; }
    .hero-content { width: 90%; }
    .hero-content h1 { font-size: 2rem; }
    .hero-desc { display: none; }

    /* MOBILE HERO & BUTTON FIX */
    .info-banner { display: none; }
    .mobile-detail-header { display: block; width: 100%; position: relative; background: #111; }
    .mobile-hero-bg { width: 100%; height: 55vh; background-size: cover; background-position: center; position: relative; }
    
    .mobile-hero-overlay { 
        position: absolute; inset: 0; 
        background: linear-gradient(to top, #111 10%, rgba(0,0,0,0.4) 60%, transparent 100%); 
        display: flex; flex-direction: column; align-items: center; justify-content: flex-end; 
        padding-bottom: 30px; text-align: center; 
    }
    
    .mobile-title { 
        font-size: 1.8rem; margin-bottom: 10px; 
        text-shadow: 2px 2px 10px #000; padding: 0 15px; 
        font-weight: 800; line-height: 1.2; text-transform: uppercase;
    }

    /* !!! FIX NÚT XEM PHIM MOBILE (QUAN TRỌNG) !!! */
    .hero-watch-btn {
        -webkit-appearance: none;
        appearance: none;
        background-color: var(--primary) !important;
        color: white !important;
        border: none !important;
        padding: 12px 50px !important;
        border-radius: 50px !important;
        font-weight: 800 !important;
        font-size: 16px !important;
        text-transform: uppercase;
        box-shadow: 0 5px 20px rgba(229, 9, 20, 0.6);
        margin-top: 15px;
        display: inline-block;
        text-decoration: none;
    }

    .mobile-desc-box { 
        padding: 20px 15px; color: #ccc; font-size: 14px; 
        line-height: 1.6; text-align: justify; 
        background: #111; border-bottom: 1px solid #222; margin-bottom: 20px;
    }

    .movie-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .cast-grid { grid-template-columns: repeat(3, 1fr); }
    .intro-details-container { padding: 0 15px; }
    .watch-container { padding: 10px; margin-top: 10px; }
}

