﻿



/* The brand colours, the typeface and the look of the Radzen components live in design.css. */

/* logo chip in the app header — white tile so the blue/cyan mark stays visible */
.app-header-logo {
    height: 30px;
    width: 30px;
    padding: 4px;
    margin: 0 10px 0 4px;
    background: #fff;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
}

.text-label {
    color: #4e4e4e;
}

/* Dark-theme readability tweaks for app-specific (non-Radzen) elements */
:root[data-theme="dark"] .text-label {
    color: #b7bdc2;
}

:root[data-theme="dark"] .browser,
:root[data-theme="dark"] .legal-card {
    background: #1e2226;
}

/* The custom subscriptions matrix uses hardcoded white cells — keep it readable in dark mode */
:root[data-theme="dark"] table.table th {
    background: #1e2226 !important;
    color: #e3e8ea;
}

/* ---------- Input placeholders ---------- */
/* Radzen paints placeholders with --rz-text-tertiary-color, one step off the value
   colour (#757575 hint vs #424242 value in light mode). That is close enough that an
   empty field reads as one somebody already filled in. Only the placeholder selectors
   are re-coloured here: --rz-input-placeholder-color also drives the floating
   RadzenFormField label, which has to stay readable. Italics carry the distinction for
   anyone who cannot rely on the colour step alone. */
:root {
    --emasjid-placeholder-color: #8a8a8a; /* between Radzen base-500 and base-600; 3.4:1 on white */
}

/* Dark mode already separates the two (#6c6c6c hint vs #e0e0e0 value), and going any
   lighter would sink the hint into the field background - keep Radzen's value. */
:root[data-theme="dark"] {
    --emasjid-placeholder-color: var(--rz-input-placeholder-color);
}

/* Textboxes, textareas, numerics, date pickers, autocomplete and grid filter inputs.
   Disabled inputs keep Radzen's own (more specific) disabled placeholder rule. */
input::placeholder,
textarea::placeholder {
    color: var(--emasjid-placeholder-color);
    font-style: italic;
    opacity: 1; /* Firefox dims placeholders on its own */
}

/* Dropdowns and multiselects render the placeholder as a span, not a real placeholder. */
.rz-dropdown:not(.rz-state-disabled) .rz-placeholder,
.rz-multiselect:not(.rz-state-disabled) .rz-placeholder {
    color: var(--emasjid-placeholder-color);
    font-style: italic;
}

/* A RadzenFormField label rests inside the field until it floats, and Radzen gives the
   resting state no colour of its own - it inherits --rz-text-color, exactly the colour of
   typed text. Pages that label their fields instead of passing Placeholder (all of
   /mekteb/register, for one) therefore read as filled in while they are still empty.
   Deliberately the bare class, at the lowest specificity Radzen leaves free: every rule
   for the floated, focused, invalid and disabled states is more specific, so each keeps
   its own colour and only the resting label changes. No italics - this is a label, and
   235 slanted field labels would cost more than the confusion it fixes. */
.rz-form-field-label {
    color: var(--emasjid-placeholder-color);
}

/* A RadzenSwitch inside a RadzenFormField. Radzen gives every direct child of the field
   flex: 1 so that a text box fills it, and a switch takes that too: its track
   (.rz-switch-circle, absolutely inset over the whole switch) stretched across the full
   width of the field. The switch keeps its own 2.25rem here.
   It also gets the room a text box gets - the field's height, and the padding that puts the
   value under the floating label - because a field sized to a 0.875rem switch squeezed its
   outline and its label onto the switch. The variables are the field's own, so this follows
   the variant and size the field was given. */
.rz-form-field-content:has(> .rz-switch) {
    min-height: var(--rz-input-height);
}

.rz-form-field-content > .rz-switch {
    flex: 0 0 auto;
    margin-block: var(--rz-input-padding-block);
    margin-inline: var(--rz-input-padding-inline);
}

/* Radzen floats the label only over a value that is not rz-state-empty, and a switch that
   is off counts as empty, so its label came down and lay across the switch. Off is an
   answer, not a missing one: the label stays up, with Radzen's own floated position. */
.rz-form-field-content > .rz-switch ~ .rz-form-field-label {
    inset-block-start: var(--rz-form-field-label-floating-top);
    padding-block-start: 0;
    padding-block-end: 0;
    transform: translate(0, 0);
    background-color: var(--rz-form-field-label-floating-background-color);
    font-size: var(--rz-form-field-label-floating-font-size, 0.75rem);
    line-height: 1rem;
}

/* ---------- Mekteb class register: attendance status colours ---------- */
/* One .rz-button per item, in the order declared in MektebClassRegister.razor:
   1 present, 2 late, 3 excused, 4 absent. Position is the only per-item hook Radzen
   exposes, so the item order and these rules have to stay in step.

   All four fills use the -dark shade of their family: white on the base green/amber
   is too faint to read on a screen a teacher marks in a hurry.
   Excused deliberately takes the blue --rz-info-dark rather than --rz-info, which is
   rebranded to the logo cyan above and would sit too close to the present green. */
.rz-selectbar.mekteb-attendance-bar .rz-button {
    font-weight: 500;
}

/* Unmarked options stay as coloured labels - four filled buttons on every row would
   drown out the one status actually chosen. */
.rz-selectbar.mekteb-attendance-bar .rz-button:nth-child(1) { color: var(--rz-success-dark); }
.rz-selectbar.mekteb-attendance-bar .rz-button:nth-child(2) { color: var(--rz-warning-dark); }
.rz-selectbar.mekteb-attendance-bar .rz-button:nth-child(3) { color: var(--rz-info-dark); }
.rz-selectbar.mekteb-attendance-bar .rz-button:nth-child(4) { color: var(--rz-danger-dark); }

