/* Layout Fixes */
:root {
    --mini-header-height: 44px;
    --navbar-height: 70px;
    --page-top-offset: calc(var(--mini-header-height) + var(--navbar-height));
}

/* On small devices we use a single compact header row (mini-header).
   The main navbar/mega-menu is desktop-only, so don't reserve extra space. */
@media (max-width: 991.98px) {
    :root {
        --mini-header-height: 56px;
        --navbar-height: 0px;
        --page-top-offset: var(--mini-header-height);
    }
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    padding-top: var(--page-top-offset); /* Account for fixed mini header + navbar */
}

/* When the main navbar is not rendered (e.g. jobseeker dashboard/profile shell),
   only reserve space for the fixed mini-header to avoid large white space. */
body.has-mini-header-only {
    padding-top: var(--mini-header-height) !important;
}

/* Employer pages use a sidebar shell (no fixed top headers). */
body.has-no-top-header {
    padding-top: 0 !important;
}

/* Mini header sits above the main navbar */
.mini-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1031 !important; /* Above navbar */
    height: var(--mini-header-height);
    display: flex;
    align-items: center;
}

.mini-header .container-fluid {
    width: 100%;
}

.mini-header-btn {
    border-radius: 0.6rem;
}

/* Ensure header stays at top */
.navbar {
    position: fixed !important;
    top: var(--mini-header-height) !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1030 !important; /* Above other content */
    width: 100% !important;
    background-color: white !important;
}

/* Main content takes remaining space */
main {
    min-height: calc(100vh - var(--page-top-offset));
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.has-mini-header-only main {
    min-height: calc(100vh - var(--mini-header-height));
}

body.has-no-top-header main {
    min-height: 100vh;
}

/* Footer stays at bottom */
.footer {
    margin-top: auto;
}
