/* Fix lỗi tràn viền và bóp nhỏ giao diện mobile */
* {
    padding: 0;
    margin: 0;
    box-sizing: border-box !important;
    font-family: 'Poppins', sans-serif;
}
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #171d21; /* Đổ màu nền vào để lúc cuộn trang nó không bị trong suốt đè chữ lên nhau */
}

html, body {
    width: 100%;
    /* Đổi chữ 'hidden' thành 'clip' là có phép thuật xảy ra */
    overflow-x: clip !important; 
}

/* ================= CSS CHO THANH SEARCH ================= */
.search-box {
    position: relative;
    flex: 1; 
    max-width: 400px; 
    margin: 0 2rem; 
}

.search-box input {
    width: 100%;
    background-color: #212529; 
    border: 1px solid #333;
    color: #fff;
    padding: 12px 15px 12px 40px; 
    border-radius: 8px;
    outline: none;
    font-size: 14px;
    transition: 0.3s ease-in-out;
}

.search-box input:focus {
    border-color: #e2d703; 
    box-shadow: 0 0 10px rgba(226, 215, 3, 0.2);
}

.search-box .search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #cecaca;
    font-size: 15px;
}

.search-dropdown {
    position: absolute;
    top: 120%; 
    left: 0;
    width: 100%; /* Sửa thành 100% để không bị tràn viền */
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    display: none; 
    flex-direction: column;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    z-index: 1001;
}

.search-dropdown.active {
    display: flex; 
}

.search-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    text-decoration: none;
    border-bottom: 1px solid #2a2a2a;
    transition: 0.2s;
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover {
    background-color: #2a2a2a; 
}

.search-item img {
    width: 45px;
    height: 65px;
    object-fit: cover;
    border-radius: 4px;
}

.search-item .info h5 {
    color: #fff;
    font-size: 15px;
    margin-bottom: 5px;
}

.search-item .info span {
    color: #cecaca;
    font-size: 12px;
}

.search-item .info i {
    color: #e2d703;
    margin-left: 5px;
    font-size: 11px;
}

