/* ============================================================
   Beauty Navigator — Global CSS Overrides for IW-AuditSystem
   Supplements MudBlazor's palette with tokens and patterns
   that the theme API cannot express.
   ============================================================ */

/* ── 1. Design token variables ─────────────────────────────── */
:root {
  --bn-primary:       #4d9dc1;
  --bn-primary-hover: #3788aa;
  --bn-primary-dark:  #24586f;
  --bn-primary-soft:  #eef8fb;
  --bn-primary-line:  #cfe8f2;

  --bn-accent:        #ff5a1f;
  --bn-accent-hover:  #e64b16;
  --bn-accent-soft:   #fff1eb;

  --bn-bg:            #f7fafb;
  --bn-bg-alt:        #eef5f8;
  --bn-surface:       #ffffff;
  --bn-border:        #dfe7ed;
  --bn-border-strong: #9fb0c4;

  --bn-text:          #1f2d36;
  --bn-heading:       #14233c;
  --bn-muted:         #667685;

  --bn-success:       #198754;
  --bn-success-soft:  #eef8f2;
  --bn-danger:        #b54747;
  --bn-danger-soft:   #fff5f5;
  --bn-warning:       #f59f00;

  /* Bootstrap primary override — keeps any legacy Bootstrap
     components consistent with the BN palette */
  --bs-primary:     #4d9dc1;
  --bs-primary-rgb: 77, 157, 193;
}

/* ── 2. Base typography ─────────────────────────────────────── */
html, body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--bn-bg);
  color: var(--bn-text);
  -webkit-font-smoothing: antialiased;
}

/* ── 3. MudBlazor appbar — white, hairline bottom border ───── */
.mud-appbar {
  border-bottom: 1px solid var(--bn-border) !important;
  box-shadow: none !important;
}

/* ── 4. Card hover lift ─────────────────────────────────────── */
/* Applied to .bn-card; plain MudCard / MudPaper get the base
   border treatment from class helpers in razor markup. */
.bn-card {
  border: 1px solid var(--bn-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.bn-card:hover {
  border-color: var(--bn-primary);
  box-shadow: 0 4px 12px rgba(77, 157, 193, 0.20);
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  .bn-card,
  .bn-card:hover {
    transition: none;
    transform: none;
  }
}

/* ── 5. Soft-blue chip ──────────────────────────────────────── */
/* MudBlazor MudChip default color override */
.mud-chip.mud-chip-default {
  background-color: #e8f5fb !important;
  color: #24586f !important;
}

/* Custom BN chip — used as <span class="bn-chip"> in markup.
   Needs its own layout properties since it is not a MudChip. */
.bn-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  background-color: #e8f5fb;
  color: #24586f;
  padding: 0.18rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}

/* Status chip variants */
.bn-chip-success { background-color: var(--bn-success-soft) !important; color: var(--bn-success) !important; }
.bn-chip-danger  { background-color: var(--bn-danger-soft)  !important; color: var(--bn-danger)  !important; }
.bn-chip-warning { background-color: #fffbeb               !important; color: var(--bn-warning)  !important; }

/* ── 6. Input focus ring ────────────────────────────────────── */
.mud-input-outlined .mud-input-outlined-border:focus-within,
.mud-input-outlined:focus-within .mud-input-outlined-border {
  box-shadow: 0 0 0 3px rgba(77, 157, 193, 0.16) !important;
}

/* ── 7. Flat card / panel with hairline border ──────────────── */
/* Use .bn-panel on MudPaper when you want border-first styling
   (no MudBlazor elevation shadow). */
.bn-panel {
  border: 1px solid var(--bn-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(20, 35, 60, 0.05);
}

.bn-panel-soft {
  border: 1px solid rgba(77, 157, 193, 0.14);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(20, 35, 60, 0.05);
}

/* ── 8. Sidebar nav active state ────────────────────────────── */
.mud-nav-link.active,
.mud-nav-link:hover {
  background-color: var(--bn-primary-soft) !important;
  color: var(--bn-primary) !important;
}

.mud-nav-link.active {
  border-left: 3px solid var(--bn-primary);
  font-weight: 700;
}

/* ── 9. MudTable density — matches Admin Dashboard style ────── */
.bn-table .mud-table-head .mud-table-cell {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bn-muted);
  border-bottom: 2px solid var(--bn-border);
  padding: 8px 12px;
}

.bn-table .mud-table-row .mud-table-cell {
  font-size: 0.875rem;
  padding: 8px 12px;
  border-bottom: 1px solid var(--bn-border);
}

/* ── 10. Topbar logo ────────────────────────────────────────── */
.bn-topbar-logo {
  height: 36px;
  width: auto;
  display: block;
}

/* ── 11. Eyebrow label — with orange bar prefix ─────────────── */
/* Used above section headings. The ::before pseudo adds the
   orange line to the left, matching the AI Suite page style.   */
.bn-eyebrow,
.bn-ai-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--bn-primary);
  margin-bottom: 0;
}

