/*=============== GOOGLE FONTS ===============*/
@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@100..900&display=swap");

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

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

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

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

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

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

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

.validation-message {
    color: #e50960;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgM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after {
        content: "An error has occurred."
    }

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* The product's name in the app bar (MainLayout). It never wraps; on phones there is no room for it beside the menu,
   notifications, language and profile buttons, so only the mark stays and the name is kept for screen readers. */
.app-title {
    white-space: nowrap;
}

@media (max-width: 599.98px) {
    .app-title {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        margin: 0 !important;
    }
}

/* The student card (StudentInfo): the tab bar and the header stay put, only the open tab scrolls, and the card keeps
   one height whichever tab is open. Full screen on a phone, where the dialog itself scrolls. */
.student-card-tabs {
    height: min(620px, calc(100vh - 260px));
}

.student-card-tabs .student-card-panels {
    overflow-y: auto;
    min-height: 0;
    flex: 1 1 auto;
}

/* Down the side the tabs read as a menu: left aligned, and the open tab takes the rest of the width. */
.student-card-tabs.mud-tabs-vertical .mud-tab {
    justify-content: flex-start;
    text-align: left;
}

.student-card-tabs .student-card-panels.mud-tabs-vertical > * {
    flex: 1 1 auto;
    min-width: 0;
}

.mud-dialog-fullscreen .student-card-tabs {
    height: auto;
}

/* Every form: a filled field must not be mistaken for an empty one's label. MudBlazor colours a filled field's label
   like its value, and the dark palette has one colour for both, so labels go muted, values bold (outlined fields on a
   light tint), and an empty field's label (sitting inside it) reads as a hint. The label rules must be at least as
   specific as MudBlazor's own (.mud-input-control > .mud-input-control-input-container > ...). */
body .mud-input-control > .mud-input-control-input-container > label.mud-input-label-inputcontrol {
    color: var(--mud-palette-action-default);
}

body .mud-input-control > .mud-input-control-input-container > .mud-input:focus-within ~ label.mud-input-label-inputcontrol {
    color: var(--mud-palette-primary);
}

body .mud-input:not(.mud-shrink):not(:focus-within) ~ label.mud-input-label-inputcontrol {
    font-style: italic;
}

/* A field with a placeholder is "shrunk" while still empty: only a real value gets the bold and the tint. */
body .mud-input.mud-shrink:not(:has(input:placeholder-shown)) .mud-input-slot {
    font-weight: 500;
    color: var(--mud-palette-text-primary);
}

body .mud-input-outlined.mud-shrink:not(:has(input:placeholder-shown)) {
    background-color: var(--mud-palette-action-default-hover);
}

/* A compact list for phones (students, classes): one row per item, its name on top and the details in a line below;
   the whole row opens the item. */
.compact-list {
    overflow: hidden;
}

.compact-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 10px 16px;
    border-bottom: 1px solid var(--mud-palette-table-lines);
    cursor: pointer;
}

.compact-row:last-child {
    border-bottom: none;
}

.compact-row:hover,
.compact-row:focus-visible {
    background-color: var(--mud-palette-action-default-hover);
    outline: none;
}

.compact-row-main {
    flex: 1 1 auto;
    min-width: 0;
}

.compact-row-title {
    font-weight: 500;
    color: var(--mud-palette-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-row-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    margin-top: 2px;
    font-size: .8125rem;
    color: var(--mud-palette-action-default);
}

/* A figure on the home page (Today/ClubTiles): an icon, a big number and what it counts; the whole tile is a link. */
.stat-tile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    height: 100%;
    padding: 16px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    text-decoration: none;
    transition: box-shadow 150ms, border-color 150ms;
}

.stat-tile:hover,
.stat-tile:focus-visible {
    border-color: var(--mud-palette-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
    outline: none;
}

.stat-tile-alert {
    border-color: var(--mud-palette-error);
}

.stat-tile-value {
    font-size: 1.75rem;
    font-weight: 500;
    line-height: 1.2;
}

.stat-tile-label {
    font-size: .8125rem;
    color: var(--mud-palette-action-default);
}

/* An event in the club's list (Pages/Events): a date block, the name and details, the staff's actions. On a phone the
   actions go under the details. */
.event-card {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 12px;
}

.event-card-date {
    flex: 0 0 56px;
    text-align: center;
    padding: 6px 0;
    border-radius: 8px;
    background: var(--mud-palette-action-default-hover);
    color: var(--mud-palette-primary);
}

.event-card-day {
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.1;
}

.event-card-month {
    font-size: .75rem;
    text-transform: uppercase;
}

.event-card-main {
    flex: 1 1 240px;
    min-width: 0;
}

.event-card-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--mud-palette-text-primary);
}

.event-card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

/* The cabinet's header (Pages/My/MyCabinet): the name in the theme's text colour, which the dark theme needs. */
.cabinet-name {
    font-weight: 500;
    color: var(--mud-palette-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The new student window (AddStudent): one form that scrolls inside the window. */
.add-student-content {
    max-height: calc(100vh - 220px);
    overflow-y: auto;
}

/* Full screen on a phone: the dialog itself scrolls, the form takes the whole height. */
.mud-dialog-fullscreen .add-student-content {
    max-height: none;
}

/* The top of a page (BaseComponents/PageHeader): title on the left, the page's actions on the right. */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.page-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.page-header-title {
    font-weight: 500;
    color: var(--mud-palette-text-primary);
}

.student-card-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dark theme (MainLayout puts .kc-dark on <html>): the brand blue is only 3:1 on the dark surfaces, the error red 3.2:1 and
   the success green 4.1:1, too dim for text. Text, text and outlined buttons and chips, links, and
   the focused label use a lighter shade (the palette's own for blue and green, #ff8a80 for red: 4.9 / 6.4 / 5.2:1 on
   the card colour); fills keep the brand colours. MudBlazor's .mud-*-text utilities are !important, so these must be too. */
html.kc-dark .mud-primary-text {
    color: var(--mud-palette-primary-lighten) !important;
}

html.kc-dark .mud-error-text {
    color: #ff8a80 !important;
}

html.kc-dark .mud-success-text {
    color: var(--mud-palette-success-darken) !important;
}

html.kc-dark .mud-button-text-primary,
html.kc-dark .mud-button-outlined-primary,
html.kc-dark .mud-chip-text.mud-chip-color-primary,
html.kc-dark .mud-chip-outlined.mud-chip-color-primary,
html.kc-dark .mud-link.mud-link-primary,
html.kc-dark .mud-tabs-tabbar-primary .mud-tab.mud-tab-active,
html.kc-dark body .mud-input-control > .mud-input-control-input-container > .mud-input:focus-within ~ label.mud-input-label-inputcontrol {
    color: var(--mud-palette-primary-lighten);
}

html.kc-dark .mud-button-text-error,
html.kc-dark .mud-button-outlined-error,
html.kc-dark .mud-chip-text.mud-chip-color-error,
html.kc-dark .mud-chip-outlined.mud-chip-color-error,
html.kc-dark .mud-input-error ~ .mud-input-helper-text,
html.kc-dark .mud-input-helper-text.mud-input-error {
    color: #ff8a80;
}

html.kc-dark .mud-button-text-success,
html.kc-dark .mud-button-outlined-success,
html.kc-dark .mud-chip-text.mud-chip-color-success,
html.kc-dark .mud-chip-outlined.mud-chip-color-success {
    color: var(--mud-palette-success-darken);
}

/* The side menu keeps the palette colours of its icons and active entry (the colours the owner likes). */
html.kc-dark .mud-drawer .mud-primary-text {
    color: var(--mud-palette-primary) !important;
}

html.kc-dark .mud-drawer .mud-success-text {
    color: var(--mud-palette-success) !important;
}
