/* ==========================================================================
   Iraq Dentists Survey
   Layered on Bootstrap 5.3. The RTL build is swapped in wholesale for Arabic
   and Kurdish, so nothing here may hard-code left/right - use logical
   properties (inline-start/end) throughout.
   ========================================================================== */

:root {
    --survey-brand: #0d6efd;
    --survey-brand-soft: rgba(13, 110, 253, .08);
    --survey-radius: .75rem;
}

html, body {
    font-family: 'Segoe UI', 'Noto Sans Arabic', 'Noto Kufi Arabic', Tahoma, Arial, sans-serif;
    background-color: #f6f7f9;
}

/* Arabic and Kurdish need a little more line height to stay legible. */
html[dir="rtl"] body {
    line-height: 1.7;
}

h1:focus {
    outline: none;
}

/* ------------------------------------------------------------- app shell -- */

.app-navbar {
    background-color: #fff;
    border-bottom: 1px solid var(--bs-border-color);
}

.app-footer {
    background-color: #fff;
}

.brand-mark,
.login-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--survey-brand-soft);
    border-radius: 50%;
}

.brand-mark {
    width: 2rem;
    height: 2rem;
    font-size: 1.1rem;
}

.login-mark {
    width: 4rem;
    height: 4rem;
    font-size: 2rem;
}

.bare-shell {
    background: linear-gradient(160deg, #eef3ff 0%, #f6f7f9 55%);
}

.login-shell {
    min-height: 100vh;
}

.login-card {
    width: 100%;
    max-width: 27rem;
    border-radius: var(--survey-radius);
}

/* ------------------------------------------------------------------ form -- */

.entry-form .card {
    border-radius: var(--survey-radius);
}

.entry-form .card-header {
    font-size: .95rem;
}

.req {
    color: var(--bs-danger);
    margin-inline-start: .15rem;
}

/* Classification picker ----------------------------------------------------*/

.class-option {
    background: #fff;
    border-color: var(--bs-border-color) !important;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.class-option:hover {
    border-color: var(--survey-brand) !important;
}

.class-option.is-selected {
    border-color: var(--survey-brand) !important;
    box-shadow: 0 0 0 .2rem var(--survey-brand-soft);
    background: var(--survey-brand-soft);
}

.class-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.class-a { background-color: #198754; }
.class-b { background-color: #0d6efd; }
.class-c { background-color: #fd7e14; }
.class-d { background-color: #6c757d; }

/* Day chips ----------------------------------------------------------------*/

.day-chip {
    min-width: 3.5rem;
}

/* Pharmacy picker ----------------------------------------------------------*/

.pharmacy-results {
    max-height: 18rem;
    overflow-y: auto;
    border-radius: var(--survey-radius);
}

.pharmacy-results .list-group-item {
    border-radius: 0;
}

.min-w-0 {
    min-width: 0;
}

/* Photo --------------------------------------------------------------------*/

.photo-dropzone {
    border-style: dashed !important;
    border-width: 2px !important;
    background: #fff;
}

.photo-preview {
    max-height: 20rem;
    object-fit: contain;
}

/* --------------------------------------------------------------- reports -- */

.stat-tile {
    border-radius: var(--survey-radius);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
}

.stat-label {
    font-size: .8rem;
    color: var(--bs-secondary-color);
}

/* Ten columns will not fit a phone. Give the table its natural width and let the
   .table-responsive wrapper scroll, rather than letting headers wrap to one letter
   per line. */
.report-table {
    min-width: 54rem;
}

    .report-table th,
    .report-table td {
        white-space: nowrap;
    }

    /* The rep name is the one column allowed to wrap. */
    .report-table td:first-child {
        white-space: normal;
        min-width: 8rem;
    }

.breakdown-track {
    height: .4rem;
    background: var(--bs-secondary-bg);
    border-radius: 1rem;
    overflow: hidden;
    margin-top: .2rem;
}

.breakdown-fill {
    height: 100%;
    background: var(--survey-brand);
    border-radius: 1rem;
}

.daily-chart {
    display: flex;
    align-items: flex-end;
    gap: .25rem;
    height: 10rem;
    overflow-x: auto;
    padding-bottom: 1.2rem;
}

.daily-bar {
    position: relative;
    flex: 1 0 1.25rem;
    height: 100%;
    display: flex;
    align-items: flex-end;
}

.daily-bar-fill {
    width: 100%;
    background: var(--survey-brand);
    border-radius: .25rem .25rem 0 0;
    min-height: 2px;
}

.daily-bar-label {
    position: absolute;
    inset-block-end: -1.15rem;
    inset-inline-start: 0;
    inset-inline-end: 0;
    text-align: center;
    font-size: .65rem;
    color: var(--bs-secondary-color);
}

/* -------------------------------------------------------------- a11y/UX -- */

/* Comfortable tap targets for field use on phones. */
@media (max-width: 575.98px) {
    .btn,
    .form-control,
    .form-select {
        min-height: 2.75rem;
    }

    .stat-value {
        font-size: 1.4rem;
    }
}

.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: 2px solid var(--survey-brand);
    outline-offset: 1px;
}

.validation-message,
.invalid-feedback {
    color: var(--bs-danger);
    font-size: .85rem;
}

/* --------------------------------------------------------- error overlay -- */

#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: 1060;
}

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

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

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }
