/* =========================================================
   HEADER.CSS
   Top Bar + Navbar + Mobile Menu
   ========================================================= */


/* =========================================================
   1. SITE HEADER
   ========================================================= */

.site-header {
    position: relative;
    z-index: 1000;

    width: 100%;

    background: var(--white);

    box-shadow:
        0 6px 20px
        rgba(15, 23, 42, 0.06);
}


/* =========================================================
   2. TOP BAR
   ========================================================= */

.top-bar {
    position: relative;

    background:
        linear-gradient(
            135deg,
            var(--primary-dark),
            var(--primary)
        );

    color: var(--white);
}

.top-bar-container {
    width: min(
        calc(100% - 40px),
        var(--container-width)
    );

    min-height: 42px;

    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;
}

.top-contact {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 18px;
}

.top-contact-item {
    display: inline-flex;
    align-items: center;

    gap: 7px;

    color:
        rgba(255, 255, 255, 0.90);

    font-size: 13px;
    font-weight: 500;

    transition: var(--transition-fast);
}

.top-contact-item i {
    color: var(--secondary);

    font-size: 12px;
}

.top-contact-item:hover {
    color: var(--white);
}

.top-right {
    display: flex;
    align-items: center;

    gap: 15px;
}

.top-welcome {
    color:
        rgba(255, 255, 255, 0.82);

    font-size: 12px;
}


/* =========================================================
   3. MAIN NAVBAR
   ========================================================= */

.main-navbar {
    position: relative;

    width: 100%;

    background:
        rgba(255, 255, 255, 0.96);

    -webkit-backdrop-filter:
        blur(16px);

    backdrop-filter:
        blur(16px);

    transition:
        background 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.3s ease;
}

.main-navbar.sticky {
    position: fixed;

    top: 0;
    left: 0;
    right: 0;

    z-index: 1200;

    background:
        rgba(255, 255, 255, 0.97);

    box-shadow:
        0 10px 35px
        rgba(15, 23, 42, 0.12);

    animation:
        navbarSlideDown
        0.35s ease;
}

@keyframes navbarSlideDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}


/* =========================================================
   4. NAVBAR CONTAINER
   ========================================================= */

.navbar-container {
    width: min(
        calc(100% - 40px),
        var(--container-width)
    );

    min-height: 82px;

    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 24px;
}


/* =========================================================
   5. BRAND
   ========================================================= */

.navbar-brand {
    display: inline-flex;
    align-items: center;

    gap: 12px;

    min-width: 0;
}

