/* 1. TỔNG THỂ & RESET */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
}

body { 
    background-color: #060606; 
    color: white; 
    scroll-behavior: smooth; 
    overflow-x: hidden;
}

/* 2. THANH NAVBAR (Nâng cấp kính mờ & Hiện đại hóa) */
nav {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    flex-wrap: wrap; /* Thêm cái này để chống vỡ layout nếu màn hình nhỏ */
    gap: 15px; /* Thêm khoảng cách giữa các khối */
    padding: 15px 5%; 
    position: sticky; 
    top: 0; 
    width: 100%; 
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8); 
    backdrop-filter: blur(15px); 
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo { 
    color: #e50914; 
    font-size: 1.8rem; 
    font-weight: 800; 
    text-decoration: none; 
    cursor: pointer; 
    letter-spacing: -1px;
}

/* Khung tìm kiếm (Bo cong mềm, hiệu ứng nổi 3D) */
.search-box { 
    display: flex; 
    align-items: center; /* Căn giữa nội dung theo chiều dọc */
    height: 40px; /* Chốt cứng chiều cao */
    background: rgba(255, 255, 255, 0.05); 
    padding: 0 20px; /* Bỏ padding trên/dưới, chỉ giữ khoảng cách 2 bên */
    border-radius: 20px; /* Bo góc tròn vừa phải */
    flex-grow: 0.3; 
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.search-box:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px); /* Nhảy nhẹ khi hover */
    box-shadow: 0 6px 15px rgba(0,0,0,0.5);
}

.search-box:focus-within {
    border-color: #e50914;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.2); /* Vòng glow đỏ khi gõ chữ */
    transform: translateY(-2px);
}

.search-box input { 
    background: transparent; 
    border: none; 
    color: white; 
    outline: none; 
    width: 100%; 
    font-size: 0.95rem;
}

.search-box button { 
    background: transparent; 
    border: none; 
    color: #ccc; 
    cursor: pointer; 
    transition: 0.3s;
}

.search-box button:hover {
    color: white;
    transform: scale(1.1); /* Zoom nhẹ icon kính lúp */
}

/* Các link menu: Trang chủ, Phim lẻ, Phim bộ... (Nâng cấp thành hộp đồng bộ với bộ lọc) */
.nav-links {
    display: flex;
    gap: 10px; 
    align-items: center; /* Đảm bảo cân giữa theo chiều dọc */
}

.nav-links a { 
    color: #fff; 
    text-decoration: none; 
    
    height: 40px; /* Chốt cứng chiều cao bằng luôn 2 thằng kia */
    display: flex;
    align-items: center; /* Căn giữa chữ */
    justify-content: center;
    
    padding: 0 15px; /* Bỏ padding trên/dưới */
    border-radius: 12px; 
    font-size: 0.85rem; 
    font-weight: 500; 
    
    background: rgba(255, 255, 255, 0.05); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); 
    backdrop-filter: blur(10px); 
    transition: all 0.3s ease; 
}

.nav-links a:hover { 
    color: #fff; 
    border-color: rgba(255, 255, 255, 0.3); 
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.5);
}