.bn-eyebrow::before,
.bn-ai-eyebrow::before {
  content: "";
  width: 34px;
  height: 2px;
  border-radius: 99px;
  background: var(--bn-accent);
  flex-shrink: 0;
}

/* ── 11. Stat tile (Admin Dashboard top-row style) ──────────── */
.bn-stat-tile {
  background: #fff;
  border: 1px solid var(--bn-border);
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.bn-stat-tile .bn-stat-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bn-muted);
}

.bn-stat-tile .bn-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--bn-heading);
  line-height: 1.1;
  margin-top: 4px;
}

/* ── 12. Inline value pill (audit progress dynamic values) ───── */
.bn-pill {
  display: inline-flex;
  align-items: center;
  background: #e8f5fb;
  color: #24586f;
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.4;
}

/* ── 13. Loading progress bar — thin 3px blue ───────────────── */
.bn-loading-bar .mud-progress-linear-bar {
  height: 3px !important;
}

/* ── 14. Blazor default overrides (remove legacy blue) ──────── */
a, .btn-link {
  color: var(--bn-primary);
}

a:hover {
  color: var(--bn-primary-hover);
}

/* Top-bar "Return to Beauty Navigator" funnel link (show tweak). Brand blue,
   weighted like a nav item, with a little breathing room from the edge. */
.bn-return-link {
  font-weight: 700;
  margin-right: 8px;
}

.btn-primary {
  background-color: var(--bn-primary);
  border-color: var(--bn-primary);
  color: #fff;
  font-weight: 800;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--bn-primary-hover);
  border-color: var(--bn-primary-hover);
}

.btn:focus,
.btn:active:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(77, 157, 193, 0.16);
}

/* ── 15. Feature cards (Audit Home value-prop tiles) ────────── */
/* Mirrors the AI Suite card style: 22px radius, blue-tinted
   radial gradient in the top-right corner, subtle lift on hover. */
.bn-feature-card {
  position: relative;
  padding: 22px;
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(77, 157, 193, 0.10), transparent 42%),
    linear-gradient(180deg, #ffffff 0%, #fbfdfe 100%);
  border: 1px solid rgba(77, 157, 193, 0.18);
  box-shadow: 0 10px 28px rgba(18, 50, 68, 0.055);
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
  height: 100%;
  box-sizing: border-box;
}

.bn-feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(77, 157, 193, 0.38);
  box-shadow: 0 14px 34px rgba(18, 50, 68, 0.10);
}

@media (prefers-reduced-motion: reduce) {
  .bn-feature-card,
  .bn-feature-card:hover {
    transition: none;
    transform: none;
  }
}

.bn-feature-card-head {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 12px;
}

.bn-feature-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(77, 157, 193, 0.18);
  box-shadow: 0 4px 12px rgba(18, 50, 68, 0.06);
}

.bn-feature-title {
  margin: 0;
  color: #14233c;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.bn-feature-body {
  margin: 0;
  color: #263743;
  font-size: 0.875rem;
  line-height: 1.55;
}

/* ── 16. Audit progress — overall bar ──────────────────────── */
.bn-audit-progress-bar .mud-progress-linear {
  height: 6px;
  border-radius: 99px;
}

/* ── 17. Progress phase panels ──────────────────────────────── */
.bn-progress-panel {
  background: #fff;
  border: 1px solid var(--bn-border);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(20, 35, 60, 0.05);
  overflow: hidden;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.bn-progress-panel--active {
  border-color: var(--bn-primary);
  box-shadow: 0 0 0 3px rgba(77, 157, 193, 0.10), 0 10px 24px rgba(20, 35, 60, 0.06);
}

.bn-progress-panel--complete {
  border-color: rgba(25, 135, 84, 0.35);
}

.bn-progress-panel--failed {
  border-color: rgba(181, 71, 71, 0.40);
}

.bn-progress-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  transition: background-color .15s ease;
}

.bn-progress-panel-header:hover {
  background-color: var(--bn-primary-soft);
}

.bn-progress-panel-header:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--bn-primary);
}

.bn-progress-panel-status-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
}