.search-dropdown::-webkit-scrollbar { width: 6px; }
.search-dropdown::-webkit-scrollbar-thumb { background: #444; border-radius: 10px; }


/* ================= ĐÃ ĐỔI TÊN NAVBAR ĐỂ NẾ BOOTSTRAP ================= */
.site-navbar {
    background-color: #171d21;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
}
.site-navbar ul {
    display: flex;
    align-items: center;
    gap: 3rem;
    margin: 0;
    padding: 0;
}
.site-navbar ul li {
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-navbar ul li a {
    text-decoration: none;
    color: #fff;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 14px;
    transition: 0.3s ease-in-out;
}
.site-navbar ul li a:hover {
    color: #e2d703;
}
.site-navbar ul .site-btn {
    border: 2px solid #e2d703;
    color: #e2d703;
    padding: 10px 30px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 700;
    background-color: #1d1a28;
    transition: 0.3s ease-in-out;
    cursor: pointer;
}
.site-navbar ul .site-btn:is(:hover, :focus) {
    background: #e2d703;
    color: #1d1a28;
}
.site-nav-list .logo {
    display: none;
    align-items: center;
    justify-content: space-around;
    padding-top: 20px;
}
.site-nav-list .logo .close {
    background-color: transparent;
    color: #fff;
    font-size: 20px;
    border: none;
}
.hamburger {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
}
.hamburger .line {
    width: 25px;
    height: 3px;
    border-radius: 5px;
    background-color: #fff;
}

/* Các section còn lại giữ nguyên */
.hero{ background: url(../images/hero-bg.jpg) no-repeat; background-size: cover; background-position: right; height: 90vh; max-height: 1000px; display: flex; justify-content: flex-start; align-items: center; padding: 0px 30px; }
.hero .main .content{ max-width: 60%; }
.hero .main .content p{ font-size: 26px; font-weight: 700; color: #e2d703; margin-bottom: 0.5rem; }
.hero .content h1{ font-size: 50px; color: #fff; line-height: 62px; }
.hero .content strong{ color: #e2d703; }
.hero .meta-wrapper{ display: flex; align-items: center; flex-wrap: wrap; gap: 2rem; margin-top: 1.5rem; }
.hero .meta-wrapper .badge span:nth-child(1){ background-color: #fff; color: #171d21; font-weight: 700; padding: 5px 10px; font-size: 12px; margin-right: 0.5rem; }
.hero .meta-wrapper .badge span:nth-child(2){ background-color: #171d21; color: #fff; border: 2px solid #fff; font-weight: 700; padding: 3px 10px; font-size: 12px; }
.hero .meta-wrapper .genre a{ text-decoration: none; color: #fff; font-size: 15px; font-weight: 500; transition: 0.3s ease-in-out; }
.hero .meta-wrapper .genre a:hover{ color: #e2d703; }
.hero .meta-wrapper .date-time span{ color: #fff; font-size: 13px; font-weight: 600; }
.hero .meta-wrapper .date-time span:nth-child(1){ margin-right: 0.5rem; }
.hero .date-time i{ color: #e2d703; }
.hero .watch-btn{ margin-top: 3.4rem; }
.hero .watch-btn i{ margin-right: 0.5rem; }
.hero .content .watch-btn button{ border: 2px solid #e2d703; color: #fff; padding: 13px 30px; border-radius: 30px; text-transform: uppercase; letter-spacing: 2px; font-size: 13px; font-weight: 700; background-color: #1d1a28; transition: 0.3s ease-in-out; cursor: pointer; }
.hero .content .watch-btn button:is(:hover, :focus) { background: #e2d703; color: #1d1a28; }
.upcoming-movie{ background: url(../images/upcoming-bg.png) no-repeat; background-size: cover; background-position: center; padding: 100px 30px; }
.upcoming-movie .header{ display: flex; align-items: center; justify-content: space-between; }
.upcoming-movie .header .subtitle small{ font-size: 12px; color: #e2d703; text-transform: uppercase; font-weight: 500; }
.upcoming-movie .header .subtitle h4{ font-size: 40px; color: #fff; }
.upcoming-movie .header .buttons{ display: flex; gap: 1rem; }
.upcoming-movie .header .buttons button{ color: #fff; background-color: #21232b; font-weight: 500; font-size: 12px; padding: 10px 20px; border-radius: 30px; border: 2px solid #2e303e; cursor: pointer; transition: 0.3s ease-in-out; }
.upcoming-movie .header .buttons button:focus{ border: 2px solid #e2d703; }
.upcoming-movie .movie-card{ display: flex; align-items: center; justify-content: center; margin-top: 3rem; }
.wrapper { width: 100%; position: relative; }
.wrapper .movie-carousel{ display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% / 3) - 15px); overflow-x: auto; scroll-snap-type: x mandatory; gap: 30px; border-radius: 8px; scroll-behavior: smooth; scrollbar-width: none; }
.movie-carousel::-webkit-scrollbar { display: none; }
.movie-carousel.no-transition { scroll-behavior: auto; }
.movie-carousel.dragging { scroll-snap-type: none; scroll-behavior: auto; }
.movie-carousel.dragging .card { cursor: grab; user-select: none; }
.movie-carousel :where(.card) { display: flex; justify-content: center; align-items: center; }
.movie-carousel .card { scroll-snap-align: start; list-style: none; background: transparent; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
.movie-carousel .card .img { width: 100%; aspect-ratio: 2/3; overflow: hidden; border-radius: 10px; }
.movie-carousel .card .img img{ width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }
.movie-carousel .card .title{ display: flex; justify-content: space-between; align-items: center; margin-top: 0.5rem; width: 100%; }
.movie-carousel .card .title a{ color: #fff; text-decoration: none; transition: 0.3s ease-in-out; }
.movie-carousel .card .title a:hover{ color: #e2d703; }
.movie-carousel .card .title span{ color: #e2d703; font-weight: 600; font-size: 14px; }
.movie-carousel .card .footer{ width: 100%; display: flex; justify-content: space-between; align-items: center; margin-top: 0.5rem; }
.movie-carousel .card .footer .left-content{ display: flex; align-items: center; gap: 0.5rem; }
.movie-carousel .card .footer span{ color: #e2d703; padding: 3px 10px; border: 2px solid #fff; font-size: 12px; font-weight: 600; }
.movie-carousel .card .footer .time-rating{ display: flex; gap: 0.5rem; }
.movie-carousel .card .footer .time-rating span{ color: #fff; padding: 0px; border: none; }
.movie-carousel .card .footer .time-rating i{ color: #e2d703; margin-right: 0.3rem; }
.movie-carousel .card .footer .like-btn{ background: none; border: none; color: #fff; font-size: 16px; cursor: pointer; padding: 5px 8px; transition: 0.3s ease-in-out; }
.movie-carousel .card .footer .like-btn:hover i{ color: #e2d703; transform: scale(1.2); }
.movie-carousel .card .footer .like-btn.liked i{ color: #e2d703; }
.service{ background: url(../images/service-bg.jpg) no-repeat; background-position: center; background-size: cover; padding: 100px 30px; }
.service .main{ display: flex; align-items: center; gap: 1rem; }
.service .main .img img{ width: 90%; }
.service .content { width: 50%; }
.service .content small{ font-size: 13px; color: #bdbdbd; text-transform: uppercase; font-weight: 600; }
.service .content h4{ font-size: 40px; color: #fff; line-height: 52px; margin: 0.5rem 0rem; }
.service .content p{ color: #bdbdbd; font-size: 15px; font-weight: 500; }
.service .content ul{ margin-top: 2rem; }
.service .content ul li{ list-style: none; margin-top: 1rem; }
.service .content li .service-card{ display: flex; align-items: center; gap: 2rem; }
.service li .service-card .img{ border: 1px dashed #e2d703; padding: 5px; border-radius: 50%; }
.service hr{ border: none; border-bottom: 1px dashed hsla(0, 0%, 100%, 0.1); height: 2px; outline: none; margin-top: 2rem; margin-bottom: 2rem; }
.service li .service-card .icon{ background-color: transparent; padding: 20px; border-radius: 50%; transition: 0.3s ease-in-out; }
.service li .service-card i{ color: #fff; font-size: 30px; }
.service li .service-card:hover .icon{ background-color: #e2d703; }
.service li .service-card h5{ font-size: 20px; color: #fff; margin-bottom: 0.5rem; }
.top-movie{ background: url(../images/top-rated-bg.jpg) no-repeat; background-size: cover; padding: 100px 30px; }
.top-movie .header,.tv-series .header{ text-align: center; }
.top-movie .header small,.tv-series .header small{ color: #e2d703; text-transform: uppercase; font-size: 13px; font-weight: 500; }
.top-movie .header h4,.tv-series .header h4{ color: #fff; font-size: 40px; }
.top-movie .top-movie-main .buttons{ display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 1rem; margin-top: 2.5rem; }
.top-movie .top-movie-main .buttons button{ background-color: #0a0f0f; color: #cecaca; border-radius: 5px; font-size: 13px; padding: 12px 20px; font-weight: 600; cursor: pointer; text-transform: uppercase; border: 2px solid #000000cc; transition: 0.3s ease-in-out; }
.top-movie .top-movie-main .buttons button:is(:hover,:focus) { color: #e2d703; text-shadow: 0 3px 25px hsl(57deg 97% 45% / 50%); }
.same .wrapper{ display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; justify-content: center; row-gap: 50px; column-gap: 30px; margin-top: 3rem; }
.same .wrapper .card{ width: 100%; }
.movie-card .card .img { width: 100%; aspect-ratio: 2/3; overflow: hidden; border-radius: 6px; }
.movie-card .card .img img{ width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }
.movie-card .card .title{ display: flex; justify-content: space-between; align-items: center; margin-top: 0.5rem; width: 100%; }
.movie-card .card .title a{ color: #fff; text-decoration: none; transition: 0.3s ease-in-out; }
.movie-card .card .title a:hover{ color: #e2d703; }
.movie-card .card .title span{ color: #e2d703; font-weight: 600; font-size: 14px; }
.movie-card .card .footer{ width: 100%; display: flex; justify-content: space-between; align-items: center; margin-top: 0.5rem; }
.movie-card .card .footer .left-content{ display: flex; align-items: center; gap: 0.5rem; }
.movie-card .card .footer span{ color: #e2d703; padding: 3px 10px; border: 2px solid #fff; font-size: 12px; font-weight: 600; }
.movie-card .card .footer .time-rating{ display: flex; gap: 0.5rem; }
.movie-card .card .footer .time-rating span{ color: #fff; padding: 0px; border: none; }
.movie-card .card .footer .time-rating i{ color: #e2d703; margin-right: 0.3rem; }
.movie-card .card .footer .like-btn{ background: none; border: none; color: #fff; font-size: 16px; cursor: pointer; padding: 5px 8px; transition: 0.3s ease-in-out; }
.movie-card .card .footer .like-btn:hover i{ color: #e2d703; transform: scale(1.2); }
.movie-card .card .footer .like-btn.liked i{ color: #e2d703; }
.trial{ background: url(../images/cta-bg.jpg) no-repeat; background-size: cover; background-position: center; padding: 50px 30px; }
.trial .main{ display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.trial .content h4{ font-size: 30px; text-transform: uppercase; }
.trial .content p{ font-size: 15px; font-weight: 500; }
.trial .form .input{ background-color: #fff; width: 400px; height: 50px; display: flex; justify-content: space-between; align-items: center; padding: 5px 5px; border-radius: 5px; }
.trial .form .input input{ width: calc(100%/2); height: 40px; padding: 0px 10px; border: none; outline: none; font-size: 14px; font-weight: 500; }
.trial .form button{ text-transform: uppercase; font-size: 15px; padding: 10px 18px; background-color: #0a0f0f; color: #e2d703; font-weight: 600; border-radius: 5px; cursor: pointer; transition: 0.3s ease-in-out; }
.trial .form button:hover{ color: #0a0f0f; border: 2px solid #0a0f0f; background-color: #e2d703; }
footer .footer-top{ background: url(../images/footer-bg.jpg) no-repeat; background-size: cover; background-position: center; padding: 100px 30px; }
.footer-top nav{ display: flex; align-items: center; justify-content: space-between; }
.footer-top nav ul{ display: flex; flex-wrap: wrap; align-items: center; gap: 2rem; }
.footer-top nav ul li{ list-style: none; }
.footer-top ul li a{ text-decoration: none; color: #cecaca; font-size: 14px; text-transform: uppercase; font-weight: 600; transition: 0.3s ease-in-out; }
.footer-top ul li a:hover{ color: #e2d703; }
.footer-top hr{ height: 4px; margin-block: 40px; border: none; border-top: 1px solid #11141d; border-bottom: 1px solid #ffffff1a; }
.footer-top .links{ display: flex; justify-content: space-between; align-items: center; }
.footer-top .links .text-links{ display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-top .text-links a{ text-decoration: none; text-transform: uppercase; font-weight: 500; font-size: 13px; color: #cecaca; transition: 0.3s ease-in-out; }
.footer-top .text-links a:hover{ color: #e2d703; }
.footer-top .social-links{ display: flex; gap: 1rem; }
.footer-top .social-links a{ color: #cecaca; background-color: #11141d; padding: 10px 13px; font-size: 12px; border-radius: 50%; transition: 0.3s ease-in-out; }
.footer-top .social-links a:hover{ color: #e2d703; }
.footer-bottom{ background-color: #171d21; display: flex; align-items: center; justify-content: space-between; padding: 30px; }
.footer-bottom .copyright p{ color: #cecaca; font-size: 13px; font-weight: 500; }
.footer-bottom .copyright a{ color: #e2d703; text-decoration: none; }
.back-to-top{ position: fixed; opacity: 0; bottom: 20px; right: 20px; z-index: 2; background-color: #e2d703; border-radius: 50%; border: none; cursor: pointer; padding: 15px; }
.back-to-top.show { opacity: 1; transition: opacity 1s, transform 1s; }

/* MEDIA QUERIES SỬA TÊN NAVBAR + FIX PADDING TRÁI CHO MENU */
@media only screen and (max-width: 909px){
    .hamburger{ display: flex; }
    .site-navbar .site-nav-list {
        position: fixed;
        right: -100%;
        top: 0;
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
        background-color: #171d21;
        width: 100%;
        max-width: 300px;
        height: 100vh;
        transition: 0.3s;
        z-index: 4;
        padding-top: 1rem;
    }
    
    /* ĐÃ TĂNG PADDING TRÁI LÀ 60px VÀO ĐÂY CHO PHÊ */
    .site-nav-list li { 
        width: 100%; 
        border-bottom: 1px solid hsla(0, 0%, 100%, 0.1); 
        padding: 15px 25px 15px 50px !important; 
    }
    
    .site-nav-list .home { 
        margin-top: 1rem; 
        border-top: 1px solid hsla(0, 0%, 100%, 0.1); 
    }
    
    /* 2. Trả cái nút SIGN IN về chính giữa, cấm thụt lệch */
    .site-nav-list .site-btn { 
        margin: 25px auto !important; 
        display: block; 
        text-align: center; 
        width: 80%; 
    }
    
    .site-nav-list.active{ right: 0; }
    .site-nav-list.active .logo{ display: flex; width: inherit; }
    
    .hero{ background-position: center; }
    .hero .content{ max-width: max-content!important; }
    .hero .content p{ font-size: 24px; }
    .hero .content h1{ font-size: 42px; }
    .hero .content .badge span{ font-size: 11px; }
    .hero .content .genre a{ font-size: 14px; }
    .upcoming-movie .header{ display: flex; flex-direction: column; text-align: center; gap: 2rem; align-items: center; }
    .service .main{ flex-direction: column; gap: 2rem; }
    .service img{ max-width: max-content; }
    .service .content{ width: 80%; }
    .trial .main{ justify-content: center; gap: 2rem; }
    .trial .content{ text-align: center; }
    .movie-detail .main{ flex-direction: column; }
}

/* Bổ sung để vuốt ngang trên điện thoại (iOS/Android) mượt như bôi mỡ */
.wrapper .movie-carousel {
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px; /* Dành khoảng trống cho dễ vuốt */
}

@media only screen and (max-width: 767px){
    /* Tablet: Hiển thị 3 cột */
    .same .wrapper{ grid-template-columns: repeat(3, 1fr); gap: 20px;}
    .footer-top nav,.footer-top .links,.footer-bottom{ flex-direction: column; gap: 2rem; }
    .footer-top nav ul,.footer-top .links .text-links{ justify-content: center; }
}

@media only screen and (max-width: 549px){
    .hero .content h1{ font-size: 36px; }
    .upcoming-movie .header .subtitle h4,.service .content h4,.top-movie .header h4,.tv-series .header h4{ font-size: 28px; }

    /* Hiện lại ô search, bóp nhỏ kích thước để vừa với logo và hamburger */
    .search-box { 
        display: block; 
        max-width: 150px; 
        margin: 0 10px;
    }
    .search-box input {
        padding: 8px 10px 8px 32px; 
        font-size: 13px;
    }
    .search-box .search-icon {
        left: 10px;
    }
    .site-navbar {
        padding: 15px 15px; 
    }

    /* ================= FIX LƯỚT NGANG (CAROUSEL) ================= */
    .upcoming-movie .wrapper .movie-carousel{ 
        grid-auto-columns: calc(42% - 10px); 
        gap: 12px; 
    }

    /* ================= FIX DANH SÁCH PHIM DỌC (TRENDING/SAME) ================= */
    .same .wrapper{ 
        grid-template-columns: repeat(2, 1fr); 
        column-gap: 15px; 
        row-gap: 25px; 
        margin-top: 1.5rem;
    }

    .movie-carousel .card .title h4, .movie-card .card .title h4 { font-size: 14px; margin-bottom: 0; }
    .movie-carousel .card .title span, .movie-card .card .title span { font-size: 12px; }
    .movie-carousel .card .footer { margin-top: 0.2rem; }
    .movie-carousel .card .footer span, .movie-card .card .footer span { font-size: 10px; padding: 2px 6px; }
    .movie-carousel .card .footer .time-rating i, .movie-card .card .footer .time-rating i { font-size: 10px; }
    .movie-carousel .card .footer .time-rating span, .movie-card .card .footer .time-rating span { font-size: 11px; }

    .service .content{ width: 90%; }
    .service .service-card{ flex-direction: column; align-items: flex-start!important; }
}

@media only screen and (max-width: 450px){
    .trial .form .input{ width: 350px; }
}

@media (min-width: 1200px){
    .upcoming-movie .wrapper .movie-carousel{ grid-auto-columns: calc((100%/4) - 15px); }
    .same .wrapper{ grid-template-columns: repeat(4, 1fr); }
}


/* Gắn vị trí tương đối cho thẻ li cha để menu con neo vào đó */
.site-nav-list .has-dropdown {
    position: relative;
}

/* Định dạng menu thả xuống (Mặc định bị ẩn) */
.site-nav-list .dropdown-menu {
    position: absolute;
    top: 100%; /* Nằm sát ngay dưới chữ Phim lẻ/Phim bộ */
    left: 0;
    width: 220px;
    background-color: #171d21; /* Màu tối hợp với web phim */
    padding: 10px 0;
    list-style: none;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    border: 1px solid #2a2a2a;
    
    /* Hiệu ứng ẩn hiện mượt mà */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 999;
}

/* Định dạng các dòng chữ bên trong Dropdown */
.site-nav-list .dropdown-menu li {
    display: block;
    padding: 0;
}
.site-nav-list .dropdown-menu li a {
    display: block;
    padding: 10px 20px;
    color: #ccc;
    font-size: 14px;
    text-transform: capitalize; /* Không in hoa toàn bộ nữa cho dễ đọc */
    transition: 0.2s;
}

/* Hover vào từng mục trong dropdown sẽ sáng lên màu vàng */
.site-nav-list .dropdown-menu li a:hover {
    background-color: rgba(226, 215, 3, 0.1);
    color: #e2d703;
    padding-left: 25px; /* Thụt vào 1 xíu nhìn cho sang */
}

/* PHÉP MÀU NẰM Ở ĐÂY: Rà chuột vào LI cha -> Hiện Dropdown con */
.site-nav-list .has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.site-nav-list .dropdown-menu {
        min-width: 180px; 
        /* Nếu thằng cha đang dùng flex thì thêm dòng này để ép con xếp dọc */
        flex-direction: column; 
    }

    /* Ép buộc thẻ li con phải là block (nằm dọc) */
    .site-nav-list .dropdown-menu li {
        display: block !important; 
        width: 100%; 
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Định dạng lại chữ bên trong cho chuẩn */
    .site-nav-list .dropdown-menu li a {
        display: block !important; 
        width: 100%;
        text-align: left !important; /* Căn trái cho ngay hàng thẳng lối */
        white-space: nowrap; /* Tuyên án tử hình lỗi rớt chữ (Hành Động sẽ nằm trên 1 dòng) */
        padding: 8px 24px !important; /* Đẩy cho chữ có không gian thở */
    }


    /* CSS cho dropdown profile*/
.site-nav-list .has-dropdown {
    position: relative;
}

/* Định dạng menu thả xuống (Mặc định bị ẩn) */
.site-nav-list .dropdown-menu {
    position: absolute;
    top: 100%; /* Nằm sát ngay dưới chữ Phim lẻ/Phim bộ */
    left: 0;
    width: 220px;
    background-color: #171d21; /* Màu tối hợp với web phim */
    padding: 10px 0;
    list-style: none;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    border: 1px solid #2a2a2a;
    
    /* Hiệu ứng ẩn hiện mượt mà */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 999;
}

/* Định dạng các dòng chữ bên trong Dropdown */
.site-nav-list .dropdown-menu li {
    display: block;
    padding: 0;
}
.site-nav-list .dropdown-menu li a {
    display: block;
    padding: 10px 20px;
    color: #ccc;
    font-size: 14px;
    text-transform: capitalize; /* Không in hoa toàn bộ nữa cho dễ đọc */
    transition: 0.2s;
}

/* Hover vào từng mục trong dropdown sẽ sáng lên màu vàng */
.site-nav-list .dropdown-menu li a:hover {
    background-color: rgba(226, 215, 3, 0.1);
    color: #e2d703;
    padding-left: 25px; /* Thụt vào 1 xíu nhìn cho sang */
}

/* PHÉP MÀU NẰM Ở ĐÂY: Rà chuột vào LI cha -> Hiện Dropdown con */
.site-nav-list .has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.site-nav-list .dropdown-menu {
        min-width: 180px; 
        /* Nếu thằng cha đang dùng flex thì thêm dòng này để ép con xếp dọc */
        flex-direction: column; 
    }

    /* Ép buộc thẻ li con phải là block (nằm dọc) */
    .site-nav-list .dropdown-menu li {
        display: block !important; 
        width: 100%; 
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Định dạng lại chữ bên trong cho chuẩn */
    .site-nav-list .dropdown-menu li a {
        display: block !important; 
        width: 100%;
        text-align: left !important; /* Căn trái cho ngay hàng thẳng lối */
        white-space: nowrap; /* Tuyên án tử hình lỗi rớt chữ (Hành Động sẽ nằm trên 1 dòng) */
        padding: 8px 24px !important; /* Đẩy cho chữ có không gian thở */
    }
    .user-menu-dropdown {
    position: relative;
    display: inline-block;
}

    .dropdown-content {
        display: none;
        position: absolute;
        top: 110%; /* Đẩy xuống cách cái nút 1 xíu */
        right: 0;  /* PHÉP MÀU: Neo chặt vào mép phải của cái nút */
        background-color: #1a1a1a;
        min-width: 220px; /* Rộng ra để không che chữ */
        box-shadow: 0px 8px 16px rgba(0,0,0,0.5);
        z-index: 9999; /* Đảm bảo nó đè lên mọi thứ khác trên web */
        border-radius: 8px;
        border: 1px solid #333;
        overflow: hidden; /* Để góc bo tròn không bị tràn */
    }

    .dropdown-content a {
        color: #ccc;
        padding: 10px 18px;
        text-decoration: none;
        display: block;
        font-size: 13px;
        transition: 0.2s;
        white-space: nowrap;
    }

    .dropdown-content a i {
    margin-right: 8px; /* Tách cái icon ra cho dễ nhìn */
}

    .dropdown-content a:hover {background-color: #333; color: #e2d703;}

    /* Di chuột vào tên là hiện popup */
    .user-menu-dropdown:hover .dropdown-content {
        display: block;
    }

    /* Căn chỉnh lại cái popup cho chuẩn vị trí */
    .user-menu-dropdown .dropdown-content {
        top: 100%;
        right: 0;
        background-color: #171d21;
        border: 1px solid #2a343b;
        border-radius: 8px;
        margin-top: 8px;
    }

    .user-avatar-img {
        width: 36px;      
        height: 36px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid #e2d703;  
    }

    .btn-user-logged {
        background-color: #171d21;
        color: #ffffff;
        border: 1px solid #2a343b;
        padding: 6px 12px 6px 6px;
        border-radius: 40px;      
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 10px;
        transition: 0.3s;
        white-space: nowrap;
    }

    .btn-user-logged:hover {
        background-color: #242c32;
        border-color: #e2d703;
        color: #e2d703;
    }

    .btn-user-logged i.fa-user-circle {
        font-size: 28px; 
        color: #e2d703;
    }

    @media (max-width: 909px) {
        .user-menu-dropdown {
            display: flex;
            justify-content: center;
            width: 100%;
        }
        
        .dropdown-content {
            position: absolute;
            top: 100%;
            left: 50%;
            transform: translateX(-50%);
            right: auto;
            width: auto;
            min-width: 200px;
            box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
            border: 1px solid #2a343b;
            background-color: #171d21;
            padding: 4px;
            display: none;
            z-index: 1000;
            margin-top: 8px;
        }
        
        .dropdown-content a {
            padding: 8px 12px;
            font-size: 12px;
        }
        
        .btn-user-logged {
            padding: 4px 10px 4px 4px;
            font-size: 13px;
            gap: 8px;
        }
        
        .btn-user-logged i.fa-user-circle {
            font-size: 24px;
        }
        
        .user-avatar-img {
            width: 32px;
            height: 32px;
        }
    }

    .dropdown-content.show {
        display: block !important;
    }

    

    /* ================= CSS CHO CARD NẰM NGANG ================= */
.list-layout {
    display: flex;
    flex-direction: column; /* Xếp dọc các thẻ nằm ngang */
    gap: 20px;
    padding: 0;
    list-style: none;
}

.card-horizontal {
    display: flex;
    background-color: #171d21; /* Màu nền hơi sáng hơn nền web 1 chút */
    border: 1px solid #2a343b;
    border-radius: 10px;
    overflow: hidden;
    transition: 0.3s ease;
}

.card-horizontal:hover {
    border-color: #e2d703;
    transform: translateX(5px); /* Hiệu ứng trượt nhẹ sang phải khi hover */
}

/* Phần Ảnh */
.card-horizontal .img-box {
    width: 200px; /* Cố định chiều rộng ảnh */
    flex-shrink: 0;
}
.card-horizontal .img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 2/3;
}

/* Phần Thông tin */
.card-horizontal .info-box {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
}

.card-horizontal .top-info h4 {
    color: #fff;
    font-size: 22px;
    margin-bottom: 5px;
    transition: 0.2s;
}
.card-horizontal .top-info a { text-decoration: none; }
.card-horizontal .top-info h4:hover { color: #e2d703; }
.card-horizontal .year { color: #888; font-size: 14px; }

.card-horizontal .meta-info {
    display: flex;
    gap: 15px;
    color: #ccc;
    font-size: 13px;
    margin: 10px 0;
}
.card-horizontal .quality {
    border: 1px solid #fff;
    padding: 2px 6px;
    border-radius: 4px;
    color: #e2d703;
    border-color: #e2d703;
}
.card-horizontal .rating i { color: #e2d703; }
.card-horizontal .description { color: #888; font-size: 14px; margin-bottom: 15px;}

/* Nút bấm */
.card-horizontal .action-buttons {
    display: flex;
    gap: 15px;
    margin-top: auto;
}
.card-horizontal .btn-watch {
    background-color: #e2d703;
    color: #111;
    padding: 8px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: 0.2s;
}
.card-horizontal .btn-watch:hover { background-color: #fff; }

.card-horizontal .btn-remove {
    background-color: transparent;
    color: #ff4d4d;
    border: 1px solid #ff4d4d;
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}
.card-horizontal .btn-remove:hover {
    background-color: #ff4d4d;
    color: #fff;
}

/* Responsive Mobile: Chuyển về dọc nếu màn hình quá nhỏ */
@media (max-width: 600px) {
    .card-horizontal { flex-direction: column; }
    .card-horizontal .img-box { width: 100%; aspect-ratio: 16/9;} /* Cắt ảnh ngang cho đẹp trên mobile */
    .card-horizontal .action-buttons { flex-direction: column; }
    .card-horizontal .btn-watch, .card-horizontal .btn-remove { text-align: center; }
}.site-nav-list .has-dropdown.force-hide .dropdown-menu {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.site-nav-list .has-dropdown.active-dropdown .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
