﻿:root {
    --oes-primary: #263247;
    --oes-secondary: #c9dcd5;
    /* Color Variables for Sections */
    --section-bg-default: #c9dcd5;
    --section-bg-primary: #263247;
    --section-bg-internal: #2f2f2f;
    --section-bg-external: #b03a2e;
    --section-bg-one: #D3D3D3;
    --section-bg-two: #888888;
    --section-text-dark: #333;
    --section-text-light: #fff;
    --section-border-color: #e2e8f0;
    /* Loading Animation Variables */
    --size: 200px; /* overall loader box */
    --loader-duration: 2600ms; /* one full clockwise lap */
    --loader-pad: 18px; /* distance of the track from outer edge */
    --loader-arm: 34px; /* length of each bar that forms the L */
    --loader-thick: 10px; /* thickness of the bars (corner weight) */
}


html, body {
    font-family: Scandia, sans-serif;
    font-weight: normal;
}

/* Heading Styles */
h1, h2, h3, h4, h5, h6 {
    font-family: Scandia, sans-serif;
    font-weight: 500; /* Use medium font weight for headings */
}


a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: var(--oes-primary);
    border-color: var(--oes-primary);
}

.btn-secondary {
    color: #000000;
    background-color: var(--oes-secondary);
    border-color: var(--oes-secondary);
}

.btn-success {
    color: #fff;
    background-color: #5cb85c;
    border-color: #5cb85c;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    background-color: #f0f0f0;
    border: 4px solid #f0f0f0;
    border-radius: 4px; /* Rounded corners */
    cursor: pointer;
    outline: none;
}

    input[type="checkbox"]:checked {
        background-color: var(--oes-primary);
        border: 4px solid #f0f0f0;
        border-radius: 1px;
        background-image: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 16 16%22 fill=%22white%22%3E%3Cpath d=%22M13.485 3.93a.75.75 0 0 1 0 1.06l-6.25 6.25a.75.75 0 0 1-1.06 0l-3.25-3.25a.75.75 0 1 1 1.06-1.06l2.72 2.72 5.72-5.72a.75.75 0 0 1 1.06 0z%22/%3E%3C/svg%3E');
        background-size: 14px 14px; /* Adjust size of the tick */
        background-position: center;
        background-repeat: no-repeat;
    }

    input[type="checkbox"]:disabled {
        cursor: not-allowed;
        background-color: #e0e0e0;
        border-color: #d0d0d0;
    }

        input[type="checkbox"]:disabled:checked {
            cursor: not-allowed;
            background-color: #a0a0a0;
            background-image: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 16 16%22 fill=%22%23808080%22%3E%3Cpath d=%22M13.485 3.93a.75.75 0 0 1 0 1.06l-6.25 6.25a.75.75 0 0 1-1.06 0l-3.25-3.25a.75.75 0 1 1 1.06-1.06l2.72 2.72 5.72-5.72a.75.75 0 0 1 1.06 0z%22/%3E%3C/svg%3E');
        }

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNT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LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}


