﻿/* =========================================================
   portal stylesheet
   Bootstrap-compatible responsive layout
   ========================================================= */

:root {
    /* Palette */
    --ga-green: #89B766;
    --ga-green-dark: #5E9F3D;
    --ga-green-darker: #4C8533;
    --ga-yellow: #E4B036;
    --ga-charcoal: #1D272A;
    --ga-mid-grey: #939598;
    --ga-page: #FBFBFB;
    --ga-border: #DDE2E3;
    --ga-warning-bg: #FFF7E8;
    --ga-warning-border: rgba(228, 176, 54, 0.45);

    /* Green tints (derived from --ga-green / --ga-green-dark) */
    --ga-green-tint-hover: rgba(137, 183, 102, 0.12);
    --ga-green-tint-active: rgba(137, 183, 102, 0.16);
    --ga-focus-ring: rgba(137, 183, 102, 0.32);

    /* Elevation */
    --ga-shadow-sm: 0 1px 3px rgba(29, 39, 42, 0.06);
    --ga-shadow-md: 0 3px 10px rgba(29, 39, 42, 0.08);
    --ga-shadow-green: 0 2px 6px rgba(94, 159, 61, 0.16);

    /* Shape and layout */
    --ga-radius-sm: 4px;
    --ga-radius-md: 6px;
    --ga-header-height: 82px;
    --ga-footer-height: 72px;
}

/* =========================================================
   Base layout
   ========================================================= */

html {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    height: auto;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    font-family: Aptos, Arial, Helvetica, sans-serif;
    color: var(--ga-charcoal);
    background: url("/lib/images/OutlineGrainMotif-A.png") no-repeat -120px 150px / 260px auto, url("/lib/images/OutlineGrainMotif-C.png") no-repeat calc(100% + 120px) 160px / 300px auto, linear-gradient(180deg, #FFFFFF 0%, var(--ga-page) 45%, #FFFFFF 100%);
    overflow-x: hidden;
}

header,
footer {
    flex-shrink: 0;
}

main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

    main.container-fluid {
        padding-left: clamp(12px, 3vw, 72px);
        padding-right: clamp(12px, 3vw, 72px);
    }

.content-area {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* =========================================================
   Header
   ========================================================= */

.custom-header {
    width: 100%;
    min-height: var(--ga-header-height);
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--ga-border);
    box-shadow: var(--ga-shadow-sm);
    position: relative;
    z-index: 100;
}

.header-container {
    min-height: var(--ga-header-height);
    padding-left: clamp(16px, 4vw, 76px);
    padding-right: clamp(16px, 4vw, 76px);
    position: relative;
}

.header-content {
    min-height: var(--ga-header-height);
    display: flex;
    align-items: center !important;
    gap: 28px;
}

    .header-content > img {
        width: 220px;
        height: auto;
        max-height: 64px;
        object-fit: contain;
        align-self: center;
        margin-right: 42px !important;
    }

/* =========================================================
   Navigation
   ========================================================= */

nav {
    margin-bottom: 0;
}

.navbar {
    height: var(--ga-header-height);
    padding: 0 !important;
    flex: 1 1 auto;
    overflow: visible;
}

.navbar-collapse {
    height: 100%;
    flex-grow: 1;
}

.navbar-nav {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-item {
    display: flex;
    align-items: center;
    height: 100%;
    border: none;
    width: fit-content;
    cursor: pointer;
    font-size: 1rem;
}

.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 100%;
    min-height: var(--ga-header-height);
    padding: 0 4px !important;
    margin: 0;
    border: none;
    color: var(--ga-charcoal) !important;
    font-family: Aptos, Arial, Helvetica, sans-serif;
    font-size: 1rem;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    transition: color 0.18s ease, background-color 0.18s ease;
}

    .nav-link::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 4px;
        border-radius: 4px 4px 0 0;
        background: transparent;
    }

    .nav-link:hover,
    .nav-link:focus {
        color: var(--ga-green-dark) !important;
        background: transparent !important;
        outline: none;
    }

    .nav-link.active {
        color: var(--ga-green-dark) !important;
        background: transparent !important;
        font-weight: 600;
    }

        .nav-link.active::after {
            background: var(--ga-green-dark);
        }

