/* Header and Navigation */
header {
    width: 100%;
    max-width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    background: #0b121d;
    z-index: 10;
    text-align: center;
    padding: 0;
    box-sizing: border-box;
}

/* Base Styles for Header Menu */
.header-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 50px;
    z-index: 11;
}

.header-menu .logo {
    display: inline-block;
    height: 50%;
    margin: 0;
    padding: 0;
}

.header-menu .logo img {
    height: 100%;
    width: auto;
    max-height: 30px; /* Ensure the header logo fits within the header */
    display: inline-block;
}
/* Base Styles for nav-links in the header */
.header-menu .nav-links {
    list-style: none;
    display: flex;
    gap: 20px; /* Adjust the spacing between the menu items */
    margin: 0;
    padding: 0;
    align-items: center; /* Vertically center the items */
    height: 100%; /* Make sure the links take the full height of the header */
}

/* Show menu when nav-active is added */
.header-menu .nav-links.nav-active {
    transform: translateX(0); /* Slide into view */
    opacity: 1; /* Make it fully visible */
    visibility: visible; /* Make it interactive */
}

.header-menu .nav-links li {
    display: inline-block;
    position: relative; /* needed for submenu positioning */
}

.header-menu .nav-links a {
    font-family: "Livvic Medium", sans-serif;
    font-size: 1.2em;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    padding: 5px 10px;
    transition: color 0.3s ease;
    cursor: pointer !important;
}

.header-menu .nav-links a:hover {
    color: rgb(90, 180, 255);
}

/* Submenu base hidden */
.header-menu .nav-links .submenu {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: calc(100% + 8px);
    background: #0b121d;
    border-radius: 0px 0px 8px 8px;
    min-width: 130px;
    display: none;
    z-index: 20;
}
.header-menu .nav-links .submenu li { display: block; }
.header-menu .nav-links .submenu a {
    display: block;
    padding: 10px 16px;
    white-space: nowrap;
    font-size: 0.98em; /* smaller than top-level */
}

/* Desktop hover to open submenu */
@media screen and (min-width: 769px) {
    /* Hover bridge: keeps hover active while moving from parent to submenu across the small gap */
    .header-menu .nav-links > li.has-submenu::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        height: 8px; /* match the gap above */
    }
    .header-menu .nav-links > li.has-submenu:hover > .submenu {
        display: block;
    }
}

/* Burger Menu Styles */
.burger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
    z-index: 12;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: #fff;
    transition: all 0.3s ease;
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
    .header-menu .nav-links {
        position: absolute;
        right: 0;
        height: 100vh;
        top: 50px;
        background-color: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(5px);
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 61%;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        padding-top: 20px;
        z-index: 9;
    }

    .burger {
        display: flex;
    }

    /* Mobile submenu: show inline under parent and indented */
    .header-menu .nav-links .submenu {
        position: static;
        background: transparent;
        backdrop-filter: none;
        border-radius: 0;
        min-width: 0;
        display: block; /* visible when menu is open */
        padding: 0 0 0 16px; /* indent */
        border: 0;
        box-shadow: none;
        transform: none;
    }
    .header-menu .nav-links .submenu a {
        padding: 6px 10px;
        font-size: 0.98em;
        opacity: 0.95;
    }
}

/* Display nav-links as a horizontal list in no-burger mode */
@media screen and (min-width: 769px) {
    .header-menu .nav-links {
        position: relative;
        transform: translateX(0); /* Make sure it's visible */
        opacity: 1; /* Ensure it's fully visible */
        visibility: visible; /* Allow interaction */
        height: auto; /* Adjust height to fit content */
        flex-direction: row; /* Display links horizontally */
        gap: 20px; /* Adjust spacing between links */
        background-color: transparent; /* Remove background color for horizontal menu */
        padding-top: 0; /* Remove extra padding */
        width: auto; /* Adjust width to fit content */
    }
}

.nav-active {
    transform: translateY(0%); /* Bring the menu into view */
}


@media screen and (max-width: 768px) {
    .nav-links li {
        animation: navLinkFade 0.3s forwards;
    }

    .nav-links li:nth-child(1) {
        animation-delay: 0.1s;
    }

    .nav-links li:nth-child(2) {
        animation-delay: 0.2s;
    }

    .nav-links li:nth-child(3) {
        animation-delay: 0.3s;
    }
}

@keyframes navLinkFade {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0px);
    }
}

/* Burger Animation */
.toggle .line1 {
    transform: rotate(-45deg) translate(-5px, 5px);
}

.toggle .line2 {
    opacity: 0;
}

.toggle .line3 {
    transform: rotate(45deg) translate(-5px, -5px);
}