@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

/* ==== Design Tokens — single source of truth for the app's palette, surfaces, motion. ==== */
:root {
    /* Brand */
    --ebc-green: #3b6b52;
    --ebc-green-hover: #2f5642;
    --ebc-green-subtle: #ecf3ef;

    /* Surfaces */
    --surface-1: #ffffff;
    --surface-2: #fafafa;
    --surface-3: #f3f4f6;

    /* Text */
    --text-primary: #1f2328;
    --text-secondary: #57606a;
    --text-tertiary: #8b95a1;

    /* Lines & elevation */
    --line-subtle: rgba(15, 23, 42, 0.08);
    /* Default stroke for navbar / panel separators — sits between subtle (0.08) and a heavy rule. Matches Material / GitHub Primer convention for page-chrome dividers. */
    --line-default: rgba(15, 23, 42, 0.14);
    --shadow-elevation-1: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-elevation-2: 0 4px 12px rgba(15, 23, 42, 0.08);

    /* Semantic — colours mirror Microsoft Fluent 2 status tokens (Orange 140 / Red 130 / Communication Blue) for cross-product visual coherence with Fluent UI surfaces. */
    --semantic-warning: #bc4b09; /* Fluent colorStatusWarningForeground1 — 5.5:1 contrast with white (WCAG AA). */
    --semantic-danger: #c0413f;
    --semantic-info: #2c7a9e;

    /* Motion */
    --motion-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
    --motion-default: 220ms cubic-bezier(0.16, 1, 0.3, 1);

    /* Layout: vertical viewport budget pages may use; MainLayout.razor.css overrides this when the system banner is visible. */
    --page-content-height: 100vh;
    /* Navbar chrome (height + 1px hairline border) — pages subtract this when sizing internal panels. */
    --navbar-chrome-height: 3.5rem;
    /* Bottom footer (Index.razor's drc-footer is position-fixed bottom-0; mirror its height in the page-content budget so panels don't slide under it). */
    --footer-height: 2rem;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    width: 100%;
    min-width: 320px;
    overflow-x: hidden;
}

.page, main {
    width: 100%;
    min-width: 320px;
}

/* Primary */
.bg-primary {
    background-color: var(--dxds-color-surface-primary-default-rest) !important;
}

.text-primary {
    color: var(--dxds-color-content-primary-default-rest) !important; /* FIXED */
}

.border-primary {
    border-color: var(--dxds-color-border-primary-default-rest) !important;
}

/* Secondary */
.bg-secondary {
    background-color: var(--dxds-color-surface-neutral-default-rest) !important;
}

.text-secondary {
    color: var(--dxds-color-content-neutral-default-rest) !important;
}

.border-secondary {
    border-color: var(--dxds-color-border-neutral-default-rest) !important;
}

/* Success */
.bg-success {
    background-color: var(--dxds-color-surface-success-default-rest) !important;
}

.text-success {
    color: var(--dxds-color-content-success-default-rest) !important; /* FIXED */
}

.border-success {
    border-color: var(--dxds-color-border-success-default-rest) !important;
}

/* Danger */
.bg-danger {
    background-color: var(--dxds-color-surface-danger-default-rest) !important;
}

.text-danger {
    color: var(--dxds-color-content-danger-default-rest) !important; /* FIXED */
}

.border-danger {
    border-color: var(--dxds-color-border-danger-default-rest) !important;
}

/* Warning */
.bg-warning {
    background-color: var(--dxds-color-surface-warning-default-rest) !important;
}

.text-warning {
    color: var(--dxds-color-content-warning-default-rest) !important; /* FIXED */
}

.border-warning {
    border-color: var(--dxds-color-border-warning-default-rest) !important;
}

/* Info */
.bg-info {
    background-color: var(--dxds-color-surface-info-default-rest) !important;
}

.text-info {
    color: var(--dxds-color-content-info-default-rest) !important; /* FIXED */
}

.border-info {
    border-color: var(--dxds-color-border-info-default-rest) !important;
}

/* Light */
.bg-light {
    background-color: var(--dxds-neutral-10) !important;
}

.text-light {
    color: var(--dxds-neutral-200) !important;
}

.border-light {
    border-color: var(--dxds-neutral-40) !important;
}

/* Dark */
.bg-dark {
    background-color: var(--dxds-neutral-250) !important;
}

.text-dark {
    color: var(--dxds-neutral-10) !important;
}

.border-dark {
    border-color: var(--dxds-neutral-250) !important;
}

.ms-Icon {
    font-family: 'FabricMDL2Icons' !important;
    font-style: normal !important;
    font-weight: normal !important;
    font-size: 1.15rem;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.background {
    background-repeat: no-repeat;
    height: 100%;
    background-position: center;
    background-size: cover;
    z-index: -1;
    position: fixed;
    width: 100%;
}

.background::before {
    content: "";
    position: fixed;
    width: 100%;
    height: 100vh;
    backdrop-filter: blur(3px);
}

#unauthorized-background {
    background-image: linear-gradient( rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5) ), url('/Assets/backgrounds/unauthback.jpg');
}