.bn-status-active   { color: var(--bn-primary);  background: var(--bn-primary-soft); }
.bn-status-complete { color: var(--bn-success);  background: var(--bn-success-soft); }
.bn-status-failed   { color: var(--bn-danger);   background: var(--bn-danger-soft);  }
.bn-status-pending  { color: var(--bn-muted);    background: #f0f4f7;               }

.bn-progress-panel-label {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.bn-progress-panel-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--bn-heading);
  line-height: 1.25;
}

.bn-progress-panel-subtitle {
  font-size: 0.78rem;
  color: var(--bn-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bn-progress-panel-chevron {
  flex: 0 0 auto;
  color: var(--bn-muted);
  transition: transform .2s ease;
}

.bn-progress-panel-body {
  padding: 4px 16px 14px 16px;
  border-top: 1px solid var(--bn-border);
}

/* ── 18. Step rows ───────────────────────────────────────────── */
@keyframes bn-step-enter {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.bn-step-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 4px;
  border-radius: 6px;
  animation: bn-step-enter .3s ease-out both;
  font-size: 0.84rem;
}

@media (prefers-reduced-motion: reduce) {
  .bn-step-row { animation: none; }
}

.bn-step-row + .bn-step-row {
  border-top: 1px solid #f2f5f7;
}

.bn-step-active  { background: rgba(77, 157, 193, 0.05); }
.bn-step-done    { opacity: 0.85; }
.bn-step-failed  { background: rgba(181, 71, 71, 0.04); }
.bn-step-skipped { opacity: 0.55; }
.bn-step-pending { opacity: 0.50; }

/* Step icon wrapper */
.bn-step-icon-wrap {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
}

.bn-step-icon-active { color: var(--bn-primary); }
.bn-step-icon-done   { color: var(--bn-success); }
.bn-step-icon-failed { color: var(--bn-danger);  }
.bn-step-icon-pending { color: var(--bn-muted); }

/* Step name */
.bn-step-name {
  flex: 1 1 auto;
  color: var(--bn-text);
  font-size: 0.84rem;
  line-height: 1.3;
}

/* Step status badge — right-aligned pill */
.bn-step-status {
  flex: 0 0 auto;
  font-size: 0.70rem;
  font-weight: 800;
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
}

.bn-step-badge-active  { background: var(--bn-primary-soft); color: var(--bn-primary-dark); }
.bn-step-badge-done    { background: var(--bn-success-soft); color: var(--bn-success); }
.bn-step-badge-failed  { background: var(--bn-danger-soft);  color: var(--bn-danger); }
.bn-step-badge-skipped { background: #f0f4f7;               color: var(--bn-muted); }
.bn-step-badge-pending { background: #f0f4f7;               color: var(--bn-muted); }

/* Spinning icon for InProgress */
.bn-step-spin {
  display: inline-flex;
  animation: bn-spin 1.2s linear infinite;
}

@keyframes bn-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .bn-step-spin { animation: none; }
}

/* ── 19. Audit events feed ──────────────────────────────────── */
.bn-audit-events {
  background: #fff;
  border: 1px solid var(--bn-border);
  border-radius: 8px;
  padding: 12px 16px;
  max-height: 280px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.bn-events-label {
  display: block;
  font-size: 0.70rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bn-muted);
  margin-bottom: 8px;
}

.bn-event-item {
  display: flex;
  gap: 10px;
  padding: 4px 0;
  animation: bn-step-enter .3s ease-out both;
}

@media (prefers-reduced-motion: reduce) {
  .bn-event-item { animation: none; }
}

.bn-event-time {
  flex: 0 0 auto;
  font-size: 0.72rem;
  color: var(--bn-muted);
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}

.bn-event-msg {
  flex: 1 1 auto;
  font-size: 0.82rem;
  color: var(--bn-text);
  line-height: 1.4;
}

.bn-event-info    { border-left: 2px solid var(--bn-primary); padding-left: 8px; }
.bn-event-warning { border-left: 2px solid var(--bn-warning); padding-left: 8px; }
.bn-event-error   { border-left: 2px solid var(--bn-danger);  padding-left: 8px; }

/* ── 20. Audit results page ─────────────────────────────────── */

/* Page header: brand info left, export/share right */
.bn-results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.bn-results-header-info { flex: 1 1 auto; }

.bn-results-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 4px;
}

/* Section heading */
.bn-results-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--bn-heading);
}

/* ── Global score tile ───────────────────────────────────────── */
.bn-global-score-tile {
  background: #fff;
  border: 1px solid var(--bn-border);
  border-radius: 8px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 10px 24px rgba(20, 35, 60, 0.05);
}

.bn-global-score-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bn-muted);
  margin-bottom: 8px;
}

.bn-global-score-value {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 12px;
}

