/* === Site.css === */
/* All colors reference CSS variables from BaseTheme which are updated by ThemeService */

/******************   BEGIN TOASTER SETTINGS     ****************/
/* Ensure toasts float above headers, menus, modals, etc. */
.blazored-toast-container {
    z-index: 2147483647 !important;
}

/* fade in quickly, fade out right before removal */
.app-toast {
    animation: app-toast-fade-in 180ms ease-out 0ms 1, app-toast-fade-out 220ms ease-in calc(var(--app-toast-timeout, 3s) - 220ms) 1;
}

/* if you want the timeout to drive the fade-out delay globally, set a CSS var on html */
html {
    --app-toast-timeout: 3s;
}

@keyframes app-toast-fade-in {
    from {
        opacity: 0;
        transform: translateY(-4px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

@keyframes app-toast-fade-out {
    from {
        opacity: 1
    }

    to {
        opacity: 0
    }
}

/******************   END TOASTER SETTINGS     ****************/

/* Global HTML layout setup */
html, body, #app {
    height: 100%;
    margin: 0;
    overflow: hidden; /* Prevents scrolling */
}

/* Main container takes full height of the viewport */
.main-container {
    display: flex;
    flex-direction: column;
    height: 100vh; /* Ensures full viewport height */
}

/* Content section (body) */
.content-wrapper {
    flex: 1 0 auto; /* Allow it to expand and push footer down */
    overflow: hidden; /* Prevent content overflow */
    min-height: 100%;
}

/* Navbar (menu bar) layout */
.navbar.mainmenu {
    display: flex;
    align-items: flex-end;
    height: 64px;
    background-color: var(--main-page-background);
    border-bottom: 1px solid var(--border-primary);
    padding-left: 0;
    margin-bottom: 0;
    padding-bottom: 0;
    gap: 6px;
    position: relative;
}

    .navbar.mainmenu .nav-item {
        margin: 0;
    }

    .navbar.mainmenu .nav-link {
        font-size: 1.125rem;
        font-weight: 500;
        color: var(--unselected-tab-foreground) !important;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 1rem;
        border-radius: 6px 6px 0 0;
        background-color: transparent !important;
        border: none;
        text-decoration: none !important;
        position: relative;
        margin-bottom: -1px;
        z-index: 1;
    }

        /* Active tab styling */
        .navbar.mainmenu .nav-link.active,
        .navbar.mainmenu .nav-item .nav-link.active {
            background-color: var(--selected-tab-background) !important;
            color: var(--selected-tab-foreground) !important;
            font-weight: bold;
            text-decoration: none !important;
            border: 1px solid var(--selected-tab-border);
            border-bottom: none;
            border-radius: 6px 6px 0 0;
            height: 100%;
            z-index: 3;
            box-sizing: border-box;
        }

        /* Hover styling */
        .navbar.mainmenu .nav-link:hover {
            background-color: var(--tab-hover-background) !important;
            color: var(--tab-hover-foreground) !important;
            font-weight: bold;
            text-decoration: none !important;
            border: 1px solid var(--tab-hover-border);
            border-bottom: none;
            border-radius: 6px 6px 0 0;
            height: 100%;
            z-index: 2;
        }

/* First nav link margin */
.navbar-nav .nav-link:first-child {
    margin-left: 30px;
}

/* Continue styling across logo strip */
.logo-wrapper {
    background-color: var(--logo-background);
    display: flex;
    align-items: center;
    height: 64px;
    border-bottom: 1px solid var(--border-primary);
}

/* Home page background image and text styling */
.home-container {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Ensures content starts from the top */
    flex: 1; /* Allows it to take up remaining space in flex layout */
    overflow: hidden; /* Prevents the content from overflowing */
}

/* Background image should fill the screen. Each app supplies its own
   /images/construction-scene.jpg (or overrides this rule locally). */
.main-background {
    background-image: url('/images/construction-scene.jpg');
    background-size: cover;
    background-position: center;
    height: 100%; /* Ensures the background image fills the entire height */
    width: 100%; /* Ensures the image fills the width */
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Aligns content at the top */
    position: relative; /* Keeps everything in place */
}

/* Welcome text styling */
.welcome-text {
    color: white; /* Ensures text is white */
    text-align: center;
    font-size: 3rem;
    padding-top: 20px; /* Optional: space between the top of the page and the text */
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7); /* Adds shadow for better readability */
}

/* Footer should always be at the bottom of the page */
footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    text-align: center;
    background-color: var(--header-background);
    padding: 10px;
    z-index: 1; /* Ensure the footer stays above other elements */
}

/*  Page Spinner Section  */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--border-primary, #3498db);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-message {
    margin-top: 16px;
    color: white;
    font-family: "Segoe UI", Calibri, sans-serif;
    font-size: 16px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}
/*  End Page Spinner Section  */

.page-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

appstatescrollhost {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
