/*
 * Minimal Bootstrap 5 utility stubs.
 * Provides layout, spacing, and component classes used throughout the app.
 * MudBlazor does not bundle Bootstrap, so these are supplied here.
 */

/* =====================================================================
 * Grid
 * ===================================================================== */

.container {
    width: 100%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
    margin-right: auto;
    margin-left: auto;
    max-width: 1200px;
}

.container-fluid {
    width: 100%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
    margin-right: auto;
    margin-left: auto;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

[class^="col"] {
    width: 100%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
    box-sizing: border-box;
}

.col { flex: 1 0 0%; }
.col-1  { flex: 0 0 auto; width: 8.3333%; }
.col-2  { flex: 0 0 auto; width: 16.6667%; }
.col-3  { flex: 0 0 auto; width: 25%; }
.col-4  { flex: 0 0 auto; width: 33.3333%; }
.col-5  { flex: 0 0 auto; width: 41.6667%; }
.col-6  { flex: 0 0 auto; width: 50%; }
.col-7  { flex: 0 0 auto; width: 58.3333%; }
.col-8  { flex: 0 0 auto; width: 66.6667%; }
.col-9  { flex: 0 0 auto; width: 75%; }
.col-10 { flex: 0 0 auto; width: 83.3333%; }
.col-11 { flex: 0 0 auto; width: 91.6667%; }
.col-12 { flex: 0 0 auto; width: 100%; }

@media (min-width: 576px) {
    .col-sm-1  { flex: 0 0 auto; width: 8.3333%; }
    .col-sm-2  { flex: 0 0 auto; width: 16.6667%; }
    .col-sm-3  { flex: 0 0 auto; width: 25%; }
    .col-sm-4  { flex: 0 0 auto; width: 33.3333%; }
    .col-sm-5  { flex: 0 0 auto; width: 41.6667%; }
    .col-sm-6  { flex: 0 0 auto; width: 50%; }
    .col-sm-7  { flex: 0 0 auto; width: 58.3333%; }
    .col-sm-8  { flex: 0 0 auto; width: 66.6667%; }
    .col-sm-9  { flex: 0 0 auto; width: 75%; }
    .col-sm-10 { flex: 0 0 auto; width: 83.3333%; }
    .col-sm-11 { flex: 0 0 auto; width: 91.6667%; }
    .col-sm-12 { flex: 0 0 auto; width: 100%; }
}

@media (min-width: 768px) {
    .col-md-1  { flex: 0 0 auto; width: 8.3333%; }
    .col-md-2  { flex: 0 0 auto; width: 16.6667%; }
    .col-md-3  { flex: 0 0 auto; width: 25%; }
    .col-md-4  { flex: 0 0 auto; width: 33.3333%; }
    .col-md-5  { flex: 0 0 auto; width: 41.6667%; }
    .col-md-6  { flex: 0 0 auto; width: 50%; }
    .col-md-7  { flex: 0 0 auto; width: 58.3333%; }
    .col-md-8  { flex: 0 0 auto; width: 66.6667%; }
    .col-md-9  { flex: 0 0 auto; width: 75%; }
    .col-md-10 { flex: 0 0 auto; width: 83.3333%; }
    .col-md-11 { flex: 0 0 auto; width: 91.6667%; }
    .col-md-12 { flex: 0 0 auto; width: 100%; }
}

@media (min-width: 992px) {
    .col-lg-1  { flex: 0 0 auto; width: 8.3333%; }
    .col-lg-2  { flex: 0 0 auto; width: 16.6667%; }
    .col-lg-3  { flex: 0 0 auto; width: 25%; }
    .col-lg-4  { flex: 0 0 auto; width: 33.3333%; }
    .col-lg-5  { flex: 0 0 auto; width: 41.6667%; }
    .col-lg-6  { flex: 0 0 auto; width: 50%; }
    .col-lg-7  { flex: 0 0 auto; width: 58.3333%; }
    .col-lg-8  { flex: 0 0 auto; width: 66.6667%; }
    .col-lg-9  { flex: 0 0 auto; width: 75%; }
    .col-lg-10 { flex: 0 0 auto; width: 83.3333%; }
    .col-lg-11 { flex: 0 0 auto; width: 91.6667%; }
    .col-lg-12 { flex: 0 0 auto; width: 100%; }
}

/* =====================================================================
 * Flexbox
 * ===================================================================== */

.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-block { display: block !important; }
.d-inline-block { display: inline-block !important; }
.d-none { display: none !important; }

.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.flex-fill { flex: 1 1 auto !important; }

.justify-content-start   { justify-content: flex-start !important; }
.justify-content-end     { justify-content: flex-end !important; }
.justify-content-center  { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around  { justify-content: space-around !important; }

.align-items-start   { align-items: flex-start !important; }
.align-items-end     { align-items: flex-end !important; }
.align-items-center  { align-items: center !important; }
.align-items-stretch { align-items: stretch !important; }

.align-self-start   { align-self: flex-start !important; }
.align-self-end     { align-self: flex-end !important; }
.align-self-center  { align-self: center !important; }

/* =====================================================================
 * Spacing  (Bootstrap 5 scale: 1=.25rem 2=.5rem 3=1rem 4=1.5rem 5=3rem)
 * ===================================================================== */

.m-0  { margin: 0 !important; }
.m-1  { margin: 0.25rem !important; }
.m-2  { margin: 0.5rem !important; }
.m-3  { margin: 1rem !important; }
.m-4  { margin: 1.5rem !important; }
.m-5  { margin: 3rem !important; }
.m-auto { margin: auto !important; }

.mt-0  { margin-top: 0 !important; }
.mt-1  { margin-top: 0.25rem !important; }
.mt-2  { margin-top: 0.5rem !important; }
.mt-3  { margin-top: 1rem !important; }
.mt-4  { margin-top: 1.5rem !important; }
.mt-5  { margin-top: 3rem !important; }

.mb-0  { margin-bottom: 0 !important; }
.mb-1  { margin-bottom: 0.25rem !important; }
.mb-2  { margin-bottom: 0.5rem !important; }
.mb-3  { margin-bottom: 1rem !important; }
.mb-4  { margin-bottom: 1.5rem !important; }
.mb-5  { margin-bottom: 3rem !important; }

.ms-0  { margin-left: 0 !important; }
.ms-1  { margin-left: 0.25rem !important; }
.ms-2  { margin-left: 0.5rem !important; }
.ms-3  { margin-left: 1rem !important; }
.ms-4  { margin-left: 1.5rem !important; }
.ms-5  { margin-left: 3rem !important; }
.ms-auto { margin-left: auto !important; }

.me-0  { margin-right: 0 !important; }
.me-1  { margin-right: 0.25rem !important; }
.me-2  { margin-right: 0.5rem !important; }
.me-3  { margin-right: 1rem !important; }
.me-4  { margin-right: 1.5rem !important; }
.me-5  { margin-right: 3rem !important; }
.me-auto { margin-right: auto !important; }

.p-0  { padding: 0 !important; }
.p-1  { padding: 0.25rem !important; }
.p-2  { padding: 0.5rem !important; }
.p-3  { padding: 1rem !important; }
.p-4  { padding: 1.5rem !important; }
.p-5  { padding: 3rem !important; }

.pt-0  { padding-top: 0 !important; }
.pt-1  { padding-top: 0.25rem !important; }
.pt-2  { padding-top: 0.5rem !important; }
.pt-3  { padding-top: 1rem !important; }
.pt-4  { padding-top: 1.5rem !important; }
.pt-5  { padding-top: 3rem !important; }

.pb-0  { padding-bottom: 0 !important; }
.pb-1  { padding-bottom: 0.25rem !important; }
.pb-2  { padding-bottom: 0.5rem !important; }
.pb-3  { padding-bottom: 1rem !important; }
.pb-4  { padding-bottom: 1.5rem !important; }
.pb-5  { padding-bottom: 3rem !important; }

.px-0  { padding-left: 0 !important; padding-right: 0 !important; }
.px-1  { padding-left: 0.25rem !important; padding-right: 0.25rem !important; }
.px-2  { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
.px-3  { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-4  { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.px-5  { padding-left: 3rem !important; padding-right: 3rem !important; }

.py-0  { padding-top: 0 !important; padding-bottom: 0 !important; }
.py-1  { padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; }
.py-2  { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-3  { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-4  { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.py-5  { padding-top: 3rem !important; padding-bottom: 3rem !important; }

.gap-0 { gap: 0 !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }
.gap-5 { gap: 3rem !important; }

/* =====================================================================
 * Sizing
 * ===================================================================== */

.w-100  { width: 100% !important; }
.w-75   { width: 75% !important; }
.w-50   { width: 50% !important; }
.w-25   { width: 25% !important; }
.w-auto { width: auto !important; }
.h-100  { height: 100% !important; }

/* =====================================================================
 * Float & position
 * ===================================================================== */

.float-start { float: left !important; }
.float-end   { float: right !important; }
.float-none  { float: none !important; }
.clearfix::after { display: block; clear: both; content: ""; }

/* =====================================================================
 * Text
 * ===================================================================== */

.text-start   { text-align: left !important; }
.text-center  { text-align: center !important; }
.text-end     { text-align: right !important; }

.text-muted   { color: rgba(14, 82, 76, 0.55) !important; }
.text-success { color: #16847A !important; }
.text-danger  { color: #CC0000 !important; }
.text-warning { color: #E69500 !important; }
.text-info    { color: #0E524C !important; }
.text-primary { color: #16847A !important; }
.text-secondary { color: #0E524C !important; }
.text-white   { color: #fff !important; }

.fw-bold    { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-normal  { font-weight: 400 !important; }
.fst-italic { font-style: italic !important; }

.lead { font-size: 1.25rem; font-weight: 300; }

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* =====================================================================
 * Background colours
 * ===================================================================== */

.bg-primary   { background-color: #16847A !important; }
.bg-secondary { background-color: #0E524C !important; }
.bg-success   { background-color: #16847A !important; }
.bg-danger    { background-color: #CC0000 !important; }
.bg-warning   { background-color: #FFC107 !important; }
.bg-info      { background-color: #0E524C !important; }
.bg-light     { background-color: #f5f8f8 !important; }
.bg-dark      { background-color: #0E524C !important; }
.bg-white     { background-color: #fff !important; }

/* =====================================================================
 * Tables
 * ===================================================================== */

.table {
    width: 100%;
    margin-bottom: 1rem;
    color: #0E524C;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.5rem;
    vertical-align: top;
    border-top: 1px solid rgba(22, 132, 122, 0.2);
}

.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid rgba(22, 132, 122, 0.2);
    font-weight: 600;
}

.table thead tr {
    border-bottom: 2px solid rgba(22, 132, 122, 0.2);
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-sm th,
.table-sm td {
    padding: 0.25rem;
}

/* =====================================================================
 * Forms
 * ===================================================================== */

.form-group { margin-bottom: 1rem; }

.form-label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    display: inline-block;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #0E524C;
    background-color: #fff;
    border: 1px solid rgba(22, 132, 122, 0.3);
    border-radius: 0.375rem;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: rgba(22, 132, 122, 0.5);
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(22, 132, 122, 0.25);
}

/* =====================================================================
 * Cards
 * ===================================================================== */

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.375rem;
}

.card-body {
    flex: 1 1 auto;
    padding: 1rem;
}

.card-title {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.card-text:last-child { margin-bottom: 0; }

/* =====================================================================
 * Badge
 * ===================================================================== */

.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
}

/* =====================================================================
 * Alert
 * ===================================================================== */

.alert {
    position: relative;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
}

.alert-success {
    color: #0E524C;
    background-color: rgba(22, 132, 122, 0.12);
    border-color: rgba(22, 132, 122, 0.4);
}

.alert-danger {
    color: #CC0000;
    background-color: rgba(204, 0, 0, 0.08);
    border-color: rgba(204, 0, 0, 0.3);
}

.alert-warning {
    color: #CC0000;
    background-color: rgba(204, 0, 0, 0.08);
    border-color: rgba(204, 0, 0, 0.3);
}

.alert-info {
    color: #0E524C;
    background-color: rgba(22, 132, 122, 0.12);
    border-color: rgba(22, 132, 122, 0.4);
}

/* =====================================================================
 * Shadow
 * ===================================================================== */

.shadow-sm { box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important; }
.shadow    { box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important; }
.shadow-lg { box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important; }
.shadow-none { box-shadow: none !important; }

/* =====================================================================
 * Borders
 * ===================================================================== */

.border { border: 1px solid rgba(22, 132, 122, 0.2) !important; }
.border-0 { border: 0 !important; }
.rounded { border-radius: 0.375rem !important; }
.rounded-circle { border-radius: 50% !important; }