.navbar-logo {
    position: relative;

    flex: 0 0 auto;

    width: 58px;
    height: 58px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 5px;

    background:
        linear-gradient(
            145deg,
            #ffffff,
            #f8fafc
        );

    border:
        1px solid
        rgba(15, 23, 42, 0.08);

    border-radius: 16px;

    box-shadow:
        0 10px 25px
        rgba(15, 23, 42, 0.10);

    transform-style: preserve-3d;

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.navbar-brand:hover .navbar-logo {
    transform:
        perspective(600px)
        translateY(-2px)
        rotateX(3deg)
        rotateY(-3deg);

    box-shadow:
        0 14px 30px
        rgba(15, 23, 42, 0.14);
}

.navbar-logo img {
    width: 100%;
    height: 100%;

    object-fit: contain;
}

.navbar-brand-text {
    display: flex;
    flex-direction: column;

    min-width: 0;
}

.navbar-brand-text strong {
    max-width: 330px;

    color: var(--dark);

    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 800;

    line-height: 1.2;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navbar-brand-text small {
    margin-top: 4px;

    max-width: 300px;

    color: var(--text-light);

    font-size: 11px;
    font-weight: 500;

    letter-spacing: 0.2px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* =========================================================
   6. NAVBAR MENU
   ========================================================= */

.navbar-menu {
    display: flex;
    align-items: center;

    gap: 24px;

    margin-left: auto;
}

.navbar-links {
    display: flex;
    align-items: center;

    gap: 4px;
}

.navbar-links li {
    position: relative;
}

.navbar-links a {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;

    padding: 9px 13px;

    color: var(--dark-soft);

    border-radius: 10px;

    font-size: 14px;
    font-weight: 700;

    transition:
        color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}

.navbar-links a::after {
    content: "";

    position: absolute;

    left: 50%;
    bottom: 4px;

    width: 0;
    height: 2px;

    background:
        linear-gradient(
            90deg,
            var(--primary),
            var(--primary-light)
        );

    border-radius: 50px;

    transform:
        translateX(-50%);

    transition:
        width 0.25s ease;
}

.navbar-links a:hover {
    color: var(--primary);

    background:
        rgba(34, 197, 94, 0.07);

    transform:
        translateY(-1px);
}

.navbar-links a:hover::after {
    width: 22px;
}

.navbar-links a.active {
    color: var(--primary);

    background:
        rgba(34, 197, 94, 0.10);
}

.navbar-links a.active::after {
    width: 24px;
}


/* =========================================================
   7. ADMISSION BUTTON
   ========================================================= */

.navbar-admission-btn {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    min-height: 46px;

    padding: 11px 19px;

    color: var(--white);

    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--primary-light)
        );

    border:
        1px solid
        rgba(255, 255, 255, 0.18);

    border-radius: 13px;

    font-size: 13px;
    font-weight: 800;

    box-shadow:
        0 10px 24px
        rgba(20, 83, 45, 0.22);

    overflow: hidden;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.navbar-admission-btn::before {
    content: "";

    position: absolute;

    top: -80%;
    left: -40%;

    width: 45px;
    height: 220%;

    background:
        rgba(255, 255, 255, 0.22);

    transform:
        rotate(25deg);

    transition:
        left 0.55s ease;
}

.navbar-admission-btn:hover {
    color: var(--white);

    transform:
        translateY(-3px);

    box-shadow:
        0 16px 32px
        rgba(20, 83, 45, 0.30);
}

.navbar-admission-btn:hover::before {
    left: 120%;
}


/* =========================================================
   8. MOBILE MENU BUTTON
   ========================================================= */

.mobile-menu-btn {
    display: none;

    width: 46px;
    height: 46px;

    flex: 0 0 auto;

    align-items: center;
    justify-content: center;
    flex-direction: column;

    gap: 5px;

    padding: 0;

    background:
        var(--bg-soft);

    border:
        1px solid
        var(--border);

    border-radius: 12px;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.mobile-menu-btn:hover {
    background:
        rgba(34, 197, 94, 0.08);

    border-color:
        rgba(34, 197, 94, 0.25);
}

.mobile-menu-btn span {
    width: 21px;
    height: 2px;

    background: var(--dark);

    border-radius: 20px;

    transition:
        transform 0.3s ease,
        opacity 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform:
        translateY(7px)
        rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform:
        translateY(-7px)
        rotate(-45deg);
}


/* =========================================================
   9. DESKTOP SMALL
   ========================================================= */

@media (max-width: 1180px) {

    .navbar-container {
        gap: 16px;
    }

    .navbar-menu {
        gap: 14px;
    }

    .navbar-links {
        gap: 1px;
    }

    .navbar-links a {
        padding-left: 9px;
        padding-right: 9px;

        font-size: 13px;
    }

    .navbar-brand-text strong {
        max-width: 260px;

        font-size: 16px;
    }

    .navbar-brand-text small {
        max-width: 240px;
    }
}


/* =========================================================
   10. MOBILE NAVIGATION
   ========================================================= */

@media (max-width: 991px) {

    .top-bar-container {
        width: min(
            calc(100% - 30px),
            var(--container-width)
        );
    }

    .top-right {
        display: none;
    }

    .top-contact {
        width: 100%;

        justify-content: center;

        gap: 18px;
    }

    .navbar-container {
        position: relative;

        width: min(
            calc(100% - 30px),
            var(--container-width)
        );

        min-height: 74px;
    }

    .navbar-logo {
        width: 52px;
        height: 52px;

        border-radius: 14px;
    }

    .navbar-brand-text strong {
        max-width: 350px;

        font-size: 17px;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .navbar-menu {
        position: absolute;

        top: calc(100% + 1px);
        left: 0;
        right: 0;

        display: flex;
        flex-direction: column;
        align-items: stretch;

        gap: 14px;

        padding: 18px;

        background:
            rgba(255, 255, 255, 0.98);

        -webkit-backdrop-filter:
            blur(20px);

        backdrop-filter:
            blur(20px);

        border:
            1px solid
            rgba(15, 23, 42, 0.08);

        border-radius:
            0 0 18px 18px;

        box-shadow:
            0 25px 45px
            rgba(15, 23, 42, 0.14);

        opacity: 0;
        visibility: hidden;

        transform:
            translateY(-12px);

        pointer-events: none;

        transition:
            opacity 0.25s ease,
            visibility 0.25s ease,
            transform 0.25s ease;
    }

    .navbar-menu.active {
        opacity: 1;
        visibility: visible;

        transform:
            translateY(0);

        pointer-events: auto;
    }

    .navbar-links {
        width: 100%;

        flex-direction: column;
        align-items: stretch;

        gap: 5px;
    }

    .navbar-links li {
        width: 100%;
    }

    .navbar-links a {
        width: 100%;

        justify-content: flex-start;

        min-height: 46px;

        padding: 11px 14px;

        border-radius: 10px;

        font-size: 14px;
    }

    .navbar-links a::after {
        display: none;
    }

    .navbar-links a:hover {
        transform: none;
    }

    .navbar-admission-btn {
        width: 100%;

        min-height: 48px;
    }
}


/* =========================================================
   11. MOBILE
   ========================================================= */

@media (max-width: 767px) {

    .top-bar-container {
        min-height: 38px;
    }

    .top-contact {
        gap: 12px;
    }

    .top-contact-item {
        font-size: 12px;
    }

    .navbar-container {
        min-height: 68px;
    }

    .navbar-logo {
        width: 47px;
        height: 47px;

        padding: 4px;
    }

    .navbar-brand {
        gap: 10px;
    }

    .navbar-brand-text strong {
        max-width: 240px;

        font-size: 15px;
    }

    .navbar-brand-text small {
        max-width: 220px;

        font-size: 10px;
    }

    .mobile-menu-btn {
        width: 43px;
        height: 43px;
    }
}


/* =========================================================
   12. SMALL MOBILE
   ========================================================= */

@media (max-width: 480px) {

    .top-bar-container {
        width: calc(100% - 24px);
    }

    .top-contact {
        justify-content: flex-start;

        overflow-x: auto;

        flex-wrap: nowrap;

        scrollbar-width: none;
    }

    .top-contact::-webkit-scrollbar {
        display: none;
    }

    .top-contact-item {
        flex: 0 0 auto;
    }

    .top-contact-item span {
        max-width: 180px;

        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .navbar-container {
        width: calc(100% - 24px);
    }

    .navbar-brand-text strong {
        max-width: 185px;

        font-size: 14px;
    }

    .navbar-brand-text small {
        display: none;
    }

    .navbar-menu {
        padding: 14px;

        border-radius:
            0 0 15px 15px;
    }
}


/* =========================================================
   13. VERY SMALL SCREEN
   ========================================================= */

@media (max-width: 360px) {

    .navbar-logo {
        width: 44px;
        height: 44px;
    }

    .navbar-brand-text strong {
        max-width: 150px;

        font-size: 13px;
    }

    .mobile-menu-btn {
        width: 40px;
        height: 40px;
    }
}


/* =========================================================
   14. PRINT
   ========================================================= */

@media print {

    .site-header {
        display: none !important;
    }
}