/* Reset and base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

html, body {
    height: 100%;
    width: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    color: #000000;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    padding-top: 1rem;
    position: relative;
}

body.modal-open {
    overflow: hidden;
}

main {
    flex: 1;
    display: flex;
}

.page-container {
    width: 100%;
    max-width: 1200px;

    margin-inline: auto;
    padding-inline: 20px;

    flex: 1;

    display: flex;
    flex-direction: column;
}

/* Header & navigation */
header {
    padding: 10px 20px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #0073b1; /* your blue */
}


ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
    color: #0073b1;
}

button {
    background-color: #0073b1;
    color: rgb(255, 255, 255);
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    transition: background 0.2s;
}

#menu-btn {
    font-size: 24px;
    background: none;
    border: none;
    color: rgb(0, 0, 0);
    cursor: pointer;
}

#menu-btn:hover {
    background-color: rgb(218, 218, 218);
    text-wrap-style: balance;
}

#exit-btn {
    font-size: 24px;
    background: none;
    border: none;
    color: rgb(0, 0, 0);
    cursor: pointer;
    position: absolute;
    right: 10px;
}

#exit-btn:hover {
    background-color: rgb(218, 218, 218);
    text-wrap-style: balance;
}

.cancel {
    width: 50%;
    max-width: 300px;
    min-width: 180px;
    margin: 10px;
    border-radius: 6px;
    background-color: gray;
    color: white;
    font-size: 16px;
    text-align: center;
    font-weight: bold;
}

.cancel:hover {
    background-color: rgb(146, 146, 146);
}

.nav-notification {
    position: relative;
    display: flex;
    align-items: center;
}


.badge {
    display: none;

    position: absolute;
    top: -8px;
    right: -10px;

    background-color: red;
    color: white;

    font-size: 11px;
    font-weight: bold;

    min-width: 18px;
    height: 18px;

    border-radius: 50%;

    justify-content: center;
    align-items: center;
}
.has-alert {
    color: red;
}

/* Sidebar (dropdown) */
.sidebar {
    position: fixed;
    top: 0;       /* below navbar */
    right: 0;
    width: 320px;
    max-width: 85%;
    height: 100vh;
    height: 100dvh;
    border: 1px solid, black;
    border-radius: 20px;
    background: white;
    display: flex;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    flex-direction: column;
    z-index: 999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: env(safe-area-inset-bottom);
}

.sidebar.active {
    display: flex;    /* show when clicked */
    transform: translateX(0);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5); /* 50% black */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 998;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar li {
    padding: 10px;
    border-bottom: 1px solid #5e5e5e4b;
}

.sidebar a {
    color: rgb(0, 0, 0);
}

header nav#info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav#info .login a {
    background-color: #0073b1;
    color: rgb(255, 255, 255);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 4px;
    font-weight: normal;
    transition: background 0.2s;
} 

header .nav-right a {
    background-color: #ffffff;
    color: rgb(0, 0, 0);
    text-decoration: none;
    font-weight: bold;
    padding: 10px 10px;
    border-radius: 4px;
    transition: background 0.2s;
} 

header nav#info a:hover {
    background-color: #b1b1b19f;
}

/* Auth links and buttons */
form button, body a.button {
    background-color: #0073b1;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    transition: background 0.2s;
}

form button:hover, body a.button:hover {
    background-color: #0073b19f;
}

/* Sidebar sections */

.menu-section {
    margin-top: 20px;
    margin-left: 5px;
    padding: 10px 20px 5px;
    color: #0073b1;
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: none !important;
}


/* Sidebar links */

.sidebar li {
    padding: 0;
    border-bottom: 1px solid #eeeeee;
}


.sidebar li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #222;
    font-weight: 500;
}


.sidebar li a:hover {
    background-color: #f2f8fb;
    color: #0073b1;
}


/* Logout */

.logout {
    margin-top: auto;
    border-top: 1px solid #ddd;
}


.logout button {
    width: 100%;
    background: transparent;
    color: #dc3545;
    text-align: left;
    padding: 12px 20px;
}


.logout button:hover {
    background-color: #fff1f1;
}


/* Footer */
footer {
    margin-top: 20px;
    padding: 10px 0;
    text-align: center;
    border-top: 1px solid #ddd;
}

footer a {
    margin: 0 10px;
    color: #0073b1;
    text-decoration: none;
    font-weight: bold;
}

footer a:hover {
    text-decoration: underline;
}

form button[type="submit"] {
    padding: 8px 15px;
}

/* Responsive */
@media (max-width: 600px) {
    /* #menu-toggle {
        display: block;
    } */


    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: #0073b1;
        margin-top: 10px;
    }

    .nav-links.active {
        display: flex;
    }

    .logo {
        justify-content: left;
    }

    header {
        justify-content: flex-end;
    }
}

@media(max-width: 400px){
    nav .sidebar{
        width: fit-content;
    }

    .search-wrapper {
    width: 100%;
    padding-top: 10px;
    }

}