/* Reset & Base */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; line-height: 1.6; color: #000; background-color: #fff; }
.container {
    width: 100%;
    max-width: 1420px;
    margin: 0 auto;
    padding: 0 3rem;
}

/* Laptop nhỏ */
@media (max-width: 1200px) {
    .container {
        padding: 0 2rem;
    }
}

/* Tablet */
@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
}

/* Header Styling - Glassmorphism mặc định nhẹ */
.main-header {
    background: rgba(0, 0, 0, 0.15); /* Nền mỏng khi ở trên cùng */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.main-header.scrolled {
    background: rgba(15, 15, 15, 0.75); /* Nền tối hơn khi cuộn */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding: 15px 0; /* Thu nhỏ nhẹ */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #fff;
    font-weight: bold;
    font-size: 22px;
}
.logo img { height: 40px; margin-right: 10px; }

/* Nav */
.main-nav ul { list-style: none; display: flex; align-items: center; }
.main-nav ul li { margin-left: 15px; } /* Giảm nhẹ để vừa vặn capsule */

.main-nav ul li a {
    text-decoration: none;
    color: #e0e0e0;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 30px; /* Kiểu dáng capsule */
    border: 1px solid transparent;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

/* Hiệu ứng Kính cho trang hiện tại (Active) */
.main-nav ul li a.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15), 
                inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

/* Hover hiệu ứng kính nhạt hơn cho các mục chưa active */
.main-nav ul li a:hover:not(.active) {
    color: #f39c12;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Dropdown Icon */
.arrow-down {
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 2.5px;
    transform: rotate(45deg);
    margin-bottom: 2px;
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.main-nav ul li a.btn-login {
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    transition: all 0.3s ease;
}

.main-nav ul li a.btn-login:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #ffffff;
    color: #ffffff !important;
}

/* Trạng thái active của nút Đăng Nhập */
.main-nav ul li a.btn-login.active {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
}

/* 2. Nút Đăng Ký (Kiểu nền đặc nổi bật - Solid Accent) */
.main-nav ul li a.btn-register {
    background: none; /* Màu cam thương hiệu giống màu hover của bạn */
    color: #e0e0e0 !important;
    /* border: 1px solid #f39c12; */
    font-weight: 600;
    transition: all 0.3s ease;
}

.main-nav ul li a.btn-register:hover {
    background: #e67e22; /* Màu cam đậm hơn khi hover */
    border-color: #e67e22;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
}

/* Trạng thái active của nút Đăng Ký */
.main-nav ul li a.btn-register.active {
    background: #d35400;
    border-color: #d35400;
    color: #ffffff !important;
}

/* Tối ưu hiển thị trên giao diện Mobile/Tablet (<= 1024px) */
@media (max-width: 1024px) {
    .main-nav ul li a.btn-login,
    .main-nav ul li a.btn-register {
        justify-content: center; /* Căn giữa chữ trên thiết bị di động */
        margin-top: 8px;
        padding: 12px 20px;
        width: 100%;
    }
}

/* --- Desktop Dropdown - Glassmorphism --- */
.dropdown { position: relative; }
.submenu {
    position: absolute;
    top: calc(100%); /* Khoảng cách nhỏ với header */
    left: 0;
    background: rgba(25, 25, 25, 0.85) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    min-width: 230px;
    display: none !important;
    list-style: none;
    padding: 10px 0;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 100;
}

.submenu li { margin: 0 !important; width: 100%; }

.submenu li a {
    padding: 12px 20px !important;
    display: block !important;
    color: #ccc !important;
    font-size: 13px !important;
    border-radius: 0 !important;
    border: none !important;
    background: transparent !important;
    text-transform: none;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
}

.submenu li a:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #f39c12 !important;
}

/* Hover hiển thị menu con trên desktop */
@media (min-width: 1025px) {
    .dropdown:hover .submenu { 
        display: block !important; 
    }
}

/* --- Responsive (Mobile/Tablet <= 1024px) --- */
@media (max-width: 1024px) {
    .main-nav {
        position: fixed;
        top: 80px; /* Khớp với chiều cao header thực tế */
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: rgba(15, 15, 15, 0.85) !important; /* Nền tối mờ kiểu iOS */
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        transition: left 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
        overflow-y: auto;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .main-nav.active { left: 0; }

    .main-nav ul { 
        flex-direction: column; 
        padding: 30px 20px; 
        align-items: stretch;
    }
    
    .main-nav ul li { 
        margin: 0 0 12px 0; 
        width: 100%; 
    }
    
    .main-nav ul li a { 
        padding: 14px 20px; 
        display: flex; 
        justify-content: space-between;
        width: 100%; 
        border-radius: 12px; /* Bo góc mềm hơn trên mobile */
    }

    /* Ẩn Submenu mặc định trên mobile */
    .submenu { 
        position: static; 
        background: rgba(0, 0, 0, 0.2) !important; 
        width: 100%; 
        box-shadow: none; 
        border: none;
        border-radius: 8px;
        margin-top: 8px;
        padding: 5px 0;
        display: none !important;
    }

    .submenu li a { 
        padding-left: 35px !important; 
        background: transparent !important; 
    }

    /* Hiển thị submenu khi phần tử cha có class .is-active */
    .dropdown.is-active > .submenu { 
        display: block !important; 
    }
    
    /* Xoay mũi tên khi mục dropdown active */
    .dropdown.is-active .arrow-down { 
        transform: rotate(-135deg); 
    }
}

/* Toggle Menu Nút Burger */
.menu-toggle { display: none; cursor: pointer; padding: 5px; }
.bar { display: block; width: 25px; height: 2px; margin: 6px auto; background: #fff; transition: 0.3s; }

@media (max-width: 1024px) {
    .menu-toggle { display: block; }
}

/* Hiệu ứng chuyển nút Burger thành X khi active */
.menu-toggle.is-active .bar:nth-child(2) { opacity: 0; }
.menu-toggle.is-active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-toggle.is-active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }