html,
body {
    background-color:lightgray;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

a {
    font-weight: bold;
    color: darkgreen;
    text-decoration: none;
}

#content {
    display: grid;
    grid-template-rows: 50px 1fr 20px;
    height: 100vh;
}

header {
    background-color: green;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000; /* Ensure it stays on top */
}

#login-button {
    background-color: green;
    border: 3px solid black;
    border-radius: 25px;
    font-size: 1.2em;
    font-weight: bold;
    padding: 5px 15px;
    margin-right: 10px;
    cursor: pointer;
    display: none;
}

main {
    padding: 20px;
    overflow-y: auto; /* Allows the content to scroll */
}

footer {
    background-color: green;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000; /* Ensure it stays on top */
}

.level-0 {
    font-size: 1.2em;
}

/* ------ LOADING OVERLAY ------ */

/* Loading overlay - covers everything */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* When overlay is hidden (by JS) */
#loading-overlay.overlay-hidden {
    opacity: 0;
    pointer-events: none;
    /* After fade out, display none so it doesn't interfere */
    animation: hideOverlay 0.3s forwards;
}

@keyframes hideOverlay {
    to {
        display: none;
        opacity: 0;
    }
}

/* Loading spinner styles */
.loading-spinner {
    text-align: center;
}

.spinner {
    display: inline-block;
    width: 48px;
    height: 48px;
    border: 4px solid #e9ecef;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner p {
    margin-top: 16px;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
}

/* Fallback: If JS fails or is disabled, ensure overlay is visible */
.no-js #loading-overlay {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Hide content initially, show when overlay is hidden */
#app {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#app.visible {
    opacity: 1;
}