/* Styles for the navigation bar */
.navbar_wide {
    display: flex;              /* Use flexbox for horizontal alignment */
    justify-content: space-evenly; /* Spread items evenly */
    align-items: center;        /* Center items vertically */
    background-color: var(--navbar_link); /* Make the navbar darker */
    /* background-color: #ff9900; */
    height: 4rem;               /* Set a fixed height for the navbar */
    padding: 0;                 /* Remove padding/margin from navbar */
    transition: background-color 0.3s ease;
}

/* Styles for the links */
.navbar_wide a {
    flex: 1;                    /* Each link takes equal width */
    color: var(--foreground);   /* Default text color for links */

    text-align: center;         /* Center-align the text */
    text-decoration: none;      /* Remove the underline */
    line-height: 4rem;          /* Vertically center text to match navbar height */
    height: 100%;               /* Link fills the parent navbar height */
    display: flex;              /* Use flexbox inside link */
    justify-content: center;    /* Center link text horizontally */
    align-items: center;        /* Center link text vertically */
    font-size: 1.2rem;          /* Slightly larger font size */
    font-family: Arial, sans-serif;
    background-color: var(--navbar_link);     /* Optional: Add background for each link */

    transition: background-color 0.3s ease;
}

.navbar_wide a:hover {
    background-color: var(--selection);   /* Highlight with selection color */
    color: var(--cyan);                  /* Cyan text on hover */
}

.navbar_wide .home-link {
    flex: 0 0 138px; /* Prevent this link from resizing (fixed width of 138px) */
    width: 138px;    /* Explicit width */
    /*background-color: #ff9900; !* Keep the background color red as before *!*/
    text-align: center; /* Center-align the text */
    border: 1px solid var(--selection);
    /*padding: 0.5rem 1rem;*/
    font-size: 1rem;
    border-radius: 5px;
}

.navbar_narrow {
    display: none;
}

.nav_button {
    height: 100%;
    width: 138px;
    /*padding: 0; !* Optional: Remove extra padding *!*/
    /*border: none; !* Optional: Optional if you want cleaner styling *!*/
    background: var(--navbar_link);  /* Optional theme style */
    /*color: var(--foreground);     !* Optional text style *!*/
    cursor: pointer;             /* Add hand cursor for better UX */
}

.nav_button:hover {
    background: var(--selection); /* Optional theme style */
}

/* Default: Show full text menu (>=1381px) */
.menu-icon {
    display: none;  /* Hide icons by default */
}

.menu-text {
    display: inline; /* Show text by default */
}

@media (max-width: 1380px) and (min-width: 768px) {
    .menu-icon {
        display: inline;  /* Show icons */
        font-size: 1.4rem; /* Adjust icon size */
    }

    .menu-text {
        display: none;  /* Hide text */
    }
}

@media (max-width: 768px) {
    .navbar_wide {
        display: none;
    }

    .navbar_narrow {
        display: flex;
        flex-direction: column;
        height: auto;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 10px;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
    }

    .nav-menu.open {
        display: flex;
    }

    .hamburger-menu {
        display: block;
        margin-bottom: 10px;

        padding: 5px 10px;
        cursor: pointer;

    }

    .nav-menu a, .nav-menu button {
        text-align: left;
        padding: 10px 15px;
        width: 100%;
        border-bottom: 1px solid var(--selection);
    }

    .nav-menu a {
        /*color:#ff0000;*/
        color: var(--foreground);
        text-decoration-line: none;
        background-color: var(--navbar_link);
    }

    .nav-menu a:first-child {
        border-radius: 5px 5px 0 0;
    }

    .nav-menu a:last-child {
        border-radius: 0 0 5px 5px;
    }

    .nav-menu a:hover {
        color: var(--cyan);
        background-color: var(--selection);
    }
}