/* 3. HERO BANNER (Giữ hình cũ nhưng thêm chiều sâu) */
.hero {
    height: 75vh; 
    display: flex; 
    align-items: center; 
    padding: 0 5%;
    /* Giữ nguyên link ảnh của ông */
    background: linear-gradient(to right, #060606 15%, rgba(0,0,0,0.3) 100%), 
                url('https://images.unsplash.com/photo-1626814026160-2237a95fc5a0?ixlib=rb-4.0.3&auto=format&fit=crop&w=1470&q=80');
    background-size: cover; 
    background-position: center;
    position: relative;
}

/* Tạo lớp phủ mờ dần xuống dưới để hòa quyện với phần danh sách phim */
.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(to top, #060606, transparent);
}

.hero-content { position: relative; z-index: 2; }

.hero-content h1 { 
    font-size: 4.5rem; 
    font-weight: 900;
    color: #e50914; 
    margin-bottom: 10px;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
}

.hero-content p { 
    max-width: 550px; 
    font-size: 1.1rem; 
    margin-bottom: 25px; 
    color: #ddd; 
    line-height: 1.5;
}

/* Chỉ thay đổi phần .btn-play ở Mục 3, các phần khác giữ nguyên */
.btn-play { 
    background: linear-gradient(135deg, #e50914, #b20710); /* Gradient đỏ Netflix sang trọng */
    color: white; 
    border: none; 
    padding: 14px 40px; 
    border-radius: 25px; /* Bo tròn hẳn thành hình viên thuốc */
    font-weight: bold; 
    cursor: pointer; 
    font-size: 1.1rem; 
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
    display: inline-flex;
    align-items: center;
}

.btn-play:hover { 
    background: linear-gradient(135deg, #ff0a16, #e50914); 
    transform: translateY(-3px) scale(1.02); /* Phóng to nhẹ và nảy lên */
    box-shadow: 0 8px 25px rgba(229, 9, 20, 0.6);
}
/* 4. BỘ LỌC (FILTER) - Đã chuyển lên Navbar */
.filter-container { 
    height: 40px;   /* thêm */
    display: flex; 
    gap: 10px; /* Thu gọn khoảng cách */
    align-items: center;
    /* Xóa background và padding to vì đã nằm trên Navbar */
}

.filter-container select { 
    height: 40px;
    height: 100%;   /* sửa từ 40px → 100% */
    padding-top: 0;
    padding-bottom: 0;
    line-height: normal;
    padding-top: 0;
    padding-bottom: 0;
    appearance: none; 
    -webkit-appearance: none;
    -moz-appearance: none;
    
    height: 40px; /* Chốt cứng chiều cao bằng với ô tìm kiếm */
    display: flex;
    align-items: center;
    
    background: rgba(255, 255, 255, 0.05) url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23ffffff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E") no-repeat right 10px top 50%;
    background-size: 10px auto; 
    
    color: #fff; 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    padding: 0 30px 0 15px; /* Bỏ padding trên/dưới */
    border-radius: 12px; 
    font-size: 0.85rem; 
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); 
    backdrop-filter: blur(10px); 
}

.filter-container select:hover { 
    border-color: rgba(255, 255, 255, 0.3); 
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px); 
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
}

.filter-container select:focus {
    border-color: #e50914; 
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.2); 
}

.filter-container select option {
    background: #111; 
    color: white;
    font-weight: normal;
}

/* 5. MOVIE SECTION & GRID */
.movie-section { padding: 30px 5%; }

.section-header { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    margin-bottom: 30px; 
}

/* Chỉ thay đổi #back-btn và .row-header span ở Mục 5 */
#back-btn { 
    background: rgba(255, 255, 255, 0.1); 
    color: white; 
    border: 1px solid rgba(255, 255, 255, 0.2); 
    padding: 10px 20px; 
    border-radius: 12px; /* Bo góc 12px đồng bộ */
    cursor: pointer; 
    font-weight: bold; 
    transition: all 0.3s ease;
    backdrop-filter: blur(10px); /* Kính mờ */
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

#back-btn:hover { 
    background: #e50914; 
    border-color: #e50914;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(229, 9, 20, 0.4);
}

/* --- Nâng cấp thanh Tiêu đề Danh mục (Hiệu ứng dải lụa gradient) --- */
.row-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 35px; 
    border-left: 5px solid #e50914; 
    padding: 12px 20px 12px 15px; /* Tạo độ phồng thành một cái hộp ngang */
    background: linear-gradient(to right, rgba(229, 9, 20, 0.2) 0%, rgba(255, 255, 255, 0.02) 40%, transparent 100%); /* Dải màu đỏ mờ dần về bên phải */
    border-radius: 0 15px 15px 0; /* Bo góc mềm mại ở đuôi */
}

/* Tút tát lại cái chữ của tiêu đề */
.row-header h3 { 
    font-size: 1.4rem; 
    font-weight: 800; /* In đậm tối đa */
    letter-spacing: 0.5px; 
    text-shadow: 2px 2px 8px rgba(0,0,0,0.8); /* Thêm bóng đổ để chữ nổi 3D lên */
    margin: 0; /* Xóa margin thừa nếu có */
}

