/* SEO Audit Report — Design Framework */
/* Aesthetic: Clean SaaS utility. Light, functional, data-focused. */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

/* ─── Tokens ─── */
:root {
  /* Surfaces */
  --bg:           #ffffff;
  --bg-sidebar:   #2c3038;
  --bg-subtle:    #f4f5f7;
  --bg-card:      #ffffff;
  --bg-code:      #f0f2f5;
  --bg-hover:     #eaecf0;
  --bg-badge:     #f0f2f5;

  /* Borders */
  --border:       #dfe1e6;
  --border-light: #ebecf0;

  /* Text */
  --text-primary:   #111111;
  --text-secondary: #222222;
  --text-muted:     #555555;
  --text-inverse:   #ffffff;

  /* Accent — muted steel blue */
  --accent:         #4a6fa5;
  --accent-hover:   #3d5f91;
  --accent-light:   #e8eef6;
  --accent-bg:      #f2f5fa;

  /* Status */
  --critical:       #d63031;
  --critical-bg:    #fef2f2;
  --critical-border:#fca5a5;
  --high:           #e67e22;
  --high-bg:        #fffbeb;
  --high-border:    #fcd34d;
  --medium:         #2980b9;
  --medium-bg:      #eff6ff;
  --medium-border:  #93c5fd;
  --low:            #7f8c8d;
  --low-bg:         #f8f9fa;
  --low-border:     #d1d5db;
  --pass:           #27ae60;
  --pass-bg:        #f0fdf4;
  --pass-border:    #86efac;
  --fail:           #d63031;
  --fail-bg:        #fef2f2;

  /* Score gauge colors */
  --score-critical: #d63031;
  --score-poor:     #e67e22;
  --score-fair:     #f1c40f;
  --score-good:     #27ae60;
  --score-great:    #1e8449;

  /* Layout */
  --sidebar-w:    260px;
  --header-h:     64px;
  --radius:       6px;
  --radius-lg:    10px;

  /* Type */
  --font-body:  'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:  'DM Mono', 'SF Mono', 'Menlo', monospace;
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 18.5px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.25s ease;
  color: #c8cdd3;
}

.sidebar-brand {
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand-logo {
  max-width: 180px;
  height: auto;
  margin-bottom: 12px;
}

.sidebar-brand-seal {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff;
  padding: 1px;
  display: block;
  margin-bottom: 12px;
}

.sidebar-brand-seal img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
}

.sidebar-brand-client {
  margin: 14px 0 10px;
}

.sidebar-brand-client img {
  display: block;
  width: 100%;
  max-width: 200px;
  height: auto;
}

.sidebar-brand-byline {
  font-size: 11px;
  color: #6b7280;
  margin-top: 8px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.sidebar-brand h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #f0f1f3;
  line-height: 1.3;
}

.sidebar-brand p {
  font-size: 12px;
  color: #8b919a;
  margin-top: 2px;
}

.sidebar-score {
  padding: 16px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-score-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #8b919a;
  margin-bottom: 8px;
}

.sidebar-score-value {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
}

.sidebar-score-bar {
  height: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}

.sidebar-score-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s ease;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.sidebar-nav-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #6b7280;
  padding: 8px 22px 6px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 22px;
  color: #9ca3af;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 400;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
}

.sidebar-nav a:hover {
  background: rgba(255,255,255,0.06);
  color: #e5e7eb;
}

.sidebar-nav a.active {
  background: rgba(74,111,165,0.15);
  color: #93b4e0;
  font-weight: 500;
  border-left-color: #93b4e0;
}

.sidebar-nav a .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.6;
}

.sidebar-nav a.active .nav-icon {
  opacity: 1;
}

.sidebar-nav a .nav-score {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.08);
  color: #8b919a;
}

.sidebar-nav a.active .nav-score {
  background: rgba(147,180,224,0.2);
  color: #93b4e0;
}

.sidebar-footer {
  padding: 16px 22px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  color: #6b7280;
}

/* ─── Mobile sidebar toggle ─── */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-secondary);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 90;
}