/* Hover previews the option's colour instead of the theme's neutral grey. */
.rz-selectbar.mekteb-attendance-bar .rz-button:nth-child(1):hover { background-color: var(--rz-success-lighter); }
.rz-selectbar.mekteb-attendance-bar .rz-button:nth-child(2):hover { background-color: var(--rz-warning-lighter); }
.rz-selectbar.mekteb-attendance-bar .rz-button:nth-child(3):hover { background-color: var(--rz-info-lighter); }
.rz-selectbar.mekteb-attendance-bar .rz-button:nth-child(4):hover { background-color: var(--rz-danger-lighter); }

/* The marked status is filled, so scanning a roster shows who is where at a glance. */
.rz-selectbar.mekteb-attendance-bar .rz-button.rz-state-active:nth-child(1),
.rz-selectbar.mekteb-attendance-bar .rz-button.rz-state-active:nth-child(1):hover {
    background-color: var(--rz-success-dark);
    border-color: var(--rz-success-dark);
    color: var(--rz-on-success);
}

.rz-selectbar.mekteb-attendance-bar .rz-button.rz-state-active:nth-child(2),
.rz-selectbar.mekteb-attendance-bar .rz-button.rz-state-active:nth-child(2):hover {
    background-color: var(--rz-warning-dark);
    border-color: var(--rz-warning-dark);
    color: var(--rz-on-warning);
}

.rz-selectbar.mekteb-attendance-bar .rz-button.rz-state-active:nth-child(3),
.rz-selectbar.mekteb-attendance-bar .rz-button.rz-state-active:nth-child(3):hover {
    background-color: var(--rz-info-dark);
    border-color: var(--rz-info-dark);
    color: var(--rz-on-info);
}

.rz-selectbar.mekteb-attendance-bar .rz-button.rz-state-active:nth-child(4),
.rz-selectbar.mekteb-attendance-bar .rz-button.rz-state-active:nth-child(4):hover {
    background-color: var(--rz-danger-dark);
    border-color: var(--rz-danger-dark);
    color: var(--rz-on-danger);
}

/* Dark theme: the -dark shades sink into the surface, so unmarked labels take the
   -light shade. The filled states keep their -dark fill - white text needs it. */
:root[data-theme="dark"] .rz-selectbar.mekteb-attendance-bar .rz-button:nth-child(1) { color: var(--rz-success-light); }
:root[data-theme="dark"] .rz-selectbar.mekteb-attendance-bar .rz-button:nth-child(2) { color: var(--rz-warning-light); }
:root[data-theme="dark"] .rz-selectbar.mekteb-attendance-bar .rz-button:nth-child(3) { color: var(--rz-info-light); }
:root[data-theme="dark"] .rz-selectbar.mekteb-attendance-bar .rz-button:nth-child(4) { color: var(--rz-danger-light); }

:root[data-theme="dark"] .rz-selectbar.mekteb-attendance-bar .rz-button.rz-state-active:nth-child(1) { color: var(--rz-on-success); }
:root[data-theme="dark"] .rz-selectbar.mekteb-attendance-bar .rz-button.rz-state-active:nth-child(2) { color: var(--rz-on-warning); }
:root[data-theme="dark"] .rz-selectbar.mekteb-attendance-bar .rz-button.rz-state-active:nth-child(3) { color: var(--rz-on-info); }
:root[data-theme="dark"] .rz-selectbar.mekteb-attendance-bar .rz-button.rz-state-active:nth-child(4) { color: var(--rz-on-danger); }

/* A grade's stars are gold, as in the parents' app, rather than the theme's blue. */
.rz-rating.mekteb-grade { --rz-rating-selected-color: #c68a00; }
:root[data-theme="dark"] .rz-rating.mekteb-grade { --rz-rating-selected-color: #ffc83d; }
/* Read-only stars in a list (student history) sit beside a status badge, so they are smaller. */
.rz-rating.mekteb-grade-compact { --rz-rating-font-size: 1.125rem; }

/* Context Menu Material Icons Support */
.rz-context-menu .rz-menu-item .rz-menu-item-icon::before {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    vertical-align: middle;
    margin-right: 8px;
}

/* Material Icons mappings for context menu */
.rz-context-menu .rz-menu-item-icon.visibility::before { content: 'visibility'; }
.rz-context-menu .rz-menu-item-icon.list::before { content: 'list'; }
.rz-context-menu .rz-menu-item-icon.edit::before { content: 'edit'; }
.rz-context-menu .rz-menu-item-icon.add_circle::before { content: 'add_circle'; }
.rz-context-menu .rz-menu-item-icon.sms::before { content: 'sms'; }
.rz-context-menu .rz-menu-item-icon.email::before { content: 'email'; }
.rz-context-menu .rz-menu-item-icon.delete::before { content: 'delete'; }
.rz-context-menu .rz-menu-item-icon.refresh::before { content: 'refresh'; }
.rz-context-menu .rz-menu-item-icon.download::before { content: 'download'; }
.rz-context-menu .rz-menu-item-icon.person_add::before { content: 'person_add'; }
.rz-context-menu .rz-menu-item-icon.groups::before { content: 'groups'; }
.rz-context-menu .rz-menu-item-icon.bar_chart::before { content: 'bar_chart'; }





/* Side panels (the board's task panel). Radzen's theme anchors them to the right but not to the
   top, so they fell back to where RadzenDialog sits in the layout: just below the full-height
   page, out of sight. */
.rz-dialog-side-position-right,
.rz-dialog-side-position-left {
    top: 0;
}