.row-header span { 
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 15px;
    border-radius: 20px;
    color: #ccc; 
    font-size: 0.85rem; 
    cursor: pointer; 
    font-weight: 600; 
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.row-header span:hover { 
    color: white;
    background: rgba(229, 9, 20, 0.1);
    border-color: rgba(229, 9, 20, 0.5);
    transform: translateX(-3px); 
}

/* --- Đổi màu riêng cho hàng Danh mục "Phim Yêu Thích" (Hàng đầu tiên) --- */
#home-layout .movie-row:first-child .row-header {
    border-left-color: #ff4081; /* Đổi vạch đỏ thành màu hồng đậm */
    background: linear-gradient(to right, rgba(255, 64, 129, 0.25) 0%, rgba(255, 255, 255, 0.02) 40%, transparent 100%); /* Dải lụa hồng mờ */
}

/* Thêm chút hào quang hồng cho chữ "Phim Yêu Thích" */
#home-layout .movie-row:first-child .row-header h3 {
    text-shadow: 2px 2px 10px rgba(255, 64, 129, 0.5); 
}

/* 6. CARD PHIM (Nâng cấp hiệu ứng hover) */
.movie-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); 
    gap: 25px; 
}

.movie-card { 
    background: #111; 
    border-radius: 8px; 
    overflow: hidden; 
    cursor: pointer; 
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1); 
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.movie-card:hover { 
    transform: scale(1.08); 
    z-index: 10; 
    box-shadow: 0 15px 30px rgba(0,0,0,0.7);
}

.movie-card img { 
    width: 100%; 
    aspect-ratio: 2/3; 
    object-fit: cover; 
    display: block;
}

/* Thay đổi phần .movie-info ở Mục 6. Các phần khác của Card giữ nguyên */
.movie-info { 
    /* Đã xóa position: absolute để khung chữ không lấn lên hình nữa */
    width: 100%;
    padding: 15px 10px; 
    font-size: 0.95rem; 
    font-weight: 600; 
    text-align: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px); 
    color: #fff;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    
    /* Canh giữa chữ và giữ chiều cao đều nhau cho mọi card */
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 65px; 
}

/* Thêm dòng này để khi lướt chuột qua card phim, phần tên phim đổi nền đỏ */
.movie-card:hover .movie-info {
    background: rgba(229, 9, 20, 0.8);
    border-top-color: #e50914;
}

/* Ghi đè toàn bộ Mục 7 */
/* 7. NÚT TẬP PHIM & PLAYER (Đồng bộ bo góc và kính mờ) */
.btn-episode {
    background: rgba(255, 255, 255, 0.05); 
    color: white; 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    padding: 10px 20px;
    margin: 6px; 
    border-radius: 12px; /* Bo góc 12px đồng bộ */
    cursor: pointer; 
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.btn-episode:hover { 
    background: #e50914; 
    border-color: #e50914; 
    transform: translateY(-2px) scale(1.05); /* Nảy lên và to ra 1 chút */
    box-shadow: 0 6px 15px rgba(229, 9, 20, 0.5);
}

#video-player-container {
    background: #000;
    border-radius: 16px; /* Bo góc to hơn cho khung player nhìn mềm mắt */
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(229, 9, 20, 0.15); /* Bóng tối sâu + vòng sáng đỏ nhẹ */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* =========================================
   9. CUSTOM SCROLLBAR (THANH CUỘN CINEMATIC)
   ========================================= */
::-webkit-scrollbar {
    width: 10px; /* Độ rộng của thanh cuộn dọc */
    height: 8px; /* Độ cao của thanh cuộn ngang (nếu có) */
}

::-webkit-scrollbar-track {
    background: #060606; /* Màu nền trùng với background web */
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2); /* Màu xám mờ mờ tĩnh lặng */
    border-radius: 10px; /* Bo tròn viền như viên thuốc */
}

::-webkit-scrollbar-thumb:hover {
    background: #e50914; /* Hover vào là rực sáng màu đỏ Netflix */
    cursor: pointer;
}