/* Bootstrap hamburger */

.navbar-toggler {
    z-index: 1000;
    margin-left: auto;
    border-color: var(--ga-green-dark);
    color: var(--ga-green-dark);
}

.navbar-light .navbar-toggler {
    color: var(--ga-green-dark);
    border-color: var(--ga-green-dark);
}

    .navbar-light .navbar-toggler:hover {
        color: var(--ga-green-dark);
        border-color: var(--ga-green-dark);
        background-color: var(--ga-green-tint-hover);
    }

.navbar-light .navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba%2894, 159, 61, 1%29' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

/* =========================================================
   Auth button
   ========================================================= */

.ml-auto {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    align-self: center;
}

.header-content > .ml-auto {
    height: var(--ga-header-height);
}

.auth-nav,
.auth-nav-item,
.auth-nav .form-inline {
    height: 100%;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.auth-nav-item {
    list-style: none;
}

.auth-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 22px;
    border: 1px solid var(--ga-green-dark);
    border-radius: var(--ga-radius-sm);
    background: var(--ga-green-dark);
    color: #FFFFFF !important;
    font-family: Aptos, Arial, Helvetica, sans-serif;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none !important;
    cursor: pointer;
    box-shadow: none;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    white-space: nowrap;
}

    .auth-button:hover,
    .auth-button:focus {
        background: var(--ga-green-darker);
        border-color: var(--ga-green-darker);
        color: #FFFFFF !important;
        text-decoration: none !important;
        box-shadow: var(--ga-shadow-green);
        outline: none;
    }

    .auth-button:active {
        transform: translateY(1px);
    }

/* =========================================================
   Embed page layout
   ========================================================= */

.embed-wrapper {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding-top: 18px;
    padding-bottom: 10px;
}

.button-container {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 54px;
    margin: 0 0 12px 0;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--ga-border);
    border-radius: var(--ga-radius-md);
    box-shadow: var(--ga-shadow-sm);
}

.btn,
.div-tab-button-active {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 18px;
    border: 1px solid var(--ga-green-dark);
    border-radius: var(--ga-radius-sm);
    background: #FFFFFF;
    color: var(--ga-green-dark);
    font-family: Aptos, Arial, Helvetica, sans-serif;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

    .btn:hover,
    .div-tab-button-active:hover {
        background: var(--ga-green-dark);
        color: #FFFFFF;
        border-color: var(--ga-green-dark);
        box-shadow: var(--ga-shadow-green);
    }

    .btn.focus,
    .btn:focus,
    .div-tab-button-active:focus {
        outline: 3px solid var(--ga-focus-ring);
        box-shadow: none;
    }

#divStatus {
    margin-left: 18px;
    color: var(--ga-charcoal);
    font-weight: 400;
}

    #divStatus::before {
        content: "Status:";
        margin-right: 8px;
        font-weight: 500;
    }

    #divStatus:empty::before {
        content: "";
    }

#divProcessingOverlay {
    margin-left: auto !important;
    color: var(--ga-charcoal);
}

.processing-box {
    display: inline-flex;
    align-items: center;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #E0E3E3;
    border-top: 3px solid var(--ga-mid-grey);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}

.processing-message {
    margin-left: 8px;
    margin-bottom: 0;
    font-size: 0.9rem;
    color: var(--ga-charcoal);
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Error alert */

#errorMessage,
.alert-warning {
    border-color: var(--ga-warning-border);
    background-color: var(--ga-warning-bg);
    color: var(--ga-charcoal);
}

#errorMessage {
    flex: 0 0 auto;
    margin: 0 0 12px 0;
    padding: 9px 16px;
    border: 1px solid var(--ga-warning-border);
    border-radius: var(--ga-radius-sm);
    text-align: left !important;
}

/* =========================================================
   Power BI embed sizing
   ========================================================= */

