/* WAI-Core: src/app/static/css/shell/nav-responsive.css v3 */

@media (min-width: 801px) {
    nav:not(.force-mobile-nav) .mobile-nav {
        display: none !important;
        max-height: 0 !important;
        overflow: hidden !important;
    }
}

@media (max-width: 1100px) and (min-width: 801px) {
    .nav-center h1 {
        display: none;
    }

    .navbar-main {
        justify-content: center;
        padding: 0 40px;
        gap: 24px;
    }

    #nav-menu-container {
        position: static;
        left: auto;
        transform: none;
        display: flex;
        align-items: center;
    }

    .auth-nav-section {
        position: static;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #auth-buttons {
        display: flex;
        align-items: center;
        height: auto;
    }

    #auth-buttons li {
        margin-left: 18px;
    }

    #auth-buttons li:first-child {
        margin-left: 0;
    }
}

@media (max-width: 800px) {

    .navbar-container {
        position: relative;
        height: 60px;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-left: 27px;
        margin-right: 27px;
        margin-top: 2px;
    }

    .navbar-main, .footer-main {
        padding: 10px 20px;
        height: 40px;
    }

    .footer-main {
        height: 40px !important;
    }

    .navbar-main h1 {
        text-align: center;
        margin: 10px 0;
        font-size: 1.08rem;
        margin-right: 15px;
    }

    #nav-buttons,
    #auth-buttons {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        display: none;
    }

    .navbar-main.mobile-open #nav-buttons,
    .navbar-main.mobile-open #auth-buttons {
        display: flex;
    }

    .auth-nav-section {
        justify-content: center;
    }

    .nav-toggle {
        display: block;
        margin-right: 0px;
        padding-right: 0px;
    }

    #nav-buttons li:not(:last-child)::after,
    #auth-buttons li:not(:first-child)::before {
        display: none;
    }

    #nav-buttons li,
    #auth-buttons li {
        margin: 0;
    }

    .nav-center {
        display: flex;
        align-items: center;
        gap: 10px;
        justify-content: center;
        flex-shrink: 0;
        margin: 0 auto;
    }

    .nav-circle,
    .footer-circle {
        width: 60px !important;
        height: 60px !important;
    }

    .mobile-nav {
        display: flex;
        flex-direction: column;
        align-items: center;
        background-color: #243f53;
        margin: 52px 82px;
        color: white;
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.3s ease;
        border-radius: 0 0 var(--brand-border-primary-radius) var(--brand-border-primary-radius);
        box-shadow:
            inset 2px 0 0 rgba(255, 255, 255, 0.15),
            inset -2px 0 0 rgba(255, 255, 255, 0.15),
            inset 0 2px 10px rgba(0, 0, 0, 0.5);
        pointer-events: none;
    }

    .mobile-nav.open {
        max-height: 80vh;
        overflow-y: auto;
        pointer-events: all;
    }

    .mobile-nav-menu {
        width: 100%;
        padding: 15px 20px;
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .mobile-nav-menu ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .mobile-nav-menu li {
        text-align: center;
        margin: 5px 0;
    }

    .mobile-nav-menu a {
        text-decoration: none;
        color: white;
        font-size: 0.99rem;
        padding: 8px 12px;
        display: block;
        border-radius: 6px;
        transition: background-color 0.2s ease;
    }

    .mobile-nav-menu a:hover {
        background-color: #36596f;
    }
}

@media (max-width: 600px) {
    .nav-circle,
    .footer-circle {
        width: 45px !important;
        height: 45px !important;
    }
}

/* Force mobile navigation when the nav receives the class */
nav.force-mobile-nav .navbar-container {
    position: relative;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 27px;
    margin-right: 27px;
    margin-top: 2px;
}

body.right-panel-open nav.force-mobile-nav .navbar-container {
    margin-right: calc(27px + var(--right-panel-width));
}

nav.force-mobile-nav .navbar-main,
nav.force-mobile-nav .footer-main {
    padding: 10px 20px;
    height: 40px;
}

nav.force-mobile-nav .navbar-main h1 {
    text-align: center;
    margin: 10px 0;
    font-size: 1.08rem;
    margin-right: 15px;
}

nav.force-mobile-nav #nav-buttons,
nav.force-mobile-nav #auth-buttons {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    display: none;
}

nav.force-mobile-nav .navbar-main.mobile-open #nav-buttons,
nav.force-mobile-nav .navbar-main.mobile-open #auth-buttons {
    display: flex;
}

nav.force-mobile-nav .auth-nav-section {
    justify-content: center;
}

nav.force-mobile-nav .nav-toggle {
    display: block;
    margin-right: 0px;
    padding-right: 0px;
}

nav.force-mobile-nav #nav-buttons li:not(:last-child)::after,
nav.force-mobile-nav #auth-buttons li:not(:first-child)::before {
    display: none;
}

nav.force-mobile-nav #nav-buttons li,
nav.force-mobile-nav #auth-buttons li {
    margin: 0;
}

nav.force-mobile-nav .nav-center {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    flex-shrink: 0;
    margin: 0 auto;
}

nav.force-mobile-nav .nav-circle,
nav.force-mobile-nav .footer-circle {
    width: 60px !important;
    height: 60px !important;
}

nav.force-mobile-nav .mobile-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #243f53;
    margin: 52px 82px;
    color: white;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
    border-radius: 0 0 var(--brand-border-primary-radius) var(--brand-border-primary-radius);
    box-shadow:
        inset 2px 0 0 rgba(255, 255, 255, 0.15),
        inset -2px 0 0 rgba(255, 255, 255, 0.15),
        inset 0 2px 10px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

nav.force-mobile-nav .mobile-nav.open {
    max-height: 80vh;
    overflow-y: auto;
    pointer-events: all;
}

nav.force-mobile-nav .mobile-nav-menu {
    width: 100%;
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

nav.force-mobile-nav .mobile-nav-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

nav.force-mobile-nav .mobile-nav-menu li {
    text-align: center;
    margin: 5px 0;
}

nav.force-mobile-nav .mobile-nav-menu a {
    text-decoration: none;
    color: white;
    font-size: 0.99rem;
    padding: 8px 12px;
    display: block;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

nav.force-mobile-nav .mobile-nav-menu a:hover {
    background-color: #36596f;
}
