/* Hamburger Menu Styles */
.hamburger {
    display: none;
    cursor: pointer;
    z-index: 100;
    position: relative;
    /* Ensure z-index works */
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    -webkit-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
    background-color: var(--color-secondary);
}

/* Mobile Styling */
@media(max-width: 768px) {

    .navbar-container {
        /* Align hamburger to left */
        flex-direction: row !important;
        /* Override main.css column layout */
        justify-content: flex-start !important;
        padding: 1.5rem;
        align-items: center;
        position: relative;
    }

    .hamburger {
        display: block;
        margin: 0;
        /* Reset any potential margins */
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Hide the menu and toggle by default on mobile */
    .navbar-menu {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        width: 100%;
        gap: 0;
        flex-direction: column;
        justify-content: center;
        /* Center items vertically */
        align-items: center;
        background-color: var(--background-color);
        text-align: center;
        transition: 0.3s;
        z-index: 98;
        /* Below hamburger index of 100 */
    }

    .navbar-menu.active {
        left: 0;
    }

    .navbar-menu li {
        margin: 1.5rem 0;
    }

    .navbar-menu li a {
        font-size: 1.2rem;
    }

    /* Language Toggle on Mobile */
    /* Language Toggle on Mobile - Now inside the flex container */
    .language-toggle {
        /* Reset absolute positioning from i18n.css */
        position: static;
        width: auto;
        transform: none;
        margin-top: 2rem;
        display: flex;
        justify-content: center;
        opacity: 0;
        transition: opacity 0.3s ease 0.2s;
        /* Delay fade in */
    }

    /* When menu is active, ensure toggle is visible */
    .navbar-menu.active .language-toggle,
    .language-toggle.active {
        display: flex;
        /* Ensure flex is maintained */
        opacity: 1;
        /* No need for fixed positioning as it is now a child of the flex column menu */
    }
}