#embed-container {
    flex: 1 1 auto;
    width: 100%;
    height: calc(100vh - var(--ga-header-height) - var(--ga-footer-height) - 120px);
    min-height: 560px;
    max-height: none;
    overflow: hidden;
    background: #FFFFFF;
    border: 1px solid var(--ga-border);
    border-radius: var(--ga-radius-md);
    box-shadow: var(--ga-shadow-md);
}

    #embed-container iframe,
    #embed-container > iframe,
    #embed-container .powerbi-frame {
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        border: 0 !important;
        display: block;
    }

iframe {
    border: 0;
}

/* =========================================================
   Home page / unauthenticated content
   ========================================================= */

.jumbotron {
    margin-top: 18px;
    padding: clamp(24px, 4vw, 44px);
    background: linear-gradient(135deg, rgba(137, 183, 102, 0.08), rgba(255, 255, 255, 0.96)), #FFFFFF;
    border: 1px solid var(--ga-border);
    border-radius: var(--ga-radius-md);
    box-shadow: var(--ga-shadow-sm);
    font-family: Aptos, Arial, Helvetica, sans-serif;
}

    .jumbotron p {
        margin-bottom: 0;
        color: var(--ga-charcoal);
        font-size: 1.05rem;
    }

/* =========================================================
   Typography
   ========================================================= */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: Aptos, Arial, Helvetica, sans-serif;
    color: var(--ga-charcoal);
    font-weight: 600;
    line-height: 1.25;
}

h1 {
    font-size: 2rem;
}

h2 {
    margin-top: 20px;
    color: var(--ga-charcoal);
    font-size: 1.65rem;
}

h3 {
    margin-top: 20px;
    font-size: 1.3rem;
}

h4 {
    font-size: 1.1rem;
}

p {
    font-family: Aptos, Arial, Helvetica, sans-serif !important;
    color: var(--ga-charcoal);
    font-weight: 400;
}

ul i {
    padding-right: 4px;
}

.mb-3,
.my-3 {
    margin-bottom: 0 !important;
}

.pb-3 h2 {
    margin-top: 12px !important;
}

.point {
    opacity: 0.6;
    fill: var(--ga-yellow);
}

/* =========================================================
   Modal
   ========================================================= */

.modal-content {
    border: 0;
    border-radius: var(--ga-radius-md);
    box-shadow: var(--ga-shadow-md);
}

.modal-header {
    border-bottom: 1px solid var(--ga-border);
}

.modal-title {
    color: var(--ga-charcoal);
    font-weight: 600;
}

.modal-body {
    color: var(--ga-charcoal);
}

.modal-footer {
    border-top: 1px solid var(--ga-border);
}

    .modal-footer .btn-primary,
    .modal-footer .div-tab-button-active {
        background: var(--ga-green-dark);
        border-color: var(--ga-green-dark);
        color: #FFFFFF;
    }

        .modal-footer .btn-primary:hover,
        .modal-footer .div-tab-button-active:hover {
            background: var(--ga-green-darker);
            border-color: var(--ga-green-darker);
            color: #FFFFFF;
        }

/* =========================================================
   Footer
   ========================================================= */