.whole-page-info {
    position: fixed;
    color: white;
    font-weight: bold;
    border: 3px solid #f1f1f1;
    top: calc(3.5rem + 40%);
    left: 50%;
    transform: translate(-50%, -50%);
    width: 33%;
    min-width: 35rem;
    height: 25%;
    min-height: 15rem;
    padding: 2.5rem;
    text-align: center;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient( rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2) )
}

.whole-page-info-dark {
    position: fixed;
    font-weight: bold;
    align-items: center;
    /*border: 3px solid dimgray;*/
    top: calc(35% + 3.5rem);
    left: 50%;
    transform: translate(-50%, -50%);
    width: 33%;
    min-width: 35rem;
    height: 25%;
    min-height: 15rem;
    padding: 2.5rem;
    text-align: center;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    animation: rotator 1.4s linear infinite;
    position: fixed;
    top: calc(35% + 3.5rem);
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-spinner-with-message-inner {
    animation: rotator 1.4s linear infinite;
}

.loading-spinner-with-message-outer {
    position: fixed;
    top: calc(35% + 3.5rem);
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes rotator {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(270deg);
    }
}

.path {
    stroke-dasharray: 187;
    stroke-dashoffset: 0;
    transform-origin: center;
    animation: dash 1.4s ease-in-out infinite, colors 5.6s ease-in-out infinite;
}

@keyframes colors {
    0% {
        stroke: var(--dxds-color-border-neutral-default-rest, lightgray);
    }

    25% {
        stroke: var(--dxds-color-surface-primary-default-rest);
    }

    50% {
        stroke: var(--dxds-color-border-neutral-default-rest, lightgray);
    }

    75% {
        stroke: var(--dxds-color-surface-primary-default-rest);
    }

    100% {
        stroke: var(--dxds-color-border-neutral-default-rest, lightgray);
    }
}

.dot-flashing {
    position: relative;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 5px;
    background-color: #ffffff;
    color: #ffffff;
    animation: dotFlashing 1s infinite linear alternate;
    animation-delay: .5s;
}

.dot-flashing::before, .dot-flashing::after {
    content: '';
    display: inline-block;
    position: absolute;
    top: 0;
}

.dot-flashing::before {
    left: -0.75rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 5px;
    background-color: #ffffff;
    color: #ffffff;
    animation: dotFlashing 1s infinite alternate;
    animation-delay: 0s;
}

.dot-flashing::after {
    left: 0.75rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 5px;
    background-color: #ffffff;
    color: #ffffff;
    animation: dotFlashing 1s infinite alternate;
    animation-delay: 1s;
}

@keyframes dotFlashing {
    0% {
        background-color: #ffffff;
    }

    50%, 100% {
        background-color: #808080;
    }
}

@keyframes dash {
    0% {
        stroke-dashoffset: 187;
    }

    50% {
        stroke-dashoffset: 46.75;
        transform: rotate(135deg);
    }

    100% {
        stroke-dashoffset: 187;
        transform: rotate(450deg);
    }
}

.error-popup .dx-popup-body-content {
    padding: 0 !important;
}

.error-details-pre {
    background-color: #f5f5f5;
    padding: 1.5rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85em;
    max-height: 20rem;
    margin-bottom: 0;
}

.mirror-line {
    margin-top: 2rem;
    margin-bottom: 2rem;
    height: 2rem;
    border: none;
    background-color: #000;
}

.dark-border-bottom {
    border-bottom: 1px solid dimgray;
}

/* ==== Generic utilities and DevExpress overrides relocated from MainLayout.css ==== */

/* Width / height utilities */
.w-min-content { width: min-content; }
.h-min-content { height: min-content; }
.w-fit-content { width: fit-content; }
.h-fit-content { height: fit-content; }

/* Build info pill (BuildInfo.razor) */
.fs-build-info {
    font-size: 12px;
}

/* Modals must always sit above DevExpress overlays */
.modal {
    z-index: 1050;
}

.modal-backdrop {
    z-index: 1045 !important;
}

/* Tables that overflow their container scroll horizontally */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Strip padding/margin from DevExpress dropdown bodies */
.dxbl-dropdown-body {
    padding: 0px !important;
    margin: 0px !important;
}

/* App-wide thin scrollbars for any descendant element */
body * ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
    background-color: #f5f5f5;
}

body * ::-webkit-scrollbar-track {
    border-radius: 10px;
    background-color: #f5f5f5;
}

body * ::-webkit-scrollbar-thumb {
    border-radius: 6px;
    background-color: darkgray;
}

/* Footer used by Index.razor */
.drc-footer {
    width: 100%;
    height: 2rem;
    background-color: var(--surface-1);
    border-top: 1px solid var(--line-subtle);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-right: 0.5rem;
    z-index: 1000;
}

.changelog-button:hover {
    color: var(--text-primary) !important;
}

/* Changelog (Changelog.razor) */
.drc-changelog-header-line {
    border-top: 3px solid #3c7f3c;
}

.drc-changelog-version-block {
    padding-top: 0.5rem;
}

.drc-changelog-version-title {
    font-weight: bold;
    font-size: 1rem;
}

.drc-changelog-release {
    font-style: italic;
    font-size: 0.9rem;
    color: #666666;
}

.drc-changelog-logo-row {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.drc-changelog-logo {
    height: 120px;
    width: auto;
    margin-top: 10px;
    margin-bottom: 15px;
}