/* ==========================================================================
   PURE CSS STYLING FOR CLB TOÁN 9+ HEADER
   Supports Desktop Dropdowns (Level 2 & 3), Header Top Bar (Phone, Email, Socials),
   Scroll Sticky Animation, Active Indicators & Mobile Responsiveness.
   ========================================================================== */

:root {
    --header-navy: #001594;
    --header-navy-dark: #061e47;
    --header-top-bg: #152d5d;
    --header-red: #e31b23;
    --header-red-hover: #c41219;
    --header-text-dark: #0f172a;
    --header-text-gray: #475569;
    --header-border: #e2e8f0;
    --header-shadow: 0 4px 20px rgba(14, 56, 122, 0.08);
    --header-sticky-shadow: 0 6px 24px rgba(14, 56, 122, 0.12);
    --header-transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

body {
    overflow-x: hidden;
}

/* Visibility Utilities */
.mobile-only {
    display: none !important;
}

.desktop-only {
    display: flex !important;
}

/* Base Header Reset & Container */
.site-header {
    width: 100%;
    position: relative;
    z-index: 1000;
    background-color: #ffffff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    transition: var(--header-transition);
}

/* ==========================================================================
   HEADER TOP INFO BAR (Phone, Email & Social Media)
   ========================================================================== */
.header-top-info {
    background-color: var(--header-top-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 12.5px;
    transition: var(--header-transition);
}

.header-top-info-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 38px;
}

/* Left Contact Items */
.top-info-left {
    display: flex;
    align-items: center;
    gap: 22px;
}

.top-info-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #e2e8f0;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.top-info-item:hover {
    color: #ffffff;
}

.top-info-icon {
    flex-shrink: 0;
}

/* Right Social Media Items */
.top-info-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.top-social-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.top-social-item:hover {
    color: #ffffff;
    transform: translateY(-1px);
}

.top-social-item svg,
.social-icon-img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Main Header Navigation Layout */
.header-container {
    max-width: 1340px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100px;
    transition: var(--header-transition);
}

/* 1. Left: Brand Logo & Title */
.header-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    z-index: 20;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    /* background: #ffffff; */
    /* padding: 8px 18px; */
    position: relative;
    z-index: 20;
}


.brand-logo {
    display: flex;
    align-items: center;
    background: #FFF;
    border-radius: 12px;
    padding: 0px 10px;
}

.brand-logo img {
    height: 112px;
    width: auto;
    object-fit: contain;
    transition: var(--header-transition);
}

.brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.company-name-line1 {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--header-navy);
    line-height: 1.25;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.company-name-line2 {
    font-size: 13.5px;
    font-weight: 900;
    color: var(--header-navy);
    line-height: 1.25;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

/* 2. Center: Desktop Navigation Menu */
.header-nav.desktop-only {
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 24px;
    height: 100%;
}

.menu-item {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.menu-link {
    font-size: 14px;
    font-weight: 700;
    color: var(--header-navy);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    height: 100%;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    padding: 0 2px;
    transition: color 0.25s ease;
}

.dropdown-chevron-svg {
    transition: transform 0.25s ease;
    opacity: 0.85;
}

.menu-item.has-dropdown:hover>.menu-link .dropdown-chevron-svg {
    transform: rotate(180deg);
}

/* Active & Hover state for Menu Items */
.menu-link:hover,
.menu-item.active>.menu-link {
    color: var(--header-red);
}

/* Active Underline Indicator - Positioned at bottom edge of header */
.menu-item.active>.menu-link::after,
.menu-link:hover::after {
    content: '';
    position: absolute;
    bottom: 25px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--header-red);
    border-radius: 2px 2px 0 0;
    animation: fadeInLine 0.25s ease forwards;
}

@keyframes fadeInLine {
    from {
        opacity: 0;
        transform: scaleX(0.4);
    }

    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

/* 3. Submenu Dropdown Level 2 */
.submenu.level-2 {
    position: absolute;
    top: 100%;
    left: 0;
    /* min-width: 240px; */
    width: max-content;
    background-color: #ffffff;
    box-shadow: 0 12px 30px rgba(14, 56, 122, 0.12);
    border-radius: 8px;
    border-top: 3px solid var(--header-red);
    padding: 8px 0;
    margin: 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 1050;
}

.menu-item.has-dropdown:hover>.submenu.level-2 {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu-item {
    position: relative;
    width: 100%;
}

.submenu-item a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    transition: all 0.2s ease;
}

.submenu-item a:hover {
    background-color: #f8fafc;
    color: var(--header-red);
    /* padding-left: 24px; */
}

.flyout-chevron-svg {
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.submenu-item.has-dropdown-level-3:hover>a .flyout-chevron-svg {
    transform: translateX(3px);
    opacity: 1;
}

/* 4. Submenu Dropdown Level 3 */
.submenu.level-3 {
    position: absolute;
    top: 0;
    left: 100%;
    /* min-width: 220px; */
    width: max-content;
    background-color: #ffffff;
    box-shadow: 0 12px 30px rgba(14, 56, 122, 0.12);
    border-radius: 8px;
    border-top: 3px solid var(--header-red);
    padding: 8px 0;
    margin-left: 2px;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 1060;
}

.submenu-item.has-dropdown-level-3:hover>.submenu.level-3 {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* 5. Right: CTA Button (ĐĂNG KÝ HỌC) */
.btn-register {
    background: linear-gradient(135deg, var(--header-red) 0%, var(--header-red-hover) 100%);
    color: #ffffff !important;
    padding: 11px 26px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 13.5px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--header-transition);
    display: inline-block;
    border: none;
    cursor: pointer;
}

.btn-register:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #f0242c 0%, #d4171e 100%);
}

/* 6. Sticky Header Animation */
.site-header.is-sticky {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 1);
    /* backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px); */
    box-shadow: var(--header-sticky-shadow);
    animation: stickySlideDown 0.38s ease-out;
}

/* Hide Header Top Info Bar when header is sticky */
.site-header.is-sticky .header-top-info {
    display: none;
}

/*
.site-header.is-sticky .header-inner {
    height: 64px;
} */

/* .site-header.is-sticky .brand-link {
    margin-top: 0;
    margin-bottom: 0;
    padding: 4px 10px;
    box-shadow: none;
    background: transparent;
    transform: none;
} */

.site-header.is-sticky .brand-logo img {
    height: 90px;
}

@keyframes stickySlideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 7. Mobile Layout Elements */
.mobile-toggle-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    /* padding: 8px; */
    color: var(--header-navy);
    z-index: 1010;
    align-items: center;
    justify-content: center;
}

