/* ============================================================
 * SentryCBT — Metronic overrides + utilities
 *   Loaded after style.bundle.css so it wins specificity ties.
 *   Tenant theming lives in inline <style> on <html>; here we
 *   keep shared visual polish only.
 * ============================================================ */

:root {
    --kt-shell-bg: #F5F8FA;
    --kt-panel-bg: #FFFFFF;
}

/* Bump the global base size — Metronic defaults to ~13px; we scale to ~15.5px so all
 * rem-based components (Bootstrap utilities, spacing, fs-* helpers) grow uniformly. */
html { font-size: 15.5px; }
body { background: var(--kt-shell-bg); font-size: 1rem; line-height: 1.55; }

/* Re-tune Metronic's fs-* utilities so they remain visually distinct after the bump. */
.fs-1 { font-size: 2rem !important; }
.fs-2 { font-size: 1.5rem !important; }
.fs-3 { font-size: 1.25rem !important; }
.fs-4 { font-size: 1.15rem !important; }
.fs-5 { font-size: 1.05rem !important; }
.fs-6 { font-size: 1rem !important; }
.fs-7 { font-size: 0.92rem !important; }
.fs-8 { font-size: 0.84rem !important; }
.fs-9 { font-size: 0.76rem !important; }
.letter-spacing-2 { letter-spacing: 0.08em; }

/* Tables and form controls inherit better at the new base */
.table { font-size: 0.95rem; }
.form-control, .form-select { font-size: 0.95rem; }
.btn { font-size: 0.92rem; }
.btn-sm { font-size: 0.85rem; }
.badge { font-size: 0.78rem; }

.app-header {
    background: #ffffff;
    border-bottom: 1px solid #E4E6EF;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.app-toolbar {
    background: #ffffff;
}

/* =============================================================
 *  Warning palette: the default amber #FFA800 reads as ignorable
 *  pastel against light surfaces. Override Metronic + Bootstrap
 *  warning utilities with a saturated tangerine so admin
 *  attention-getters actually catch the eye.
 * ============================================================= */
:root {
    --kt-warning: #EA580C;          /* tangerine 600 */
    --kt-warning-rgb: 234, 88, 12;
    --kt-warning-light: #FFE4D1;
    --kt-warning-light-rgb: 255, 228, 209;
    --kt-warning-inverse: #ffffff;
}

.text-warning,
.text-hover-warning:hover,
.btn.btn-link-warning { color: var(--kt-warning) !important; }

.bg-warning { background-color: var(--kt-warning) !important; color: var(--kt-warning-inverse) !important; }
.bg-light-warning { background-color: var(--kt-warning-light) !important; }
.bg-hover-warning:hover { background-color: var(--kt-warning) !important; }
.border-warning { border-color: var(--kt-warning) !important; }

.btn.btn-warning {
    background-color: var(--kt-warning) !important;
    color: var(--kt-warning-inverse) !important;
    border-color: var(--kt-warning) !important;
}
.btn.btn-warning:hover, .btn.btn-warning:focus, .btn.btn-warning.active {
    background-color: #C2410C !important;
    border-color: #C2410C !important;
    color: #fff !important;
}
.btn.btn-light-warning {
    background-color: var(--kt-warning-light) !important;
    color: var(--kt-warning) !important;
}
.btn.btn-light-warning:hover {
    background-color: var(--kt-warning) !important;
    color: #fff !important;
}

.badge.badge-warning,
.badge.bg-warning {
    background-color: var(--kt-warning) !important;
    color: #fff !important;
}
.badge.badge-light-warning {
    background-color: var(--kt-warning-light) !important;
    color: var(--kt-warning) !important;
}

.alert.bg-light-warning,
.alert-warning {
    background-color: var(--kt-warning-light) !important;
    border-left: 4px solid var(--kt-warning) !important;
    color: #7C2D12 !important;
}
.alert-warning .alert-link, .alert.bg-light-warning .alert-link { color: var(--kt-warning) !important; }

.status-pill-warning {
    background-color: var(--kt-warning-light) !important;
    color: var(--kt-warning) !important;
}

