/* Lifted verbatim from assignment-web-results.blade.php.
   Inline it was 18,091 bytes of HTML on every render;
   as a file the browser fetches it once. */
/* ══════════════════════════════════════════════════════════════════
   WEB RESULTS — clean dashboard aligned with the Insights design.
   Uses global theme tokens so dark mode flips automatically.
   ══════════════════════════════════════════════════════════════════ */

.wr-container {
    max-width: 1480px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem 4rem;
    background: var(--background, #ffffff);
    color: var(--foreground, #0a0a0a);
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ── shared "what does this mean?" tooltip helper ──────── */
.cq-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 13px;
    height: 13px;
    margin-left: 0.3rem;
    border-radius: 50%;
    border: 1px solid currentColor;
    color: var(--muted-foreground, #6b7280);
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    position: relative;
    opacity: 0.55;
    transition: opacity 0.15s;
    user-select: none;
    vertical-align: middle;
    flex-shrink: 0;
}
.cq-tip::after { content: "?"; }
.cq-tip:hover, .cq-tip:focus-visible { opacity: 1; outline: none; }
.cq-tip:hover::before,
.cq-tip:focus-visible::before {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    width: max-content;
    max-width: 280px;
    padding: 8px 11px;
    background: #0f172a;
    color: #f8fafc;
    font-size: 11.5px;
    font-weight: 400;
    line-height: 1.45;
    border-radius: 6px;
    white-space: normal;
    text-align: left;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    pointer-events: none;
}

/* ── header ─────────────────────────────────────────────── */
.wr-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border, #e5e7eb);
    flex-wrap: wrap;
}
.wr-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.55rem 0.25rem 0.4rem;
    background: color-mix(in srgb, var(--foreground, #0a0a0a) 6%, transparent);
    color: var(--muted-foreground, #6b7280);
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
}
.wr-title {
    margin: 0;
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}
.wr-subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.875rem;
    color: var(--muted-foreground, #6b7280);
}

/* KPIs strip on the right of the header */
.wr-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(96px, 1fr));
    gap: 0;
    background: var(--border, #e5e7eb);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    overflow: hidden;
}
.wr-kpi {
    padding: 0.65rem 0.9rem;
    background: var(--card, var(--background, #ffffff));
    text-align: left;
}
.wr-kpi-val {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
.wr-kpi-lbl {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-foreground, #6b7280);
    margin-top: 0.1rem;
}

/* ── layout: sidebar + main ─────────────────────────────── */
.wr-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 900px) {
    .wr-layout { grid-template-columns: 1fr; }
}

/* ── sidebar ────────────────────────────────────────────── */
.wr-sidebar {
    background: var(--card, var(--background, #ffffff));
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    padding: 0.85rem;
    position: sticky;
    top: 84px;
    max-height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
    min-height: 0;
}
@media (max-width: 900px) {
    .wr-sidebar { position: static; max-height: none; }
}
.wr-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.15rem 0.25rem 0.6rem;
    margin-bottom: 0.55rem;
    border-bottom: 1px solid var(--border, #e5e7eb);
}
.wr-side-title {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-foreground, #6b7280);
}
.wr-side-count {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--muted-foreground, #6b7280);
    background: var(--muted, #f3f4f6);
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
}

.wr-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    background: var(--muted, #f3f4f6);
    border: 1px solid transparent;
    border-radius: 8px;
    margin-bottom: 0.55rem;
    transition: border-color 0.15s;
}
.wr-search:focus-within { border-color: color-mix(in srgb, var(--foreground, #0a0a0a) 30%, transparent); }
.wr-search svg { color: var(--muted-foreground, #6b7280); }
.wr-search input {
    flex: 1;
    border: 0;
    background: transparent;
    outline: none;
    font-size: 0.8125rem;
    color: var(--foreground, #0a0a0a);
}
.wr-search input::placeholder { color: var(--muted-foreground, #6b7280); }

.wr-filters {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.65rem;
    padding: 0.2rem;
    background: var(--muted, #f3f4f6);
    border-radius: 7px;
}
.wr-pill {
    flex: 1;
    padding: 0.4rem 0.5rem;
    background: transparent;
    color: var(--muted-foreground, #6b7280);
    border: 0;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.wr-pill:hover { color: var(--foreground, #0a0a0a); }
.wr-pill.active {
    background: var(--card, var(--background, #ffffff));
    color: var(--foreground, #0a0a0a);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* ── submissions list (rendered by JS) ─────────────────── */
.wr-list {
    overflow-y: auto;
    flex: 1;
    margin: 0 -0.35rem;
    padding: 0 0.35rem 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border, #e5e7eb) transparent;
}
.wr-list::-webkit-scrollbar { width: 6px; }
.wr-list::-webkit-scrollbar-thumb { background: var(--border, #e5e7eb); border-radius: 999px; }

.wr-item {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    border: 1px solid transparent;
    background: transparent;
}
.wr-item:hover {
    background: var(--muted, #f3f4f6);
}
.wr-item.active {
    background: color-mix(in srgb, var(--foreground, #0a0a0a) 6%, transparent);
    border-color: color-mix(in srgb, var(--foreground, #0a0a0a) 14%, transparent);
}
.wr-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--muted, #f3f4f6);
    color: var(--muted-foreground, #6b7280);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}
.wr-item-info { display: flex; flex-direction: column; min-width: 0; }
.wr-item-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--foreground, #0a0a0a);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wr-item-meta {
    font-size: 0.7rem;
    color: var(--muted-foreground, #6b7280);
    margin-top: 0.05rem;
}
.wr-item-score {
    font-size: 0.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
}

/* score color classes used by the JS (DO NOT RENAME) */
.wr-score-high   { background: rgba(239, 68, 68, 0.14);  color: #b91c1c; }
.wr-score-medium { background: rgba(245, 158, 11, 0.16); color: #b45309; }
.wr-score-low    { background: rgba(16, 185, 129, 0.14); color: #047857; }
.wr-score-none   { background: var(--muted, #f3f4f6); color: var(--muted-foreground, #6b7280); }

/* ── main / detail panel ────────────────────────────────── */
.wr-main {
    background: var(--card, var(--background, #ffffff));
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    min-height: 480px;
    overflow: hidden;
}

/* empty state */
.wr-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 0.5rem;
    min-height: 480px;
}
.wr-empty-icon {
    width: 70px;
    height: 70px;
    border-radius: 18px;
    background: var(--muted, #f3f4f6);
    color: var(--muted-foreground, #6b7280);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}
.wr-empty h3 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.wr-empty p {
    margin: 0;
    max-width: 380px;
    font-size: 0.8125rem;
    color: var(--muted-foreground, #6b7280);
    line-height: 1.5;
}

/* buttons */
.wr-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    background: transparent;
    color: var(--foreground, #0a0a0a);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
    margin-top: 0.85rem;
}
.wr-btn:hover { background: var(--muted, #f3f4f6); }
.wr-btn-primary {
    background: var(--foreground, #0a0a0a);
    color: var(--background, #ffffff);
    border-color: var(--foreground, #0a0a0a);
}
.wr-btn-primary:hover { opacity: 0.92; color: var(--background, #ffffff); background: var(--foreground, #0a0a0a); }

/* ── detail content (rendered by renderResults JS) ─────── */
.wr-result-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border, #e5e7eb);
    flex-wrap: wrap;
}
.wr-result-user { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.wr-result-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--muted, #f3f4f6);
    color: var(--muted-foreground, #6b7280);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}
.wr-result-name {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--foreground, #0a0a0a);
}
.wr-result-email {
    margin: 0.1rem 0 0;
    font-size: 0.75rem;
    color: var(--muted-foreground, #6b7280);
}
.wr-result-stats {
    display: flex;
    gap: 0;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    overflow: hidden;
    background: var(--border, #e5e7eb);
}
.wr-rstat {
    padding: 0.55rem 0.95rem;
    background: var(--card, var(--background, #ffffff));
    text-align: center;
    min-width: 80px;
}
.wr-rstat-val {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
.wr-rstat-lbl {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-foreground, #6b7280);
    margin-top: 0.15rem;
}

/* sections inside the detail */
.wr-section { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border, #e5e7eb); }
.wr-section:last-of-type { border-bottom: 0; }
.wr-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
.wr-section-title {
    margin: 0;
    font-size: 0.78125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-foreground, #6b7280);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.wr-section-count {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    background: var(--muted, #f3f4f6);
    color: var(--muted-foreground, #6b7280);
    border-radius: 999px;
}

/* sources table */
.wr-sources-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.wr-sources-table thead th {
    text-align: left;
    padding: 0.5rem 0.7rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-foreground, #6b7280);
    border-bottom: 1px solid var(--border, #e5e7eb);
}
.wr-sources-table tbody td {
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid var(--border, #e5e7eb);
    vertical-align: middle;
}
.wr-sources-table tbody tr:last-child td { border-bottom: 0; }
.wr-source-domain { font-weight: 600; color: var(--foreground, #0a0a0a); }
.wr-source-url {
    color: var(--muted-foreground, #6b7280);
    text-decoration: none;
    transition: color 0.15s;
}
.wr-source-url:hover { color: var(--foreground, #0a0a0a); text-decoration: underline; }
.wr-source-score {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* matches list */
.wr-matches-list { display: flex; flex-direction: column; gap: 0.5rem; }
.wr-match-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    background: var(--card, var(--background, #ffffff));
    transition: background 0.12s;
}
.wr-match-row:hover { background: var(--muted, #f3f4f6); }
.wr-match-source { min-width: 0; }
.wr-match-source-name {
    margin: 0;
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--foreground, #0a0a0a);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wr-match-source-url {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.15rem;
    font-size: 0.7rem;
    color: var(--muted-foreground, #6b7280);
    text-decoration: none;
}
.wr-match-source-url:hover { color: var(--foreground, #0a0a0a); }
.wr-match-stat { text-align: center; min-width: 50px; }
.wr-match-stat-val {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--foreground, #0a0a0a);
    font-variant-numeric: tabular-nums;
}
.wr-match-stat-lbl {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-foreground, #6b7280);
    margin-top: 0.05rem;
}
.wr-match-badge {
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 52px;
    text-align: center;
}

.wr-no-matches {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--muted-foreground, #6b7280);
    font-size: 0.875rem;
    background: var(--muted, #f3f4f6);
    border-radius: 8px;
}

/* footer action button */
.wr-action {
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: flex-end;
}
.wr-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.95rem;
    background: var(--foreground, #0a0a0a);
    color: var(--background, #ffffff);
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.15s;
}
.wr-action-btn:hover { opacity: 0.9; color: var(--background, #ffffff); }

/* loading / error states */
.wr-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 3rem 1rem;
    color: var(--muted-foreground, #6b7280);
}
.wr-loading-text { font-size: 0.825rem; }
.wr-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border, #e5e7eb);
    border-top-color: var(--foreground, #0a0a0a);
    border-radius: 50%;
    animation: wr-spin 0.7s linear infinite;
}
@keyframes wr-spin { to { transform: rotate(360deg); } }

.wr-error {
    padding: 2.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.4rem;
}
.wr-error-title { margin: 0; font-size: 0.95rem; font-weight: 700; color: var(--foreground, #0a0a0a); }
.wr-error-msg { margin: 0; font-size: 0.8125rem; color: var(--muted-foreground, #6b7280); }
.wr-retry {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.5rem;
    padding: 0.45rem 0.85rem;
    background: transparent;
    color: var(--foreground, #0a0a0a);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 7px;
    font-size: 0.78125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.wr-retry:hover { background: var(--muted, #f3f4f6); }

/* ── tones used inline ──────────────────────────────────── */
.wr-tone-green { color: #059669; }
.wr-tone-amber { color: #d97706; }
.wr-tone-red   { color: #dc2626; }
.wr-danger     { color: #dc2626; }
.wr-warn       { color: #d97706; }

/* ── responsive tweaks ──────────────────────────────────── */
@media (max-width: 900px) {
    .wr-container { padding: 1rem 1rem 3rem; }
    .wr-header { flex-direction: column; align-items: stretch; }
    .wr-kpis { grid-template-columns: repeat(4, 1fr); }
    .wr-result-top { flex-direction: column; align-items: stretch; }
    .wr-match-row { grid-template-columns: 1fr auto auto; }
    .wr-match-row .wr-match-stat:nth-of-type(2) { display: none; }
}
@media (max-width: 600px) {
    .wr-kpis { grid-template-columns: repeat(2, 1fr); }
    .wr-section { padding: 0.85rem 1rem; }
    .wr-result-top { padding: 1rem; }
    .wr-action { padding: 0.85rem 1rem; }
}

/* ── print ──────────────────────────────────────────────── */
@media print {
    .wr-sidebar, .wr-filters, .wr-search, .wr-action { display: none; }
    .wr-layout { grid-template-columns: 1fr; }
    .wr-main { border: 0; }
}
