@media (max-width: 991px) {
    .navbar-mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.7);
        z-index: 1040;
        display: none;
        backdrop-filter: blur(5px);
    }

    .navbar-mobile-overlay.show {
        animation: fadeIn 0.5s ease;
    }

    .navbar-mobile-menu {
        position: fixed;
        top: 0;
        right: -300px;
        width: 300px;
        height: 100%;
        background-color: white;
        transition: right 0.5s ease-in-out;
        z-index: 99999999;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    }

    .navbar-mobile-menu.show {
        right: 0;
        animation: slideInRight 0.5s ease;
    }

    a.search-top_button {
        height: 70%;
        transition: transform 0.5s ease;
    }

    a.search-top_button:hover {
        transform: scale(1.1);
    }

    .navbar-toggler {
        border: none;
        transition: transform 0.5s ease;
    }

    .navbar-toggler:hover {
        transform: rotate(90deg);
    }

    .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='white' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    }
}

/* ========================================================== */
/* ANIMATIONS */
/* ========================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        right: -300px;
        opacity: 0;
    }
    to {
        right: 0;
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@font-face {
    font-family: 'BaiJamjuree';
    src: url('../../fonts/BaiJamjuree-Medium.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

/* ========================================================== */
/* 1. MÀU SẮC CHỮ VÀ GIÃN CÁCH */
/* ========================================================== */

.menu-top {
    font-weight: 500;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

/* Class này sẽ được JS thêm vào khi cuộn chuột */
.fixed-nav {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 9999 !important; /* Đảm bảo nằm trên cùng */
    background-color: #003d82 !important; /* Đổi màu nền theo ý bạn */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    animation: slideDown 0.4s ease; /* Sử dụng animation slideDown bạn đã có */
}

/* Thêm hiệu ứng gradient subtile cho menu */
.menu-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ff1212, transparent);
    opacity: 0.5;
}

.nav-item a {
    color: #ffffff !important;
    font-size: clamp(11px, 1.5vw, 15px);
    white-space: nowrap;
    position: relative;
}

.menu-chinh {
    display: flex;
    justify-content: flex-start;
    padding: 0;
    margin: 0;
}

.menu-chinh .nav-item {
    margin-right: 1.5rem; 
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
    z-index: 1001;
}

/* Hiệu ứng nhấc lên khi hover vào nav-item */
.menu-chinh .nav-item:hover {
    transform: translateY(-2px);
    z-index: 999999999;
}

.menu-chinh .nav-link {
    font-family: 'BaiJamjuree' !important;
    padding-top: 0.9rem !important; 
    padding-bottom: 0.9rem !important;
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Hiệu ứng gạch dưới trượt từ trái sang phải */
.menu-chinh .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #FFF212, #FFD700);
    transition: width 0.5s ease;
}

.menu-chinh .nav-link:hover::before {
    width: 100%;
}

.menu-chinh .nav-link:hover::after {
    left: 100%;
}

/* ========================================================== */
/* 2. HIỆU ỨNG DI CHUỘT (HOVER EFFECT) */
/* ========================================================== */

.menu-chinh .nav-link:hover {
    color: #FFF212 !important;
    
}

/* Hiệu ứng cho menu đang active */
.menu-chinh .nav-link.active,
.menu-chinh .nav-link.show {
    color: #FFF212 !important;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.1) 100%
    );
    border-radius: 4px 4px 0 0;
    box-shadow: inset 0 -2px 0 #FFF212;
}

/* ========================================================== */
/* 3. MENU CON (DROPDOWN) */
/* ========================================================== */

/* Đảm bảo dropdown item có z-index cao hơn */
.menu-chinh .nav-item.dropdown {
    position: relative;
    z-index: 1001;
}

.menu-chinh .nav-item.dropdown.show {
    z-index: 1050;
}

.menu-chinh .dropdown-menu {
    border-radius: 0 0 8px 8px;
    margin-top: 0;
    border: none;
    background: #003d82dc;
    padding: 0;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.5s ease;
    overflow: hidden;
    z-index: 1055 !important;
    position: absolute !important;
}

/* Viền sáng ở trên dropdown */
.menu-chinh .dropdown-item {
    font-family: 'BaiJamjuree' !important;
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    position: relative;
    overflow: hidden;
}

/* Hiệu ứng sọc chéo khi hover dropdown item */
.menu-chinh .dropdown-item::before {
    /* content: ''; */
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 242, 18, 0.1),
        transparent
    );
    transition: left 0.8s ease;
}

.menu-chinh .dropdown-item:hover::before {
    left: 100%;
}

.menu-chinh .dropdown-item:hover,
.menu-chinh .dropdown-item:active {
    background: linear-gradient(
        90deg,
        rgba(27, 25, 56, 0.623) 0%,
        #003d82 100%
    );
    color: #ffffff !important;
    font-weight: 500;
}

/* Hiệu ứng stagger cho dropdown items */
.menu-chinh .dropdown-menu.show .dropdown-item {
    animation: slideDown 0.5s ease forwards;
    opacity: 0;
}

.menu-chinh .dropdown-menu.show .dropdown-item:nth-child(1) { animation-delay: 0.1s; }
.menu-chinh .dropdown-menu.show .dropdown-item:nth-child(2) { animation-delay: 0.1s; }
.menu-chinh .dropdown-menu.show .dropdown-item:nth-child(3) { animation-delay: 0.1s; }
.menu-chinh .dropdown-menu.show .dropdown-item:nth-child(4) { animation-delay: 0.1s; }
.menu-chinh .dropdown-menu.show .dropdown-item:nth-child(5) { animation-delay: 0.1s; }

/* ========================================================== */
/* 4. ICON SEARCH */
/* ========================================================== */

.search-top_button {
    position: relative;
    display: inline-block;
    transition: all 0.5s ease;
}

.search-top_button:hover {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 0 8px rgba(255, 242, 18, 0.6));
}

.search-top_button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 242, 18, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.search-top_button:hover::after {
    width: 150%;
    height: 150%;
}

/* ========================================================== */
/* 5. MOBILE MENU ENHANCEMENTS */
/* ========================================================== */

@media (max-width: 991px) {
    .navbar-mobile-menu .list-unstyled li {
        animation: slideInRight 0.5s ease forwards;
        opacity: 0;
    }

    .navbar-mobile-menu.show .list-unstyled li:nth-child(1) { animation-delay: 0.1s; }
    .navbar-mobile-menu.show .list-unstyled li:nth-child(2) { animation-delay: 0.2s; }
    .navbar-mobile-menu.show .list-unstyled li:nth-child(3) { animation-delay: 0.3s; }
    .navbar-mobile-menu.show .list-unstyled li:nth-child(4) { animation-delay: 0.4s; }
    .navbar-mobile-menu.show .list-unstyled li:nth-child(5) { animation-delay: 0.5s; }
    
    .menu-chinh .nav-link {
        color: #000000 !important; 
        border-bottom: none;
        background-color: transparent !important;
    }
    
    .menu-chinh .nav-link:hover,
    .menu-chinh .nav-link.active {
        color: #1e3b5e !important;
        background: linear-gradient(
            90deg,
            rgba(30, 59, 94, 0.1) 0%,
            transparent 100%
        ) !important;
        transform: translateX(5px);
    }
    
    .menu-chinh .dropdown-item {
        color: #000000;
        background-color: transparent;
    }
    
    .menu-chinh .dropdown-item:hover {
        background: linear-gradient(
            90deg,
            rgba(30, 59, 94, 0.1) 0%,
            transparent 100%
        );
        color: #1e3b5e;
        transform: translateX(10px);
        font-weight: 600;
    }

    /* Hiệu ứng cho menu toggle icon - BỎ HIỆU ỨNG XOÁY */
    .menu-toggle {
        transition: transform 0.5s ease;
    }

    /* BỎ HIỆU ỨNG ĐẢO NGƯỢC CHỮ CHO MENU CHA */
    /* .menu-toggle[aria-expanded="true"] {
        transform: rotate(180deg);
    } */

    /* Nút đóng menu mobile */
    .btn-close {
        transition: all 0.5s ease;
    }

    .btn-close:hover {
        transform: rotate(90deg) scale(1.1);
    }
}

/* ========================================================== */
/* 6. HIỆU ỨNG PHỤ */
/* ========================================================== */

/* Hiệu ứng ripple khi click */
.nav-link, .dropdown-item {
    position: relative;
    overflow: hidden;
}

.nav-link:active::after,
.dropdown-item:active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    to {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

/* Smooth scrolling cho page */
html {
    scroll-behavior: smooth;
}

