/* Placeholder site styling. The Phase 8 style pass replaces this with unit branding.
   MudBlazor supplies the component styles; this file only covers the Blazor error UI,
   bits of the statically rendered Identity markup, and print output. */

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1500;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

/* The scaffolded Identity components use plain <form>/<input> markup with Bootstrap-style
   classes. Bootstrap is not loaded, so give those elements MudBlazor-compatible basics. */
.account-surface .form-floating {
    margin-bottom: 1rem;
}

.account-surface .form-control {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-inputs);
    border-radius: var(--mud-default-borderradius);
    color: var(--mud-palette-text-primary);
    font: inherit;
    padding: 0.85rem 0.75rem 0.35rem;
    width: 100%;
}

.account-surface .form-control:focus {
    border-color: var(--mud-palette-primary);
    outline: none;
}

.account-surface .form-floating > label {
    color: var(--mud-palette-text-secondary);
    display: block;
    font-size: 0.8rem;
    margin-bottom: 0.15rem;
}

.account-surface .text-danger,
.account-surface .validation-message {
    color: var(--mud-palette-error);
    display: block;
    font-size: 0.8rem;
}

.account-surface hr {
    border: 0;
    border-top: 1px solid var(--mud-palette-divider);
    margin: 1.5rem 0;
}

.account-surface .btn {
    background: var(--mud-palette-primary);
    border: 0;
    border-radius: var(--mud-default-borderradius);
    color: var(--mud-palette-primary-text);
    cursor: pointer;
    font: inherit;
    font-weight: 500;
    padding: 0.6rem 1.1rem;
    text-decoration: none;
}

.account-surface .btn:hover {
    filter: brightness(1.1);
}

.account-surface .btn-lg {
    font-size: 1rem;
    padding: 0.7rem 1.3rem;
}

.account-surface .w-100 {
    width: 100%;
}

.account-surface .checkbox label {
    align-items: center;
    display: flex;
    gap: 0.5rem;
}

/* Print: drop the chrome so attendance rosters print on their own. */
@media print {
    .mud-appbar,
    .mud-drawer,
    .no-print {
        display: none !important;
    }

    .mud-main-content {
        padding: 0 !important;
    }

    .mud-paper {
        box-shadow: none !important;
    }

    a[href]::after {
        content: "";
    }
}

/* Attendance roster. A plain table, so the print stylesheet has something predictable to
   work with rather than a component's internal markup. */
.roster-table {
    border-collapse: collapse;
    font-size: 0.92rem;
    width: 100%;
}

.roster-table th,
.roster-table td {
    border-bottom: 1px solid var(--mud-palette-table-lines);
    padding: 0.4rem 0.6rem;
    text-align: left;
    vertical-align: top;
}

.roster-table th {
    font-weight: 600;
    white-space: nowrap;
}

.roster-table tbody tr:nth-child(even) {
    background: var(--mud-palette-background-gray);
}

.roster-table .status {
    border-radius: 999px;
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.1rem 0.55rem;
    white-space: nowrap;
}