/* ─── Main Content ─── */
.content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
}

.page-header {
  padding: 32px 48px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.page-header .subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 400;
}

.page-body {
  padding: 32px 48px 64px;
  max-width: 1100px;
}

/* ─── Score Badge (header) ─── */
.score-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.score-badge small {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.7;
}

.score-badge.score-critical { background: var(--critical-bg); color: var(--critical); }
.score-badge.score-poor     { background: var(--high-bg);     color: var(--high); }
.score-badge.score-fair     { background: var(--medium-bg);   color: var(--medium); }
.score-badge.score-good     { background: var(--pass-bg);     color: var(--pass); }

/* ─── Section ─── */
.section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.section-intro {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.7;
}

/* ─── Cards ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ─── Score Grid ─── */
.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.score-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.score-card-label {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-weight: 500;
}

.score-card-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  margin-bottom: 8px;
}

.score-card-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.score-card-fill {
  height: 100%;
  border-radius: 2px;
}

.score-card-status {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 8px;
}

/* ─── Tables ─── */
.table-wrap {
  overflow-x: auto;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

thead {
  background: var(--bg-subtle);
}

th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: top;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover {
  background: var(--accent-bg);
}

/* ─── Priority / Status Badges ─── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge-critical { background: var(--critical-bg); color: var(--critical); border: 1px solid var(--critical-border); }
.badge-high     { background: var(--high-bg);     color: var(--high);     border: 1px solid var(--high-border); }
.badge-medium   { background: var(--medium-bg);   color: var(--medium);   border: 1px solid var(--medium-border); }
.badge-low      { background: var(--low-bg);      color: var(--low);      border: 1px solid var(--low-border); }
.badge-pass     { background: var(--pass-bg);     color: var(--pass);     border: 1px solid var(--pass-border); }
.badge-fail     { background: var(--fail-bg);     color: var(--fail);     border: 1px solid var(--critical-border); }
.badge-info     { background: var(--medium-bg);   color: var(--medium);   border: 1px solid var(--medium-border); }

/* ─── Finding Blocks ─── */
.finding {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.finding-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-subtle);
  cursor: pointer;
  user-select: none;
}

.finding-header:hover {
  background: var(--bg-hover);
}

.finding-id {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  flex-shrink: 0;
}

.finding-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

.finding-chevron {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.finding.open .finding-chevron {
  transform: rotate(90deg);
}

.finding-body {
  padding: 16px;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-light);
  display: none;
}

.finding.open .finding-body {
  display: block;
}

.finding-body p {
  margin-bottom: 12px;
}

.finding-body p:last-child {
  margin-bottom: 0;
}

.finding-body ol,
.finding-body ul {
  padding-left: 24px;
  margin-bottom: 12px;
}

.finding-critical { border-left: 3px solid var(--critical); }
.finding-high     { border-left: 3px solid var(--high); }
.finding-medium   { border-left: 3px solid var(--medium); }
.finding-low      { border-left: 3px solid var(--low); }

/* Done state — overrides any priority color */
.finding-done {
  border-left: 3px solid var(--pass) !important;
  background: var(--pass-bg);
}
.finding-done .finding-header {
  background: var(--pass-bg);
  color: var(--pass);
}
.finding-done .finding-header:hover {
  background: #dcfce7;
}
.finding-done .finding-id,
.finding-done .finding-title {
  color: #166534;
}
.finding-done .finding-title {
  text-decoration: line-through;
  text-decoration-color: rgba(22,101,52,0.4);
}
.finding-done .finding-title::before {
  content: "✓ ";
  color: var(--pass);
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
  margin-right: 4px;
}
.finding-done .finding-body {
  background: #fff;
  color: var(--text-secondary);
}
.badge-done {
  background: var(--pass-bg);
  color: var(--pass);
  border: 1px solid var(--pass-border);
}

/* ─── Code Blocks ─── */
.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  margin: 12px 0;
  white-space: pre;
  color: var(--text-primary);
}

.code-inline {
  background: var(--bg-code);
  border: 1px solid var(--border-light);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent);
}