.ring.ring-warning, .form-control:focus.border-warning {
    box-shadow: 0 0 0 3px rgba(var(--kt-warning-rgb), 0.25) !important;
}

/* Integrity score pill — shown on the Sessions and Submissions lists. */
.integrity-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.28rem 0.65rem;
    border-radius: 99px;
    font-weight: 700;
    font-size: 0.8rem;
    min-width: 56px;
    justify-content: center;
}
.integrity-pill__dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.integrity-pill.is-clean   { background: #DCFCE7; color: #0F6F3D; }
.integrity-pill.is-clean   .integrity-pill__dot { background: #16A34A; }
.integrity-pill.is-caution { background: #FEF3C7; color: #92400E; }
.integrity-pill.is-caution .integrity-pill__dot { background: #D97706; }
.integrity-pill.is-high    { background: #FEE2E2; color: #9F1239; }
.integrity-pill.is-high    .integrity-pill__dot { background: #DC2626; }
@keyframes integrityFlash {
    0%   { box-shadow: 0 0 0 0 rgba(15, 76, 129, 0.55); }
    100% { box-shadow: 0 0 0 8px rgba(15, 76, 129, 0); }
}
.integrity-pill.flash { animation: integrityFlash 0.9s ease-out; }

/* =========================================================================
 *  Mobile-first exam shell (M3.2)
 *  Tightens spacing, makes touch targets bigger, stacks question + nav on
 *  narrow screens, and floats the proctor recorder card into a less-intrusive
 *  pinned chip.
 * =======================================================================*/

/* Default: dial down outer chrome on phones (applies to the exam-sit layout). */
@media (max-width: 575.98px) {
    body.app-blank { font-size: 1rem; }

    .app-blank .container-xxl { padding-left: 0.75rem; padding-right: 0.75rem; }

    /* Bigger touch targets on radio/checkbox option rows */
    .app-blank label.d-flex.border { padding: 0.85rem 0.95rem !important; min-height: 56px; }
    .app-blank label.d-flex.border .form-check-input { width: 22px; height: 22px; margin-top: 2px; }
    .app-blank label.d-flex.border span { font-size: 0.95rem; line-height: 1.4; }

    /* Bigger pagination buttons */
    .app-blank .btn { padding: 0.7rem 1.1rem; font-size: 0.95rem; }
    .app-blank .btn-danger { width: 100%; }

    /* Stack the answer pagination row vertically so the action buttons are full width */
    .app-blank .d-flex.flex-wrap.justify-content-between { gap: 0.6rem !important; }

    /* Sticky exam timer at top so the candidate always sees it without scrolling */
    .app-blank #exam-timer {
        position: sticky; top: 0.5rem; z-index: 30;
        margin: 0 -0.25rem 1rem;
        padding: 0.55rem 0.85rem !important;
        background: #fff;
        text-align: left !important;
    }
    .app-blank #exam-timer [data-timer-display] { font-size: 1.5rem !important; }

    /* Compact navigator tiles */
    .app-blank .card .d-flex.flex-wrap.gap-2 a[style*="34px"] {
        width: 36px !important; height: 36px !important; font-size: 0.85rem !important;
    }

    /* Proctor recorder: shrink and dock to top-right instead of full bottom-right card */
    #exam-recorder {
        position: fixed !important;
        top: 0.45rem !important; right: 0.45rem !important;
        bottom: auto !important;
        margin: 0 !important;
        padding: 0.35rem 0.55rem !important;
        border-radius: 999px !important;
        gap: 0.4rem !important;
    }
    #exam-recorder video { width: 36px !important; height: 28px !important; }
    #exam-recorder [data-recorder-indicator] { font-size: 0.6rem !important; }
    #exam-recorder [data-proctoring-indicator] { display: none !important; }

    /* Question text — larger and easier to read */
    .app-blank .card-body p.fs-5 { font-size: 1.0625rem !important; line-height: 1.55; }

    /* Card padding */
    .app-blank .card-body.p-6 { padding: 1rem !important; }

    /* Hide explanatory legend on phones — too noisy */
    .app-blank .text-gray-500.fs-9 { font-size: 0.7rem !important; }
}

/* Tablet — keep most of desktop but smaller spacing */
@media (min-width: 576px) and (max-width: 991.98px) {
    .app-blank .container-xxl { padding-left: 1rem; padding-right: 1rem; }
    .app-blank label.d-flex.border { padding: 0.75rem 0.95rem !important; }
}

/* Universal: prevent zoom-on-focus for iOS by ensuring inputs are ≥16px */
.app-blank input, .app-blank textarea, .app-blank select { font-size: 16px; }

/* Make the horizontal menu look like Metronic's "rounded" top nav. */
.menu .menu-link {
    padding: 0.7rem 0.95rem;
    border-radius: 0.5rem;
    transition: background-color .15s ease, color .15s ease;
}
.menu .menu-link.active {
    background-color: rgba(var(--bs-primary-rgb), .08);
    color: rgb(var(--bs-primary-rgb));
}
.menu .menu-link.active .menu-title { color: rgb(var(--bs-primary-rgb)); font-weight: 600; }
.menu .menu-link.active .menu-icon i { color: rgb(var(--bs-primary-rgb)); }

/* Card defaults — softer shadow + flatter borders. */
.card {
    border: 1px solid #EAECF0;
    border-radius: 0.875rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.card .card-header {
    border-bottom: 1px solid #EAECF0;
    min-height: 3.5rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/* KPI stat tile */
.kpi-tile {
    border-radius: 0.875rem;
    background: #fff;
    border: 1px solid #EAECF0;
    padding: 1.25rem 1.5rem;
}
.kpi-tile .kpi-label { color: #64748B; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.kpi-tile .kpi-value { font-size: 1.75rem; font-weight: 700; color: #0F172A; }
.kpi-tile .kpi-delta { font-size: 0.75rem; color: #64748B; }

/* Status pills */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.1;
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pill-primary { background: rgba(var(--bs-primary-rgb), .10); color: rgb(var(--bs-primary-rgb)); }
.status-pill-success { background: rgba(80, 205, 137, .12); color: #119C5B; }
.status-pill-warning { background: rgba(255, 199, 0, .15); color: #B07A00; }
.status-pill-danger  { background: rgba(241, 65, 108, .12); color: #B11A47; }
.status-pill-muted   { background: #F1F5F9; color: #64748B; }

/* Better table look paired with Metronic */
.table-app th { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: #64748B; font-weight: 600; }
.table-app tr:hover td { background: #F8FAFC; }

/* Subtle separator badge inside name + email blocks */
.user-block .user-name { font-weight: 600; color: #0F172A; }
.user-block .user-email { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.7rem; color: #64748B; }

/* App page lighter background pattern */
.app-page { background: var(--kt-shell-bg); }

/* Dropdowns inside the user menu */
.dropdown-menu .dropdown-item { padding: 0.55rem 1rem; font-size: 0.85rem; color: #344054; }
.dropdown-menu .dropdown-item:hover { background: #F1F5F9; }

/* Footer */
.app-footer { background: #ffffff; border-top: 1px solid #E4E6EF; }

/* Image fallback */
.h-30px { height: 30px; }
.h-40px { height: 40px; }

/* Utilities used by JS toggles + custom states */
.hidden { display: none !important; }
.empty-hide:empty { display: none !important; }

/* asp-validation-summary always renders a wrapper <ul> even with no errors, so :empty never
 * matches. The tag-helper adds .validation-summary-valid when the model is valid — hide that
 * everywhere so the red callout only appears when something actually failed. */
.validation-summary-valid { display: none !important; }
.hover-bg-light:hover { background: #F8FAFC; }
.hover-shadow { transition: box-shadow 0.15s ease, transform 0.15s ease; }
.hover-shadow:hover { box-shadow: 0 10px 15px -3px rgb(15 23 42 / 0.08), 0 4px 6px -4px rgb(15 23 42 / 0.04); transform: translateY(-1px); }
.cursor-pointer { cursor: pointer; }
.object-fit-cover { object-fit: cover; }
.ratio-16x9 { aspect-ratio: 16 / 9; }
