/* Modern Navbar Styles */
.site-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    position: fixed;  /* Đổi từ sticky thành fixed */
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    border-bottom: 1px solid rgba(29, 78, 216, 0.1);
}

.site-nav .nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    gap: 20px;
}

/* Logo/Brand Styling */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.nav-brand:hover {
    transform: translateY(-2px);
}

.brand-icon {
    font-size: 32px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(29, 78, 216, 0.3));
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-name {
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
}

.brand-tagline {
    font-size: 10px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Navigation Links */
.nav-links {
    display: flex;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-links li {
    list-style: none;
    position: relative;
}

.nav-links a {
    color: #1d4ed8;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(29, 78, 216, 0.1), transparent);
    transition: left 0.5s ease;
}

.nav-links a:hover::before {
    left: 100%;
}

.nav-links a:hover {
    background: rgba(29, 78, 216, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.15);
}

    .menu-icon {
        font-size: 18px !important;
        filter: drop-shadow(0 1px 2px rgba(29, 78, 216, 0.2));
        min-width: 24px !important;
        text-align: center !important;
    }

/* Dropdown Styles */
.submenu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 240px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(29, 78, 216, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 8px;
    border-radius: 12px;
    z-index: 60;
    animation: slideDown 0.3s ease;
}
/* Animation for dropdown */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-links li.open > .submenu {
    display: block;
}

.submenu li {
    padding: 0;
}

.submenu a {
    display: block;
    padding: 10px 14px;
    color: #1d4ed8;
    white-space: nowrap;
    border-radius: 8px;
    font-size: 18px;
}

.submenu a:hover {
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
}

/* Nested submenu positioning */
.submenu .submenu {
    top: 0;
    left: calc(100% + 8px);
    padding-bottom: 12px;
    margin-bottom: 4px;
    min-height: 40px;
}

.caret {
    font-size: 12px;
    margin-left: 6px;
    color: #1d4ed8;
    display: inline-block;
    transition: transform 0.3s ease;
}

.has-submenu.open .caret {
    transform: rotate(180deg);
}

/* Login Button - ĐƠN GIẢN (chỉ icon + chữ) */
.login-button {
    background: rgba(29, 78, 216, 0.05) !important;
    color: #1d4ed8 !important;
    text-decoration: none;
    padding: 10px 16px !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    font-size: 18px !important;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: none !important;
    border: none !important;
    position: relative;
    overflow: hidden;
}

.login-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(29, 78, 216, 0.1), transparent);
    transition: left 0.5s ease;
}

.login-button:hover::before {
    left: 100%;
}

.login-button:hover {
    background: rgba(29, 78, 216, 0.08) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.15) !important;
}

.login-button:active {
    transform: translateY(0);
}

.login-icon {
    font-size: 16px;
}

/* Cỡ chữ user hiển thị giống menu */
.user-name {
    font-size: 18px !important;
}