/* ─── Callout Boxes ─── */
.callout {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin: 16px 0;
  font-size: 1rem;
  line-height: 1.6;
}

.callout-title {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 13px;
}

.callout-critical { background: var(--critical-bg); border: 1px solid var(--critical-border); color: #991b1b; }
.callout-warning  { background: var(--high-bg);     border: 1px solid var(--high-border);     color: #92400e; }
.callout-info     { background: var(--medium-bg);   border: 1px solid var(--medium-border);   color: #1e40af; }
.callout-success  { background: var(--pass-bg);     border: 1px solid var(--pass-border);     color: #166534; }

/* ─── Image / Screenshot ─── */
.screenshot {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 16px 0;
}

.screenshot img {
  width: 100%;
  height: auto;
  display: block;
}

.screenshot-caption {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-light);
}

.screenshot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}

/* ─── Roadmap / Timeline ─── */
.roadmap {
  margin: 20px 0;
}

.roadmap-phase {
  position: relative;
  padding-left: 28px;
  padding-bottom: 24px;
  border-left: 2px solid var(--border);
}

.roadmap-phase:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.roadmap-dot {
  position: absolute;
  left: -7px;
  top: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.roadmap-phase-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.roadmap-phase-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.roadmap-phase-items {
  list-style: none;
  font-size: 13px;
  color: var(--text-secondary);
}

.roadmap-phase-items li {
  padding: 3px 0;
  padding-left: 16px;
  position: relative;
}

.roadmap-phase-items li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
}

/* ─── Gauge (circular) ─── */
.gauge {
  width: 100px;
  height: 100px;
  position: relative;
}

.gauge svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 6;
}

.gauge-fill {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.gauge-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
}

/* ─── Lists ─── */
.check-list {
  list-style: none;
  font-size: 1rem;
}

.check-list li {
  padding: 6px 0 6px 24px;
  position: relative;
  color: var(--text-secondary);
}

.check-list li::before {
  position: absolute;
  left: 0;
  font-size: 14px;
}

.check-list li.pass::before { content: '✓'; color: var(--pass); font-weight: 700; }
.check-list li.fail::before { content: '✗'; color: var(--fail); font-weight: 700; }
.check-list li.warn::before { content: '!'; color: var(--high); font-weight: 700; }

/* ─── Utility ─── */
.text-critical { color: var(--critical) !important; }
.text-high     { color: var(--high) !important; }
.text-medium   { color: var(--medium) !important; }
.text-pass     { color: var(--pass) !important; }
.text-muted    { color: var(--text-muted) !important; }
.text-mono     { font-family: var(--font-mono); }
.font-semibold { font-weight: 600; }
.mt-0  { margin-top: 0; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.flex { display: flex; }
.items-center { align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-toggle {
    display: flex;
  }
  .sidebar-overlay.open {
    display: block;
  }
  .content {
    margin-left: 0;
  }
  .page-header {
    padding: 24px 24px 20px;
    padding-top: 64px;
  }
  .page-body {
    padding: 24px 24px 48px;
  }
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  .screenshot-grid {
    grid-template-columns: 1fr;
  }
  .score-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

@media (max-width: 640px) {
  .page-header {
    flex-direction: column;
  }
  .score-grid {
    grid-template-columns: 1fr 1fr;
  }
  table {
    font-size: 12px;
  }
  th, td {
    padding: 8px 10px;
  }
}

/* ─── Hidden nav items ─── */
.sidebar-nav a.nav-hidden { display: none; }

/* ─── Client view: hide recommendations, quick fixes, roadmaps ─── */
/* Add class="client-view" to <body> to activate */
body.client-view .recs { display: none !important; }
body.client-view .finding-body .callout { display: none !important; }

/* ─── Print ─── */
@media print {
  .sidebar, .sidebar-toggle, .sidebar-overlay { display: none; }
  .content { margin-left: 0; }
  .page-header { padding: 16px 0; }
  .page-body { padding: 16px 0; }
  .finding-body { display: block !important; }
}