@font-face {
    font-family: 'Scandia';
    src: url('/fonts/ScandiaLine-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Scandia';
    src: url('/fonts/ScandiaLine-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

/* From MainLayout */
.page {
    display: flex;
    flex-direction: row;

}

main {
    flex: 1;
}

.sidebar {
    height: 100vh;
    position: fixed; /* Fixed position to prevent additional scrolling */
    top: 0;
    left: 0;
    overflow-y: auto; /* Allow internal scrolling if content overflows */
    background-image: linear-gradient(180deg, #c9dcd5 0%, #263247 15%);
}

.top-row {
    background-color: #f7f7f7;
    border-bottom: 1px solid #d6d5d5;
    justify-content: flex-end;
    height: 3.5rem;
    display: flex;
    align-items: center;
}

    .top-row a, .top-row .btn-link {
        white-space: nowrap;
        margin-left: 1.5rem;
        text-decoration: none;
    }

        .top-row a:hover, .top-row .btn-link:hover {
            text-decoration: underline;
        }

        .top-row a:first-child {
            overflow: hidden;
            text-overflow: ellipsis;
        }

@media (max-width: 640.98px) {
    .top-row {
        justify-content: space-between;
    }

        .top-row a, .top-row .btn-link {
            margin-left: 0;
        }
}

@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 250px;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    .top-row {
        position: sticky;
        top: 0;
        z-index: 10;
    }

        .top-row.auth a:first-child {
            flex: 1;
            text-align: right;
            width: 0;
        }

    .top-row, article {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }
}

#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;
    }

.warning-container {
    background-color: #ffebee; /* Light red background */
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

    .warning-container .warning-header {
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 1px solid #ef5350; /* Red border */
    }

        .warning-container .warning-header h2 {
            margin: 0;
            color: #d32f2f; /* Dark red color for header text */
            font-size: 1.5rem;
        }

    .warning-container .warning-content {
        display: flex;
        flex-direction: column;
        color: #5d2121; /* Darker text for better readability */
    }

/* From NavMenu */

.nav-top-row {
    height: 3.5rem;
    background-color: rgba(38,50,71,0.4);
}

.navbar-brand {
    font-size: 1.1rem;
}

.bi {
    display: inline-block;
    position: relative;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    background-size: cover;
}

.nav-item {
    font-size: 0.9rem;
    padding-bottom: 0.5rem;
}

    .nav-item:first-of-type {
        padding-top: 1rem;
    }

    .nav-item:last-of-type {
        padding-bottom: 1rem;
    }

    .nav-item .nav-link {
        color: #d7d7d7;
        background: none;
        border: none;
        border-radius: 4px;
        height: 3rem;
        display: flex;
        align-items: center;
        gap: 0.25rem;
        width: 100%;
    }

    .nav-item .bi {
        display: inline-flex;
        align-items: center;
        justify-content: left;
        vertical-align: middle;
        font-size: 1.5rem; 

    }

    .nav-item a.active {
        background-color: rgba(255,255,255,0.37);
        color: white;
    }

    .nav-item .nav-link:hover {
        background-color: rgba(255,255,255,0.1);
        color: white;
    }


.small-text {
    font-size: 0.8rem; /* Smaller text size */
}

    .small-text .nav-link {
        line-height: 1; /* Set line height to reduce vertical space */
    }

.nav-scrollable {
    display: block; /* Always display the nav menu */
    height: calc(100vh - 3.5rem);
    overflow-y: auto;
}


/* From Vertical Masonry */

.dual-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.section-half {
    flex: 1;
}

    .section-half h2, .section-half h3, .section-half h4 {
        margin-bottom: 10px;
    }

td, th {
    color: black;
}

td:has(input[type="text"]) {
    background-color: #f2f2f2;
}


.section-container {
    background-color: var(--section-bg-default);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: var(--section-text-dark);
}

/* Section Header Styles */
.section-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--section-border-color);
}

    .section-header h1 {
        font-size: 2rem;
        color: #2d3748;
        margin: 0;
    }

    .section-header h2 {
        font-size: 1.5rem;
        color: #2d3748;
        margin: 0;
    }

    .section-header h3 {
        font-size: 1.25rem;
        color: #2d3748;
        margin: 0;
    }

    .section-header h4 {
        font-size: 1rem;
        color: #2d3748;
        margin: 0;
    }

/* Variant Containers */
.section-container.one {
    background-color: var(--section-bg-one);
}
.section-container.two {
    background-color: var(--section-bg-two);
}

.section-container.internal-leaf {
    background-color: var(--section-bg-internal);
    color: var(--section-text-light);
}

.section-container.external-leaf {
    background-color: var(--section-bg-external);
    color: var(--section-text-light);
}

.section-container.alternative {
    background-color: var(--section-bg-primary);
    color: var(--section-text-light);
}

    /* Variant Header Styles */
    .section-container.internal-leaf .section-header,
    .section-container.external-leaf .section-header,
    .section-container.alternative .section-header {
        border-bottom-color: rgba(255,255,255,0.2);
    }

        .section-container.internal-leaf .section-header h1,
        .section-container.external-leaf .section-header h1,
        .section-container.alternative .section-header h1 {
            color: var(--section-text-light);
        }

        .section-container.internal-leaf .section-header h2,
        .section-container.external-leaf .section-header h2,
        .section-container.alternative .section-header h2 {
            color: var(--section-text-light);
        }

        .section-container.internal-leaf .section-header h3,
        .section-container.external-leaf .section-header h3,
        .section-container.alternative .section-header h3 {
            color: var(--section-text-light);
        }

    .section-container.alternative > .section-content > .section-container .section-header h1,
    .section-container.alternative > .section-content > .section-container .section-header h2,
    .section-container.alternative > .section-content > .section-container .section-header h3,
    .section-container.alternative > .section-content > .section-container .section-header h4 {
        color: var(--section-text-dark);
    }

    .section-container.alternative > .section-content > .section-container.internal-leaf .section-header h1,
    .section-container.alternative > .section-content > .section-container.internal-leaf .section-header h2,
    .section-container.alternative > .section-content > .section-container.internal-leaf .section-header h3,
    .section-container.alternative > .section-content > .section-container.external-leaf .section-header h1,
    .section-container.alternative > .section-content > .section-container.external-leaf .section-header h2,
    .section-container.alternative > .section-content > .section-container.external-leaf .section-header h3 {
        color: var(--section-text-light) !important;
    }
/* Section Content */
.section-content {
    display: flex;
    flex-direction: column;
}

/* Special Nested Container Handling */
.section-container.alternative > .section-content > .section-container {
    background-color: var(--section-bg-default);
    color: var(--section-text-dark);
}

    .section-container.alternative > .section-content > .section-container.internal-leaf,
    .section-container.alternative > .section-content > .section-container.external-leaf {
        background-color: inherit;
        color: var(--section-text-light);
    }


    .section-container.alternative .section-container .section-header h3,
    .section-container.alternative .section-container .section-header h4 {
        color: var(--section-text-dark);
    }

.section-container.alternative .section-container.internal-leaf .section-header h3,
.section-container.alternative .section-container.internal-leaf .section-header h4 {
    color: var(--section-text-light);
}

.section-container.alternative .section-container.external-leaf .section-header h3,
.section-container.alternative .section-container.external-leaf .section-header h4 {
    color: var(--section-text-light);
}

.section-container.alternative .section-container.alternative .section-header h3,
.section-container.alternative .section-container.alternative .section-header h4 {
    color: var(--section-text-light);
}

    /* Nested Variants in Alternative Container */
    .section-container.alternative .section-container.internal-leaf,
    .section-container.alternative .section-container.external-leaf {
        color: var(--section-text-light);
    }




/* Math Container Color Handling */
.section-container.alternative .section-content div[id^="maths-container"] .katex *,
.section-container.internal-leaf .section-content div[id^="maths-container"] .katex *,
.section-container.external-leaf .section-content div[id^="maths-container"] .katex * {
    color: var(--section-text-light) !important;
}

/* Layout for sections with diagrams */
.section-with-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.section-inputs {
    display: flex;
    flex-direction: column;
}

.section-diagram {
    display: flex;
    justify-content: center;
    align-items: center;
}

.section-inputs label {
    display: block;
    margin-bottom: 5px;
    margin-top: 10px;
}

.section-inputs input {
    width: 100%;
    box-sizing: border-box;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .section-with-inputs {
        grid-template-columns: 1fr;
    }

    .section-diagram {
        margin-top: 20px;
    }
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

th, td {
    border: 1px solid #ccc;
    padding: 8px;
    text-align: left;
}

th {
    background-color: #fff;
}

td {
    background-color: #fcfcfc;
}

input {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f2f2f2;
}

select {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f2f2f2;
}

.checkbox-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    border: 1px solid var(--section-border-color);
    border-radius: 8px;
    background-color: var(--section-bg-default);
    margin: 10px 0;
}

    .checkbox-container h3 {
        margin: 0;
        font-size: 1.25rem;
        color: var(--section-text-dark);
    }

    /* Bigger checkbox just for this container */
    .checkbox-container input[type="checkbox"] {
        width: 28px;
        height: 28px;
    }

/* Warning and success */

.warning-container {
    background-color: #ffebee; /* Light red background */
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

    .warning-container .warning-header {
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 1px solid #ef5350; /* Red border */
    }

        .warning-container .warning-header h2 {
            margin: 0;
            color: #d32f2f; /* Dark red color for header text */
            font-size: 1.5rem;
        }

    .warning-container .warning-content {
        display: flex;
        flex-direction: column;
        color: #5d2121; /* Darker text for better readability */
    }

.success-container {
    background-color: #e8f5e9; /* Light green background */
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

    .success-container .success-header {
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 1px solid #66bb6a; /* Green border */
    }

        .success-container .success-header h2 {
            margin: 0;
            color: #2e7d32; /* Dark green color for header text */
            font-size: 1.5rem;
        }

    .success-container .success-content {
        display: flex;
        flex-direction: column;
        color: #1b5e20; /* Darker green text for better readability */
    }

/* ===== Loader frame ===== */
.loader {
    position: relative;
    width: var(--size);
    height: var(--size);
    color: var(--oes-secondary);
    /* path length per side the elbow travels */
    --track: calc(var(--size) - (var(--loader-pad) * 2) - var(--loader-arm));
}

/* Inner navy square (logo block) */
.loader-square {
    position: absolute;
    inset: 14%;
    background: var(--oes-primary);
    border-radius: 6px;
}

.loader-word {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-weight: 900;
    letter-spacing: .06em;
    font-size: calc(var(--size) * 0.28);
    user-select: none;
    z-index: 2;
    color: var(--oes-secondary);
}

/* ===== Moving “corner” segment =====
     Each .seg is a square box whose top-left is the elbow.
     We draw the L using two absolutely-positioned bars so the
     shape matches your logo corners exactly. */
.loader-seg {
    position: absolute;
    width: var(--loader-arm);
    height: var(--loader-arm);
    transform: translate(var(--loader-pad), var(--loader-pad)) rotate(0deg);
    animation: crawl var(--loader-duration) cubic-bezier(.25,.7,.35,1) infinite;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,.35));
}

    .loader-seg::before, .loader-seg::after {
        content: "";
        position: absolute;
        background: var(--oes-secondary);
        border-radius: 2px;
    }
    /* horizontal arm (extends right from elbow) */
    .loader-seg::before {
        left: 0;
        top: 0;
        width: var(--loader-arm);
        height: var(--loader-thick);
    }
    /* vertical arm (extends down from elbow) */
    .loader-seg::after {
        left: 0;
        top: 0;
        width: var(--loader-thick);
        height: var(--loader-arm);
    }

/* 4 segments, quarter-cycle apart */
.loader-s1 {
    animation-delay: 0ms;
}

.loader-s2 {
    animation-delay: calc(var(--loader-duration)*.25);
}

.loader-s3 {
    animation-delay: calc(var(--loader-duration)*.50);
}

.loader-s4 {
    animation-delay: calc(var(--loader-duration)*.75);
}

/* ===== Path + rotation =====
     We move the elbow along a square track. At each corner,
     rotate the whole L so the elbow keeps “leading” clockwise.
     The tiny 24.999/25% splits prevent anti-aliasing glitches. */
@keyframes crawl {
    /* move along TOP edge → */
    0% {
        transform: translate(var(--loader-pad), var(--loader-pad)) rotate(0deg);
    }

    24.999% {
        transform: translate(calc(var(--loader-pad) + var(--track)), var(--loader-pad)) rotate(90deg);
    }
    /* turn at top-right, go DOWN */
    25% {
        transform: translate(calc(var(--loader-pad) + var(--track)), var(--loader-pad)) rotate(90deg);
    }

    49.999% {
        transform: translate(calc(var(--loader-pad) + var(--track)), calc(var(--loader-pad) + var(--track))) rotate(180deg);
    }
    /* turn at bottom-right, go LEFT */
    50% {
        transform: translate(calc(var(--loader-pad) + var(--track)), calc(var(--loader-pad) + var(--track))) rotate(180deg);
    }

    74.999% {
        transform: translate(var(--loader-pad), calc(var(--loader-pad) + var(--track))) rotate(270deg);
    }
    /* turn at bottom-left, go UP */
    75% {
        transform: translate(var(--loader-pad), calc(var(--loader-pad) + var(--track))) rotate(270deg);
    }

    99.5% {
        transform: translate(var(--loader-pad), var(--loader-pad)) rotate(360deg);
    }
    /* normalize to starting orientation */
    100% {
        transform: translate(var(--loader-pad), var(--loader-pad)) rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .loader-seg {
        animation: none;
    }
}
