/* HireMee Proctoring demo styles (prefix pd- to avoid clashes when merged into an existing app) */
:root {
    --pd-bg: #f4f6f9;
    --pd-card: #ffffff;
    --pd-text: #1d2433;
    --pd-muted: #667085;
    --pd-border: #e3e7ee;
    --pd-primary: #1f5eff;
    --pd-high: #d92d20;
    --pd-medium: #dc6803;
    --pd-low: #b08800;
    --pd-info: #2e7d32;
    --pd-radius: 10px;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--pd-bg); color: var(--pd-text); font: 14px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif; }
h1 { font-size: 20px; margin: 0 0 8px; }
h2 { font-size: 16px; margin: 0 0 8px; }
h3 { font-size: 14px; margin: 16px 0 6px; }

.pd-loading { padding: 48px; text-align: center; color: var(--pd-muted); }
.pd-shell { min-height: 100vh; display: flex; flex-direction: column; }
.pd-header { display: flex; gap: 12px; align-items: baseline; padding: 12px 20px; background: #10213f; color: #fff; }
.pd-brand { font-weight: 700; font-size: 16px; }
.pd-sub { opacity: .7; font-size: 13px; }
.pd-version-warn { margin-left: auto; background: #fef0c7; color: #93370d; padding: 2px 8px; border-radius: 6px; font-size: 12px; }
.pd-main { flex: 1; padding: 16px; }

.pd-card { background: var(--pd-card); border: 1px solid var(--pd-border); border-radius: var(--pd-radius); padding: 16px; }
.pd-muted { color: var(--pd-muted); }
.pd-hidden { display: none; }
.pd-error { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: #fef3f2; color: var(--pd-high); display: flex; gap: 12px; align-items: center; justify-content: space-between; }

.pd-btn { background: var(--pd-primary); color: #fff; border: 0; border-radius: 8px; padding: 9px 16px; font-weight: 600; cursor: pointer; }
.pd-btn:disabled { opacity: .5; cursor: default; }
.pd-btn-small { padding: 5px 10px; font-size: 12px; }
.pd-btn-danger { background: var(--pd-high); }

.pd-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 12px 0; }
.pd-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--pd-muted); }
.pd-form input { padding: 8px 10px; border: 1px solid var(--pd-border); border-radius: 6px; font-size: 14px; }

/* camera */
.pd-video-wrap { position: relative; background: #000; border-radius: var(--pd-radius); overflow: hidden; aspect-ratio: 4 / 3; }
.pd-video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); /* mirror preview only; captures are not mirrored */ }
.pd-instruction { position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 10px 14px; border-radius: 8px; background: rgba(16, 33, 63, .85); color: #fff; font-size: 16px; text-align: center; }
.pd-progress { height: 6px; background: var(--pd-border); border-radius: 3px; margin-top: 10px; overflow: hidden; }
.pd-progress > div { height: 100%; background: var(--pd-primary); transition: width .3s; }
.pd-live { position: absolute; top: 10px; left: 10px; padding: 3px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; background: rgba(0,0,0,.55); color: #ccc; }
.pd-live.on { color: #ff4d4f; }

/* candidate alert on the preview */
.pd-alert { position: absolute; top: 10px; right: 10px; left: 90px; padding: 10px 12px; border-radius: 8px; color: #fff; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 4px 16px rgba(0,0,0,.3); animation: pd-in .2s ease-out; }
.pd-alert.sev-high { background: rgba(217, 45, 32, .95); }
.pd-alert.sev-medium { background: rgba(220, 104, 3, .95); }
.pd-alert.sev-low { background: rgba(176, 136, 0, .95); }
.pd-alert small { opacity: .85; }
@keyframes pd-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* enrollment */
.pd-enroll { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 16px; max-width: 1200px; margin: 0 auto; }
.pd-checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pd-checklist li { display: flex; gap: 8px; align-items: baseline; }
.pd-checklist li span { width: 18px; font-weight: 700; }
.pd-checklist li.ok span { color: var(--pd-info); }
.pd-checklist li.bad span { color: var(--pd-high); }
.pd-checklist small { color: var(--pd-muted); margin-left: 4px; }
.pd-thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.pd-thumbs img { width: 31%; border-radius: 6px; transform: scaleX(-1); }

/* monitoring */
.pd-monitor { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); gap: 16px; height: calc(100vh - 80px); }
.pd-monitor-left { display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.pd-monitor-right { display: flex; flex-direction: column; min-height: 0; }
.pd-hud { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.pd-hud div { background: var(--pd-bg); border-radius: 8px; padding: 6px 8px; }
.pd-hud label { display: block; font-size: 11px; color: var(--pd-muted); }
.pd-hud span { font-weight: 600; text-transform: capitalize; }
.pd-hud .state-OK { color: var(--pd-info); }
.pd-ref { display: flex; gap: 12px; align-items: center; }
.pd-ref img { width: 72px; height: 54px; object-fit: cover; border-radius: 6px; transform: scaleX(-1); }
.pd-actions { display: flex; gap: 8px; }

.pd-flags-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.pd-counts { display: flex; gap: 8px; align-items: center; font-size: 12px; font-weight: 600; }
.pd-counts .sev-high { color: var(--pd-high); }
.pd-counts .sev-medium { color: var(--pd-medium); }
.pd-counts .sev-low { color: var(--pd-low); }
.pd-toggle { font-weight: 400; color: var(--pd-muted); }
.pd-flags-list { flex: 1; overflow-y: auto; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; }
.pd-flag { display: flex; gap: 10px; padding: 10px; border: 1px solid var(--pd-border); border-left: 4px solid var(--pd-border); border-radius: 8px; animation: pd-in .2s ease-out; }
.pd-flag.sev-high { border-left-color: var(--pd-high); }
.pd-flag.sev-medium { border-left-color: var(--pd-medium); }
.pd-flag.sev-low { border-left-color: var(--pd-low); }
.pd-flag.sev-info { border-left-color: var(--pd-info); background: #f6fbf6; }
.pd-flag img { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; cursor: zoom-in; flex-shrink: 0; }
.pd-flag-body { flex: 1; min-width: 0; }
.pd-flag-top { display: flex; justify-content: space-between; gap: 8px; }
.pd-flag-meta { font-size: 12px; color: var(--pd-muted); margin: 2px 0 4px; }
.pd-badge { font-size: 11px; padding: 1px 6px; border-radius: 10px; background: var(--pd-bg); }
.pd-verify { font-size: 12px; margin-top: 4px; color: #344054; }
.pd-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.8); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #fff; z-index: 1000; cursor: zoom-out; }
.pd-lightbox img { max-width: 90vw; max-height: 80vh; border-radius: 8px; }

#blazor-error-ui { background: #fef3f2; color: var(--pd-high); bottom: 0; display: none; left: 0; padding: 10px 20px; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 12px; top: 8px; }

@media (max-width: 900px) {
    .pd-enroll, .pd-monitor { grid-template-columns: 1fr; height: auto; }
    .pd-hud { grid-template-columns: repeat(3, 1fr); }
    .pd-flags-list { max-height: 60vh; }
}