/* Mobile Toggle - Hamburger Menu */
.nav-toggle {
    display: none; /* Ẩn mặc định */
    background: white;
    border: 2px solid #1d4ed8;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    width: 48px;
    height: 48px;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    z-index: 999;
    position: relative;
    margin-right: 12px;
    box-sizing: border-box;
    font-size: 20px;
    line-height: 1;
    color: #1d4ed8;
    font-weight: bold;
}
@media (max-width: 900px) {

    
    /* User section - bên phải */
    .nav-user {
        order: 3;
        margin-left: 0 !important;
        margin-right: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 100% !important;
        width: auto !important;
    }
    
    /* Đảm bảo icon hamburger trong HTML hiển thị đầy đủ */
    .nav-toggle {
        font-size: 20px !important;
        line-height: 1 !important;
        color: #1d4ed8 !important;
        font-weight: bold !important;
    }
    

    .nav-toggle {
        order: 1;
        display: flex !important;
        z-index: 1002 !important;
        position: relative !important;
        margin: 0 !important;
        width: 48px !important;
        height: 48px !important;
        padding: 12px !important;
        align-self: center !important;
        box-sizing: border-box !important;
        border: 2px solid #1d4ed8 !important;
        background: white !important;
    }
    .nav-links {
        order: 2;
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        height: calc(100vh - 60px) !important;
        min-height: calc(100vh - 60px) !important;
        max-height: calc(100vh - 60px) !important;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
        padding: 20px;
        gap: 12px;
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.15);
        z-index: 50;
        overflow-y: auto;
        align-items: stretch;
    }
    .nav-links.open {
        transform: translateX(0);
    }
    .nav-links li {
        padding: 0;
    }
    .nav-links a {
        width: 100%;
        justify-content: flex-start;
        cursor: pointer;
        font-size: 16px !important;
        padding: 14px 16px !important;
        gap: 10px !important;
    }
    .submenu {
        position: static;
        display: none;
        border: 0;
        box-shadow: none;
        padding: 8px 0 8px 16px;
        margin-left: 12px;
        border-left: 3px solid rgba(29, 78, 216, 0.2);
        border-radius: 0 8px 8px 0;
        animation: none;
    }
    .submenu .submenu {
        margin-left: 16px;
        border-left: 2px solid rgba(29, 78, 216, 0.15);
        padding-bottom: 12px;
        min-height: 40px;
    }


    .submenu a {
        font-weight: 600 !important;
        padding: 12px 14px 12px 24px !important;
        font-size: 15px !important;
    }
    .submenu .submenu a {
        font-weight: 500 !important;
        padding: 10px 12px 10px 32px !important;
        font-size: 14px !important;
    }
    .nav-links li.open > .submenu {
        display: block;
    }
    .submenu-toggle {
        display: none !important;
    }
    
    .login-button {
        margin-top: 8px !important;
        margin-bottom: 8px !important;
        justify-content: center;
        width: 100%;
        padding: 12px 16px !important;
        align-self: center !important;
    }
    .site-nav {
        padding-top: 0 !important; /* Bỏ padding top */
        min-height: 60px !important;  /* Chiều cao navbar */
        height: 60px !important;     /* Chiều cao cố định */
        z-index: 1001 !important;     /* Đảm bảo nằm trên các phần khác */
    }
    .nav-inner {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 8px 16px !important;
        gap: 0 !important;
        overflow: visible !important;
        height: 60px !important;
    }
    
    /* Đảm bảo không có nội dung bị cắt */
    .site-nav * {
        box-sizing: border-box;
    }
    
    /* Đảm bảo login button hiển thị đầy đủ */
    .login-button {
        position: relative !important;
        z-index: 51 !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* Tối ưu menu mobile */
    .nav-links {
        -webkit-overflow-scrolling: touch; /* Scroll mượt trên iOS */
    }
    
    .nav-links::-webkit-scrollbar {
        width: 4px;
    }
    
    .nav-links::-webkit-scrollbar-thumb {
        background: rgba(29, 78, 216, 0.2);
        border-radius: 2px;
    }
    
    /* Đảm bảo tất cả items trong navbar căn giữa */
    .site-nav .nav-inner > * {
        display: flex !important;
        align-items: center !important;
        height: 100% !important;
    }
    
    /* Đảm bảo không có nội dung bị cắt */
    .site-nav,
    .site-nav * {
        overflow: visible !important;
    }
    
    .nav-toggle {
        overflow: visible !important;
    }
    
    /* Hiệu ứng hover giống desktop */
    .nav-links a:hover {
        background: rgba(29, 78, 216, 0.08) !important;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(29, 78, 216, 0.15) !important;
    }
}
/* <-- Close the previous @media (max-width: 900px) or similar block if opened */

/* Hide on very small screens */
@media (max-width: 360px) {
    .nav-links {
        width: 100%;
    }
}

/* Đảm bảo hamburger chỉ hiển thị trên mobile */
@media (min-width: 901px) {
    .nav-toggle {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        width: 0 !important;
        height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
    }
    
    .nav-links {
        display: flex !important;
        flex-direction: row !important;
        position: static !important;
        width: auto !important;
        height: auto !important;
        transform: none !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
        gap: 8px !important;
        overflow: visible !important;
    }
}