footer {
    min-height: var(--ga-footer-height);
    padding: 10px clamp(12px, 3vw, 72px);
    background: rgba(255, 255, 255, 0.9);
    color: var(--ga-charcoal);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.footer-text {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0;
    font-size: 0.9rem;
    color: var(--ga-charcoal);
}

    .footer-text p {
        margin: 0;
        font-weight: 400;
    }

        .footer-text p:first-child::after {
            content: "";
            display: inline-block;
            width: 1px;
            height: 16px;
            margin-left: 18px;
            vertical-align: middle;
            background: var(--ga-mid-grey);
        }

.version-number {
    font-size: 0.9rem;
    color: var(--ga-charcoal);
    font-weight: 400;
}

.img-responsive-svg {
    max-width: 220px;
    height: auto;
    opacity: 0.9;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 991.98px) {
    :root {
        --ga-header-height: 76px;
        --ga-footer-height: 68px;
    }

    body {
        background: url("/lib/images/OutlineGrainMotif-A.png") no-repeat -130px 170px / 220px auto, linear-gradient(180deg, #FFFFFF 0%, var(--ga-page) 45%, #FFFFFF 100%);
    }

    .custom-header {
        min-height: var(--ga-header-height);
    }

    .header-container {
        min-height: var(--ga-header-height);
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .header-content {
        min-height: var(--ga-header-height);
        display: flex;
        align-items: center !important;
        gap: 12px;
    }

        .header-content > img {
            width: 180px;
            max-height: 58px;
            margin-right: 0 !important;
            flex: 0 0 auto;
        }

    .navbar {
        height: auto;
        flex: 1 1 auto;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        width: auto !important;
        margin-left: auto;
    }

    .navbar-toggler {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        padding: 8px 10px;
        border: 1px solid var(--ga-green-dark);
        border-radius: var(--ga-radius-sm);
        background: #FFFFFF;
    }

    .navbar-collapse {
        position: absolute;
        left: 16px;
        right: 16px;
        top: calc(100% + 1px);
        z-index: 999;
        height: auto;
        padding: 14px;
        background: #FFFFFF;
        border: 1px solid var(--ga-border);
        border-radius: var(--ga-radius-md);
        box-shadow: var(--ga-shadow-md);
    }

        .navbar-collapse:not(.show) {
            display: none !important;
        }

        .navbar-collapse.show {
            display: block !important;
        }

    .navbar-nav {
        height: auto;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        margin: 0;
        padding: 0;
    }

    .nav-item {
        height: auto;
        width: 100%;
    }

    .nav-link {
        width: 100%;
        min-height: 42px;
        height: auto;
        padding: 9px 12px !important;
        border-radius: var(--ga-radius-sm);
        font-weight: 500;
    }

        .nav-link::after {
            display: none;
        }

        .nav-link.active {
            background: var(--ga-green-tint-active) !important;
            font-weight: 600;
        }

    .header-content > .ml-auto.d-none.d-md-block {
        display: flex !important;
        height: var(--ga-header-height);
        margin-left: 12px !important;
    }

    .auth-nav,
    .auth-nav-item,
    .auth-nav .form-inline {
        height: auto;
    }

    .auth-button {
        min-height: 40px;
        padding: 8px 16px;
    }

    .embed-wrapper {
        padding-top: 14px;
        padding-bottom: 8px;
    }

    .button-container {
        min-height: auto;
        flex-wrap: wrap;
        align-items: stretch;
        padding: 10px;
        margin-bottom: 10px;
    }

        .button-container .btn,
        .button-container .div-tab-button-active {
            flex: 1 1 180px;
            width: auto;
        }

    #divStatus {
        flex: 1 1 100%;
        margin-left: 0;
    }

    #divProcessingOverlay {
        flex: 1 1 100%;
        width: 100%;
        margin-left: 0 !important;
    }

    #embed-container {
        height: calc(100vh - var(--ga-header-height) - 140px);
        min-height: 600px;
    }

    .img-responsive-svg {
        max-width: 190px;
    }
}

@media (max-width: 767.98px) {
    :root {
        --ga-header-height: 72px;
        --ga-footer-height: 64px;
    }

    main.container-fluid {
        padding-left: 12px;
        padding-right: 12px;
    }

    .header-content {
        gap: 8px;
    }

        .header-content > img {
            width: 150px;
            max-height: 52px;
        }

        .header-content > .ml-auto.d-none.d-md-block {
            display: none !important;
        }

    .navbar {
        flex: 0 0 auto;
    }

    .button-container {
        gap: 10px;
    }

        .button-container .btn,
        .button-container .div-tab-button-active {
            flex: 1 1 100%;
            width: 100%;
        }

    #embed-container {
        min-height: 640px;
    }

    footer {
        padding-top: 8px;
        padding-bottom: 8px;
        align-items: center;
    }

    .footer-text {
        width: auto;
        flex-direction: row;
        align-items: center;
        gap: 14px;
    }

        .footer-text p:first-child::after {
            margin-left: 14px;
        }

    .img-responsive-svg {
        max-width: 160px;
    }
}