/* Score value color classes */
.bn-score-good { color: var(--bn-success); }
.bn-score-warn { color: var(--bn-warning); }
.bn-score-bad  { color: var(--bn-danger);  }

/* ── Bucket score tiles ──────────────────────────────────────── */
.bn-score-tile {
  height: 100%;
  box-sizing: border-box;
}

.bn-score-tile .bn-stat-value {
  font-size: 2.25rem;
}

.bn-score-progress {
  height: 5px;
  background: var(--bn-bg-alt);
  border-radius: 99px;
  overflow: hidden;
}

.bn-score-progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .4s ease;
}

.bn-score-bar-good { background: var(--bn-success); }
.bn-score-bar-warn { background: var(--bn-warning); }
.bn-score-bar-bad  { background: var(--bn-danger);  }

/* ── Priority fixes panel ────────────────────────────────────── */
.bn-priority-fixes {
  background: var(--bn-danger-soft);
  border: 1px solid rgba(181, 71, 71, 0.20);
  border-radius: 8px;
  padding: 18px 20px;
}

.bn-priority-fix-row {
  background: #fff;
  border: 1px solid rgba(181, 71, 71, 0.18);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 8px;
}

.bn-priority-fix-row:last-child { margin-bottom: 0; }

.bn-priority-fix-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--bn-heading);
}

.bn-priority-fix-rec {
  font-size: 0.82rem;
  color: var(--bn-muted);
  line-height: 1.45;
}

/* ── Severity badge pill ─────────────────────────────────────── */
.bn-severity-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

.bn-severity-critical { background: var(--bn-danger-soft); color: var(--bn-danger); }
.bn-severity-high     { background: var(--bn-danger-soft); color: var(--bn-danger); }
.bn-severity-medium   { background: #fffbeb;               color: var(--bn-warning); }
.bn-severity-low      { background: var(--bn-primary-soft); color: var(--bn-primary-dark); }

/* ── Issue expansion panels ──────────────────────────────────── */
.bn-issue-panels .mud-expand-panel {
  border: 1px solid var(--bn-border) !important;
  border-radius: 8px !important;
  margin-bottom: 8px !important;
  box-shadow: none !important;
}

.bn-issue-panels .mud-expand-panel-header {
  padding: 12px 16px;
}

.bn-issue-bucket-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--bn-heading);
}

/* ── Check rows ──────────────────────────────────────────────── */
.bn-check-row {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 0.84rem;
  border-left: 3px solid transparent;
}

.bn-check-passed {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  border-left-color: var(--bn-success);
  background: rgba(25, 135, 84, 0.03);
}

.bn-check-failed {
  border-left-color: var(--bn-danger);
  background: rgba(181, 71, 71, 0.03);
}

.bn-check-critical, .bn-check-high {
  border-left-color: var(--bn-danger);
}

.bn-check-medium {
  border-left-color: var(--bn-warning);
  background: rgba(245, 159, 0, 0.03);
}

.bn-check-icon { flex-shrink: 0; }
.bn-check-icon-pass { color: var(--bn-success); }
.bn-check-icon-fail { color: var(--bn-danger); }

.bn-check-label {
  flex: 1 1 auto;
  color: var(--bn-text);
}

.bn-check-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--bn-heading);
}

.bn-check-desc {
  margin: 0 0 4px 0;
  color: var(--bn-text);
  font-size: 0.84rem;
  line-height: 1.45;
}

.bn-check-rec {
  font-size: 0.82rem;
  color: var(--bn-muted);
  line-height: 1.45;
}

.bn-check-note {
  font-size: 0.72rem;
  color: var(--bn-muted);
}

/* ── Social media rows ───────────────────────────────────────── */
.bn-social-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 6px;
  border-left: 3px solid var(--bn-border);
}

.bn-social-active  { border-left-color: var(--bn-success); }
.bn-social-broken  { border-left-color: var(--bn-warning); background: rgba(245, 159, 0, 0.03); }
.bn-social-missing { border-left-color: var(--bn-border);  opacity: 0.75; }

.bn-social-name {
  flex: 1 1 auto;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--bn-text);
}

.bn-social-status-note {
  font-size: 0.76rem;
  color: var(--bn-muted);
}

/* ── Register prompt ─────────────────────────────────────────── */
.bn-register-prompt {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bn-primary-soft);
  border: 1px solid var(--bn-primary-line);
  border-radius: 8px;
  padding: 16px 20px;
  flex-wrap: wrap;
}

.bn-register-prompt-text { flex: 1 1 auto; }

.bn-register-prompt-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--bn-heading);
  margin-bottom: 2px;
}

.bn-register-prompt-body {
  font-size: 0.84rem;
  color: var(--bn-muted);
}

