@import url('animations.css');

.site-header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.header-navbar {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 70px;
    width: 100%;
    position: relative;
    z-index: 999;
    user-select: none;
    background-color: var(--header-navbar-bg-color, #FFFFFF);
    border-bottom: 1px solid var(--header-navbar-bottom-bd-color, #CBD4DD);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.header-navbar-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    width: 100%;
    padding: 0 2rem;
    max-width: 1600px;
}

.header-brand {
    text-decoration: none;
    color: var(--header-brand-title-color, #0100A6);
}

.header-navbar-logo {
    height: 2.5rem;
    width: auto;
    cursor: pointer;
}

.header-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.header-controls-base-btn {
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    cursor: pointer;
    user-select: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.2s ease;
}

.header-controls-base-btn:active {
    transform: scale(0.9);
}

.header-nav-wrapper {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1.5rem;
}

.nav-link {
    position: relative;
    text-decoration: none;
    color: var(--header-nav-link-text-color, #1A1A1A);
    font-weight: 500;
    font-size: 1.1rem;
    padding: 6px 0;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2.5px;
    background: var(--header-nav-link-hover-text-color, #0100A6);
    border-radius: 4px;
    transform: translateX(-50%);
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
}

.nav-link:hover {
    color: var(--header-nav-link-hover-text-color, #0100A6);
}

.nav-link:hover::after {
    width: 100%;
    box-shadow: 0 0 8px rgba(1, 0, 166, 0.6);
}

.nav-link.active {
    color: var(--header-nav-link-hover-text-color, #0100A6);
    font-weight: 600;
}

.nav-link.active::after {
    width: 100%;
    animation: breathingGlow 2.2s infinite ease-in-out;
}

.mobile-theme-switch-container,
.nav-close-chevron,
.header-hamburger-toggle {
    display: none;
}

.theme-switch {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    background: var(--header-theme-switch-color, #0100A6);
    cursor: pointer;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-icon-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

.theme-switch img {
    height: 1.2rem;
    width: 1.2rem;
    transition: opacity 0.3s ease;
}

.icon-sun {
    position: absolute;
    opacity: 1;
}

.icon-moon {
    position: absolute;
    opacity: 0;
}

input:checked+.theme-icon-container .icon-sun {
    opacity: 0;
}

input:checked+.theme-icon-container .icon-moon {
    opacity: 1;
}

@media (max-width: 768px) {
    .header-navbar-container {
        padding: 0 1rem;
    }

    .desktop-theme-switch {
        display: none;
    }

    .header-hamburger-toggle {
        display: block;
        background: transparent;
        padding: 5px;
        border: none;
        cursor: pointer;
    }

    .hamburger-bar {
        display: block;
        width: 24px;
        height: 3px;
        margin: 5px auto;
        background: var(--header-hamburger-bar-color, #0100A6);
        transition: all 0.3s ease-in-out;
    }

    .header-hamburger-toggle.active .hamburger-bar:nth-child(2) {
        opacity: 0;
    }

    .header-hamburger-toggle.active .hamburger-bar:nth-child(1) {
        transform: translateY(7.8px) rotate(45deg);
    }

    .header-hamburger-toggle.active .hamburger-bar:nth-child(3) {
        transform: translateY(-7.8px) rotate(-45deg);
    }

    .header-nav-wrapper {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--header-navbar-bg-color, #FFFFFF);
        flex-direction: column;
        align-items: center;
        padding: 1.5rem 1.5rem 1rem;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
        border-top: 1px solid var(--header-navbar-top-bd-color, #CBD4DD);
        border-bottom: 1px solid var(--header-navbar-bottom-bd-color, #CBD4DD);
        transform-origin: top center;
        transform: scaleY(0);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.25s ease,
            visibility 0.25s ease;
        z-index: 998;
    }

    .header-nav-wrapper.open {
        transform: scaleY(1);
        opacity: 1;
        visibility: visible;
    }

    .nav-menu {
        flex-direction: column;
        align-items: center;
        gap: 1.25rem;
        width: 100%;
    }

    .nav-link::after {
        height: 2px;
        border-radius: 3px;
    }

    .mobile-theme-switch-container {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 220px;
        padding: 0.85rem;
    }

    .nav-close-chevron {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        background: transparent;
        border: none;
        cursor: pointer;
        margin-top: 1rem;
        padding: 6px 12px;
        color: var(--header-nav-close-chevron-color, #0100A6);
        transition: color 0.2s ease, transform 0.2s ease;
    }

    .chevron-icon {
        font-size: 1.2rem;
    }

    .nav-close-chevron:hover .chevron-icon {
        text-shadow: 0 0 8px rgba(1, 0, 166, 0.6);
        animation: chevronJump 0.6s ease infinite;
    }
}