.roster-table .status-present { background: #d7eddb; color: #1b5e20; }
.roster-table .status-remote { background: #d6e7f5; color: #11456b; }
.roster-table .status-excused { background: #faeccd; color: #6b4a00; }
.roster-table .status-absent { background: #f6d9d7; color: #7c1f1a; }
.roster-table .status-none { background: #eceff1; color: #546069; }

.roster-table .recorder {
    color: var(--mud-palette-text-secondary);
    font-size: 0.75rem;
    margin-left: 0.35rem;
}

@media print {
    .roster-table tbody tr:nth-child(even) { background: transparent; }

    .roster-table th,
    .roster-table td {
        border-bottom: 1px solid #999;
        padding: 0.25rem 0.4rem;
    }

    .roster-table .status {
        background: transparent !important;
        color: #000 !important;
        font-weight: 600;
        padding: 0;
    }

    .roster-header { margin-bottom: 0.5rem; }
}

/* Upload form. A plain <form> so gigabyte uploads bypass the Blazor circuit, which means
   plain inputs rather than MudBlazor fields — these give them matching trim. */
.upload-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 40rem;
}

.upload-row {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.upload-label {
    color: var(--mud-palette-text-secondary);
    font-size: 0.8rem;
}

.upload-input {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-inputs);
    border-radius: var(--mud-default-borderradius);
    color: var(--mud-palette-text-primary);
    font: inherit;
    padding: 0.6rem 0.7rem;
    width: 100%;
}

.upload-input:focus {
    border-color: var(--mud-palette-primary);
    outline: none;
}

.upload-form .btn {
    align-self: flex-start;
    background: var(--mud-palette-primary);
    border: 0;
    border-radius: var(--mud-default-borderradius);
    color: var(--mud-palette-primary-text);
    cursor: pointer;
    font: inherit;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
}

.upload-form .btn:hover {
    filter: brightness(1.1);
}

/* Stream embed: a 16:9 box so the Castr iframe scales with the column instead of
   needing a fixed height. */
.stream-frame {
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--mud-default-borderradius);
    overflow: hidden;
    position: relative;
    width: 100%;
}

.stream-frame iframe {
    border: 0;
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    width: 100%;
}

.stream-frame-placeholder {
    align-items: center;
    background: repeating-linear-gradient(45deg, #2a333a, #2a333a 14px, #222a30 14px, #222a30 28px);
    display: flex;
    justify-content: center;
}

.stream-placeholder-inner {
    color: #c4cdd4;
    padding: 1rem;
    text-align: center;
}

/* Qualifications: standing chips shared by the board and a member's own record. Colours match the
   attendance status pills so "green means good" reads the same across the site. */
.qual-chip {
    border-radius: 999px;
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.1rem 0.55rem;
    white-space: nowrap;
}

.qual-current { background: #d7eddb; color: #1b5e20; }
.qual-expiring { background: #faeccd; color: #6b4a00; }
.qual-expired { background: #f6d9d7; color: #7c1f1a; }
.qual-pending { background: #d6e7f5; color: #11456b; }
.qual-none { background: #eceff1; color: #546069; }

.qual-date {
    color: var(--mud-palette-text-secondary);
    display: block;
    font-size: 0.75rem;
    margin-top: 0.1rem;
    white-space: nowrap;
}

.qual-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
}

.qual-summary-item {
    align-items: baseline;
    display: flex;
    gap: 0.5rem;
}

.qual-summary-date {
    color: var(--mud-palette-text-secondary);
    font-size: 0.8rem;
}

.qual-board th:not(:nth-child(-n+2)),
.qual-board td:not(:nth-child(-n+2)) {
    text-align: center;
}

.inactive-row td {
    opacity: 0.6;
}

/* Wide grids (qualifications, CTT) scroll sideways on a phone instead of pushing the page. */
.table-scroll {
    overflow-x: auto;
}

.print-only {
    display: none;
}

@media print {
    .print-only { display: block; }

    .table-scroll { overflow: visible; }

    .qual-chip {
        background: transparent !important;
        color: #000 !important;
        padding: 0;
    }
}

/* CTT and PT results: Go / No Go pills, same palette as attendance and qualifications. */
.test-pill {
    border-radius: 999px;
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.1rem 0.55rem;
    white-space: nowrap;
}

.test-go { background: #d7eddb; color: #1b5e20; }
.test-nogo { background: #f6d9d7; color: #7c1f1a; }
.test-none { background: #eceff1; color: #546069; }

.ctt-grid th:not(:nth-child(-n+2)),
.ctt-grid td:not(:nth-child(-n+2)) {
    text-align: center;
}

@media print {
    .test-pill {
        background: transparent !important;
        color: #000 !important;
        padding: 0;
    }
}

/* Flight log: keep long notes from stretching the table into a wall of text. */
.flight-table .flight-notes {
    max-width: 22rem;
    white-space: pre-line;
}

.crew-picker .mud-input-control {
    margin-bottom: 0;
}