.mobile-toggle-btn:hover {
    color: var(--header-red);
}

/* Mobile Drawer Overlay */
.mobile-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Drawer Navigation */
.mobile-drawer {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100vh;
    background-color: #ffffff;
    z-index: 1999;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    transition: left 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.mobile-drawer.active {
    left: 0;
}

.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--header-border);
}

.mobile-brand-title {
    font-size: 16px;
    font-weight: 900;
    color: var(--header-navy);
}

.mobile-drawer-close {
    background: transparent;
    border: none;
    color: var(--header-text-gray);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.mobile-drawer-close:hover {
    color: var(--header-red);
}

.mobile-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px 0 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mobile-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu-item {
    border-bottom: 1px solid #f1f5f9;
    padding: 12px 20px;
}

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

.mobile-menu-link {
    font-size: 14px;
    font-weight: 700;
    color: var(--header-navy);
    text-decoration: none;
    text-transform: uppercase;
    flex: 1;
}

.mobile-menu-item.active>.mobile-menu-link,
.mobile-menu-item.active>.mobile-menu-link-wrapper>.mobile-menu-link {
    color: var(--header-red);
}

.mobile-submenu-toggle {
    background: #f1f5f9;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    color: var(--header-navy);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.mobile-submenu-toggle.expanded {
    background-color: var(--header-red);
    color: #ffffff;
}

.mobile-submenu-toggle .line-v {
    transition: opacity 0.2s ease;
}

.mobile-submenu-toggle.expanded .line-v {
    opacity: 0;
}

/* Mobile Accordion Submenus */
.mobile-submenu {
    display: none;
    list-style: none;
    padding: 0;
    margin: 0;
    margin-left: 24px;
}

.mobile-submenu li {
    list-style: disc;
}

.mobile-submenu.level-2 .mobile-submenu-item a,
.mobile-submenu.level-2>li>a {
    display: block;
    padding: 10px 0px 10px 0px;
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
}

.mobile-submenu.level-3 li a {
    padding-left: 50px !important;
}

.mobile-drawer-footer {
    padding: 20px;
    border-top: 1px solid var(--header-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-contact-item {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--header-navy);
    text-decoration: none;
    text-align: center;
}

.btn-register-mobile {
    display: block;
    text-align: center;
    background: linear-gradient(135deg, var(--header-red) 0%, var(--header-red-hover) 100%);
    color: #ffffff !important;
    padding: 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    text-transform: uppercase;
}

.overflow-hidden {
    overflow: hidden !important;
}

@media (max-width: 1280px) {
    .brand-text {
        display: none;
    }
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

@media (max-width: 1200px) {
    .nav-menu {
        gap: 16px;
    }

    .company-name-line1,
    .company-name-line2 {
        font-size: 12px;
    }
}

@media (max-width: 1024px) {
    .brand-text {
        display: block;
        transform: translateY(3px);
    }

    .brand-logo {
        padding: 0;
    }

    .brand-link {
        gap: 10px;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: flex !important;
    }

    .header-inner {
        height: 68px;
    }


    .brand-logo img {
        height: 75px;
    }
}

@media (max-width: 768px) {
    .header-top-info {
        display: none;
        /* Hide top bar on mobile screens */
    }

    .brand-logo img {
        height: 55px !important;
    }
}

@media (max-width: 480px) {


    .header-container {
        padding: 0 15px;
    }
}


@media (max-width: 375px) {

    .company-name-line1,
    .company-name-line2 {
        font-size: 11px;
    }
}
