﻿/* Tajawal Arabic font (local TTF files in wwwroot/fonts) */
@font-face {
    font-family: 'Tajawal';
    font-style: normal;
    font-weight: 200;
    font-display: swap;
    src: url('/fonts/Tajawal-ExtraLight.ttf') format('truetype');
}
@font-face {
    font-family: 'Tajawal';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('/fonts/Tajawal-Light.ttf') format('truetype');
}
@font-face {
    font-family: 'Tajawal';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/Tajawal-Regular.ttf') format('truetype');
}
@font-face {
    font-family: 'Tajawal';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/Tajawal-Medium.ttf') format('truetype');
}
@font-face {
    font-family: 'Tajawal';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/Tajawal-Bold.ttf') format('truetype');
}
@font-face {
    font-family: 'Tajawal';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('/fonts/Tajawal-ExtraBold.ttf') format('truetype');
}
@font-face {
    font-family: 'Tajawal';
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url('/fonts/Tajawal-Black.ttf') format('truetype');
}

html, body, button, input, select, textarea {
    font-family: 'Tajawal', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 300;
}

/* Force Tajawal on MudText and all MudBlazor typography variants */
.mud-typography,
.mud-typography-h1, .mud-typography-h2, .mud-typography-h3,
.mud-typography-h4, .mud-typography-h5, .mud-typography-h6,
.mud-typography-subtitle1, .mud-typography-subtitle2,
.mud-typography-body1, .mud-typography-body2,
.mud-typography-button, .mud-typography-caption, .mud-typography-overline {
    font-family: 'Tajawal', 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
}

/* Override MudBlazor typography CSS variables (used internally by every MudText variant) */
:root,
body,
.mud-application-layout,
.mud-layout {
    --mud-typography-default-family: 'Tajawal', 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
    --mud-typography-h1-family: 'Tajawal', 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
    --mud-typography-h2-family: 'Tajawal', 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
    --mud-typography-h3-family: 'Tajawal', 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
    --mud-typography-h4-family: 'Tajawal', 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
    --mud-typography-h5-family: 'Tajawal', 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
    --mud-typography-h6-family: 'Tajawal', 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
    --mud-typography-subtitle1-family: 'Tajawal', 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
    --mud-typography-subtitle2-family: 'Tajawal', 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
    --mud-typography-body1-family: 'Tajawal', 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
    --mud-typography-body2-family: 'Tajawal', 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
    --mud-typography-button-family: 'Tajawal', 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
    --mud-typography-caption-family: 'Tajawal', 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
    --mud-typography-overline-family: 'Tajawal', 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
    --mud-typography-input-family: 'Tajawal', 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
}

/* Maximum-specificity element-level overrides for every Mud typography variant */
body .mud-typography-h1,
body .mud-typography-h2,
body .mud-typography-h3,
body .mud-typography-h4,
body .mud-typography-h5,
body .mud-typography-h6,
body .mud-typography-subtitle1,
body .mud-typography-subtitle2,
body .mud-typography-body1,
body .mud-typography-body2,
body .mud-typography-button,
body .mud-typography-caption,
body .mud-typography-overline,
body .mud-typography {
    font-family: 'Tajawal', 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
}

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 #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: #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;
}

.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;
}

/* Cap individual input controls to 300px (applied directly on inputs) */
.input-300 {
    max-width: 300px;
    width: 100%;
}



/* ── Date/time picker dialogs: MudBlazor copies the input's Style (e.g. width:150px)
   onto the dialog paper, clipping the calendar. Override the inline style. ── */
.mud-picker-paper.mud-dialog {
    width: max-content !important;
    min-width: 330px !important;
    max-width: 95vw !important;
    border-radius: 18px !important;
    overflow: hidden;
    padding-bottom: 14px;
}

/* ── Date picker dialog polish ─────────────────────────────────────────── */
.mud-picker-paper.mud-dialog .mud-picker-toolbar {
    background: linear-gradient(135deg, #1A73E8 0%, #1557B0 100%) !important;
}

/* Center the calendar when the dialog is widened by its toolbar text */
.mud-picker-paper.mud-dialog .mud-picker-calendar-content {
    justify-items: center !important;
}
.mud-picker-paper.mud-dialog .mud-picker-calendar-container {
    margin: 0 auto !important;
}

/* Weekday header labels: small enough that full Arabic day names fit their
   40px columns without colliding */
.mud-picker-paper.mud-dialog .mud-picker-calendar-header-day .mud-day-label {
    font-size: .58rem;
    font-weight: 700;
    color: #6b7280;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
}

.mud-picker-paper.mud-dialog .mud-day.mud-selected {
    background: #1A73E8 !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(26, 115, 232, .40);
}

.mud-picker-paper.mud-dialog .mud-day:not(.mud-selected):hover {
    background: #DBEAFE !important;
}
/* Fixed table headers everywhere: every MudTable has FixedHeader="true"
   (class mud-table-sticky-header). Cap the scroll area so tables without an
   explicit Height scroll inside themselves and the header stays visible. */
.mud-table-sticky-header .mud-table-container {
    max-height: calc(100vh - 220px);
    overflow-y: auto;
}
.mud-table-sticky-header .mud-table-head th {
    position: sticky;
    top: 0;
    z-index: 2;
}
.mud-dialog .mud-table-sticky-header .mud-table-container {
    max-height: 55vh;
}