/* ═══════════════════════════════════════════════════════════════════
   SEO Analysis Pro — Complete CSS
   Replicates shadcn/ui + Tailwind CSS design system
   ═══════════════════════════════════════════════════════════════════ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  tab-size: 4;
  font-feature-settings: normal;
  font-variation-settings: normal;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--foreground);
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 50%, #f1f5f9 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ─── CSS Custom Properties (Light Theme) ─── */
:root {
  --background: #ffffff;
  --foreground: #0f172a;
  --card: #ffffff;
  --card-foreground: #0f172a;
  --primary: #059669;
  --primary-foreground: #ffffff;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --border: #e2e8f0;
  --accent: #f1f5f9;
  --accent-foreground: #0f172a;
  --destructive: #ef4444;
  --destructive-foreground: #ffffff;
  --ring: #059669;
  --radius: 0.75rem;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

  /* Extended palette */
  --emerald-50: #ecfdf5;
  --emerald-100: #d1fae5;
  --emerald-200: #a7f3d0;
  --emerald-300: #6ee7b7;
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --emerald-800: #065f46;
  --emerald-900: #064e3b;
  --teal-600: #0d9488;

  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-200: #fde68a;
  --amber-300: #fcd34d;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-700: #b45309;
  --amber-800: #92400e;

  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-200: #fecaca;
  --red-300: #fca5a5;
  --red-400: #f87171;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-700: #b91c1c;
  --red-800: #991b1b;
  --red-900: #7f1d1d;

  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-300: #93c5fd;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;

  --purple-400: #a78bfa;
  --purple-700: #7c3aed;

  --orange-500: #f97316;
  --orange-600: #ea580c;

  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --slate-950: #020617;

  --green-50: #f0fdf4;
}

/* ─── Base Elements ─── */
a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img, svg {
  display: block;
  max-width: 100%;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
}

ul, ol {
  list-style: none;
}

table {
  border-collapse: collapse;
}

/* ─── Header ─── */
.header {
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  padding: 8px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--emerald-500), var(--teal-600));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-logo svg {
  width: 20px;
  height: 20px;
}

.header-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--foreground);
}

.header-subtitle {
  font-size: 13px;
  color: var(--muted-foreground);
}

.header-subtitle span {
  font-weight: 500;
  color: var(--foreground);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ─── Footer ─── */
.footer {
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin-top: auto;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 16px;
  text-align: center;
}

.footer-inner p {
  font-size: 12px;
  color: var(--muted-foreground);
}

/* ─── Main Content ─── */
.main-content {
  flex: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 16px;
  width: 100%;
}

.main-content.spaced {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ─── Card Component ─── */
.card {
  background: var(--card);
  color: var(--card-foreground);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-no-border {
  border: none;
}

.card-shadow-sm {
  box-shadow: var(--shadow-sm);
}

.card-shadow-lg {
  box-shadow: var(--shadow-lg);
}

.card-shadow-xl {
  box-shadow: var(--shadow-xl);
}

.card-header {
  padding: 20px 24px 16px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.card-title svg.no-color {
  color: inherit;
}

.card-description {
  font-size: 13px;
  color: var(--muted-foreground);
  margin-top: 4px;
}

.card-content {
  padding: 16px 24px 24px;
}

.card-content-compact {
  padding: 12px 24px 20px;
}

/* ─── Badge Component ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 9999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  transition: colors 0.2s;
}

.badge svg {
  width: 12px;
  height: 12px;
}

.badge-default {
  background: var(--primary);
  color: var(--primary-foreground);
}

.badge-destructive {
  background: var(--destructive);
  color: var(--destructive-foreground);
}

.badge-outline {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--foreground);
}

.badge-secondary {
  background: var(--muted);
  color: var(--muted-foreground);
}

.badge-success {
  background: var(--emerald-100);
  color: var(--emerald-800);
}

.badge-warning {
  background: var(--amber-100);
  color: var(--amber-800);
}

.badge-info {
  background: var(--blue-100);
  color: var(--blue-800);
}

.badge-emerald-outline {
  border-color: var(--emerald-300);
  color: var(--emerald-700);
}

.badge-amber-outline {
  border-color: var(--amber-300);
  color: var(--amber-700);
}

.badge-red-outline {
  border-color: var(--red-300);
  color: var(--red-700);
}

/* ─── Button Component ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  transition: all 0.2s;
  outline: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-default {
  background: linear-gradient(to right, var(--emerald-600), var(--teal-600));
  color: #fff;
  border: none;
}

.btn-default:hover:not(:disabled) {
  background: linear-gradient(to right, var(--emerald-700), #0f766e);
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
}

.btn-primary:hover:not(:disabled) {
  background: #047857;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--foreground);
}

.btn-outline:hover:not(:disabled) {
  background: var(--accent);
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--foreground);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--accent);
}

.btn-destructive {
  background: var(--destructive);
  color: var(--destructive-foreground);
  border: none;
}

.btn-destructive:hover:not(:disabled) {
  background: var(--red-600);
}

.btn-sm {
  padding: 4px 12px;
  font-size: 13px;
}

.btn-lg {
  padding: 12px 32px;
  font-size: 16px;
}

.btn-icon {
  padding: 8px;
  border-radius: 8px;
}

/* ─── Input Component ─── */
.input {
  display: flex;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--background);
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2);
}

.input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.input-lg {
  padding: 12px 16px;
  font-size: 16px;
  height: 48px;
}

.input-icon-left {
  position: relative;
}

.input-icon-left .input {
  padding-left: 40px;
}

.input-icon-left svg.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted-foreground);
  pointer-events: none;
}

/* ─── Progress Component ─── */
.progress {
  position: relative;
  height: 8px;
  width: 100%;
  overflow: hidden;
  border-radius: 9999px;
  background: var(--muted);
}

.progress-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.6s ease;
  background: var(--primary);
}

.progress-fill.emerald {
  background: var(--emerald-500);
}

.progress-fill.amber {
  background: var(--amber-500);
}

.progress-fill.red {
  background: var(--red-500);
}

.progress-sm {
  height: 6px;
}

.progress-xs {
  height: 4px;
}

/* ─── Separator ─── */
.separator {
  height: 1px;
  width: 100%;
  background: var(--border);
  margin: 0;
}

.separator-slate {
  background: var(--slate-700);
}

/* ─── Tabs ─── */
.tabs {
  width: 100%;
}

.tabs-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: 100%;
  height: auto;
  padding: 4px;
  background: var(--muted);
  border-radius: var(--radius);
  gap: 4px;
}

.tabs-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: calc(var(--radius) - 2px);
  border: none;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.tabs-trigger svg {
  width: 16px;
  height: 16px;
}

.tabs-trigger .badge {
  margin-left: auto;
}

.tabs-trigger:hover {
  color: var(--foreground);
}

.tabs-trigger.active {
  background: var(--background);
  color: var(--foreground);
  box-shadow: var(--shadow-sm);
}

.tabs-content {
  margin-top: 24px;
  display: none;
}

.tabs-content.active {
  display: block;
}

/* ─── Score Ring ─── */
.score-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.score-ring-svg {
  transform: rotate(-90deg);
}

.score-ring-bg {
  fill: none;
  stroke-width: 8;
}

.score-ring-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease-out;
}

.score-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-ring-value {
  font-size: 30px;
  font-weight: 700;
}

.score-ring-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
}

/* Score color classes */
.score-good .score-ring-value {
  color: var(--emerald-500);
}

.score-good .score-ring-fill {
  stroke: var(--emerald-500);
}

.score-good .score-ring-bg {
  stroke: var(--emerald-200);
}

.score-warning .score-ring-value {
  color: var(--amber-500);
}

.score-warning .score-ring-fill {
  stroke: var(--amber-500);
}

.score-warning .score-ring-bg {
  stroke: var(--amber-200);
}

.score-error .score-ring-value {
  color: var(--red-500);
}

.score-error .score-ring-fill {
  stroke: var(--red-500);
}

.score-error .score-ring-bg {
  stroke: var(--red-200);
}

/* Score ring small variant */
.score-ring-small .score-ring-value {
  font-size: 24px;
}

/* ─── Category Card ─── */
.category-card .card-header {
  padding-bottom: 12px;
}

.category-card .category-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-card .category-name {
  font-size: 15px;
  font-weight: 600;
}

.category-card .category-score {
  font-size: 20px;
  font-weight: 700;
}

.category-card .category-stats {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 4px;
}

.category-card .category-stats > span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.category-card .category-stats svg {
  width: 12px;
  height: 12px;
}

.category-card .category-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.category-item svg.status-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.category-item-label {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.category-item-detail {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 2px;
  line-height: 1.6;
}

/* ─── Expandable Issue ─── */
.issue-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.issue-card-header {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s;
  color: var(--foreground);
}

.issue-card-header:hover {
  background: rgba(241, 245, 249, 0.5);
}

.issue-card-header svg.severity-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.issue-card-body {
  flex: 1;
  min-width: 0;
}

.issue-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.issue-card-element {
  font-size: 14px;
  font-weight: 500;
}

.issue-card-current {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.issue-card-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.issue-card-page {
  font-size: 12px;
  color: var(--muted-foreground);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.issue-card-expand {
  padding: 0;
  border: none;
  background: none;
  color: var(--muted-foreground);
  cursor: pointer;
}

.issue-card-expand svg {
  width: 16px;
  height: 16px;
}

.issue-card-detail {
  padding: 12px 12px 12px 12px;
  display: none;
  border-top: 1px solid var(--border);
  background: rgba(241, 245, 249, 0.3);
}

.issue-card-detail.open {
  display: block;
}

.issue-card-detail-inner {
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.issue-detail-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.issue-detail-label svg {
  width: 12px;
  height: 12px;
}

.issue-detail-label.fix-label {
  color: var(--emerald-600);
}

.issue-detail-label.impact-label {
  color: var(--orange-600);
}

.issue-detail-text {
  font-size: 14px;
  line-height: 1.6;
}

.issue-detail-text-muted {
  color: var(--muted-foreground);
}

/* ─── Page Detail Card ─── */
.page-card {
  background: rgba(248, 250, 252, 0.5);
}

.page-card .card-content {
  padding-top: 16px;
  padding-bottom: 16px;
}

.page-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.page-card-info {
  min-width: 0;
  flex: 1;
}

.page-card-title {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-card-url {
  font-size: 12px;
  color: var(--muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-card-metrics {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.page-metric-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-metric-icon {
  width: 16px;
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
}

.page-metric-icon svg {
  width: 14px;
  height: 14px;
}

.page-metric-label {
  font-size: 12px;
  width: 80px;
  flex-shrink: 0;
}

.page-metric-bar {
  flex: 1;
  height: 6px;
  border-radius: 9999px;
  background: var(--muted);
  overflow: hidden;
}

.page-metric-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.6s ease;
}

.page-metric-value {
  font-size: 12px;
  font-weight: 500;
  width: 32px;
  text-align: right;
}

.page-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 16px;
  font-size: 12px;
  color: var(--muted-foreground);
}

/* Page issues details/summary */
.page-issues-details {
  margin-top: 8px;
}

.page-issues-toggle {
  font-size: 12px;
  color: var(--muted-foreground);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  transition: color 0.15s;
}

.page-issues-toggle:hover {
  color: var(--foreground);
}

.page-issues-toggle svg {
  width: 12px;
  height: 12px;
  transition: transform 0.2s;
}

.page-issues-toggle.open svg {
  transform: rotate(90deg);
}

.page-issues-list {
  margin-top: 8px;
  padding-left: 16px;
  display: none;
  flex-direction: column;
  gap: 6px;
}

.page-issues-list.open {
  display: flex;
}

.page-issue-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.page-issue-item svg.status-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.page-issue-item p {
  font-size: 12px;
  line-height: 1.5;
}

.page-issues-more {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 4px;
}

/* ─── Crawl Summary Cards ─── */
.crawl-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.crawl-stat-card {
  padding: 16px;
  border-radius: 8px;
  text-align: center;
}

.crawl-stat-card.emerald {
  background: var(--emerald-50);
  border: 1px solid var(--emerald-200);
}

.crawl-stat-card.emerald .crawl-stat-value {
  color: var(--emerald-700);
}

.crawl-stat-card.blue {
  background: var(--blue-50);
  border: 1px solid var(--blue-200);
}

.crawl-stat-card.blue .crawl-stat-value {
  color: var(--blue-700);
}

.crawl-stat-card.amber {
  background: var(--amber-50);
  border: 1px solid var(--amber-200);
}

.crawl-stat-card.amber .crawl-stat-value {
  color: var(--amber-700);
}

.crawl-stat-card.red {
  background: var(--red-50);
  border: 1px solid var(--red-200);
}

.crawl-stat-card.red .crawl-stat-value {
  color: var(--red-700);
}

.crawl-stat-value {
  font-size: 28px;
  font-weight: 700;
}

.crawl-stat-label {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 4px;
}

.crawl-info {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 12px;
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.crawl-info svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ─── Summary Card (dark gradient) ─── */
.summary-card {
  background: linear-gradient(to right, var(--slate-900), var(--slate-800));
  color: #fff;
  overflow: hidden;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  text-align: center;
}

.summary-value {
  font-size: 36px;
  font-weight: 700;
}

.summary-value.emerald { color: var(--emerald-400); }
.summary-value.amber { color: var(--amber-400); }
.summary-value.blue { color: var(--blue-400); }
.summary-value.purple { color: var(--purple-400); }

.summary-label {
  font-size: 14px;
  color: var(--slate-300);
  margin-top: 4px;
}

.summary-footer {
  margin-top: 24px;
  text-align: center;
}

.summary-footer p {
  font-size: 14px;
  color: var(--slate-400);
}

/* ─── Feature Cards (Input Form) ─── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  text-align: center;
}

.feature-card {
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
}

.feature-card-icon {
  color: var(--muted-foreground);
  margin: 0 auto;
  width: fit-content;
}

.feature-card-icon svg {
  width: 20px;
  height: 20px;
}

.feature-card-label {
  font-size: 14px;
  font-weight: 500;
  margin-top: 8px;
}

.feature-card-desc {
  font-size: 12px;
  color: var(--muted-foreground);
}

/* ─── Loading State ─── */
.loading-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.loading-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loading-spinner {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto;
}

.loading-spinner-border {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid rgba(5, 150, 105, 0.2);
}

.loading-spinner-fill {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid var(--primary);
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

.loading-spinner-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner-icon svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.loading-title {
  font-size: 18px;
  font-weight: 700;
}

.loading-url {
  font-size: 14px;
  color: var(--muted-foreground);
  margin-top: 4px;
}

.loading-message {
  font-size: 12px;
  color: var(--muted-foreground);
  max-width: 384px;
  margin: 0 auto;
}

/* ─── Input Form State ─── */
.input-form-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
}

.input-form-inner {
  width: 100%;
  max-width: 672px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.input-form-hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.input-form-icon {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--emerald-500), var(--teal-600));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  margin: 0 auto;
}

.input-form-icon svg {
  width: 40px;
  height: 40px;
  color: #fff;
}

.input-form-heading {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.input-form-desc {
  color: var(--muted-foreground);
  margin-top: 8px;
  max-width: 448px;
  margin-left: auto;
  margin-right: auto;
}

.input-form-card {
  border: none;
  box-shadow: var(--shadow-xl);
}

.input-form-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.error-box {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  background: var(--red-50);
  border: 1px solid var(--red-200);
}

.error-box p {
  font-size: 14px;
  color: var(--red-700);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.error-box svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ─── Issues Filter Badges ─── */
.issues-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.issues-list {
  max-height: 600px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

/* ─── Utility Classes ─── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.w-full { width: 100%; }
.min-w-0 { min-width: 0; }
.shrink-0 { flex-shrink: 0; }
.text-center { text-align: center; }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 18px; }
.text-2xl { font-size: 24px; }
.text-3xl { font-size: 30px; }
.text-4xl { font-size: 36px; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.tracking-tight { letter-spacing: -0.025em; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hidden { display: none; }
.relative { position: relative; }
.absolute { position: absolute; }
.inset-0 { inset: 0; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.ml-auto { margin-left: auto; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }
.pt-4 { padding-top: 16px; }
.pb-4 { padding-bottom: 16px; }
.pt-8 { padding-top: 32px; }
.pb-8 { padding-bottom: 32px; }
.space-y-1 > * + * { margin-top: 4px; }
.space-y-2 > * + * { margin-top: 8px; }
.space-y-3 > * + * { margin-top: 12px; }
.space-y-4 > * + * { margin-top: 16px; }
.space-y-6 > * + * { margin-top: 24px; }
.space-y-8 > * + * { margin-top: 32px; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }

/* ─── Grid Utilities ─── */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ─── Responsive Breakpoints ─── */
@media (min-width: 640px) {
  .sm\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
  .sm\:inline { display: inline; }
  .sm\:flex-row { flex-direction: row; }
  .sm\:items-center { align-items: center; }
  .sm\:hidden { display: none; }
  .sm\:flex-col { flex-direction: column; }
  .input-form-row {
    flex-direction: row;
  }
}

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
  .crawl-summary-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .summary-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .main-content {
    padding: 32px 32px;
  }
  .header-inner {
    padding: 16px 32px;
  }
  .footer-inner {
    padding: 16px 32px;
  }
}

@media (min-width: 1280px) {
  .xl\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ─── Installer-Specific Styles ─── */
.installer-card {
  max-width: 480px;
  margin: 0 auto;
}

.installer-card .card-content {
  padding: 32px 24px;
}

.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.3s;
}

.step-dot.active {
  background: var(--primary);
  transform: scale(1.2);
}

.step-dot.completed {
  background: var(--emerald-500);
}

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 14px;
}

.check-item.pass {
  color: var(--emerald-700);
}

.check-item.fail {
  color: var(--red-700);
}

.check-item-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ─── Custom Scrollbar ─── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--slate-300);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--slate-400);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--slate-300) transparent;
}

/* ─── Tooltip ─── */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--primary-foreground);
  background: var(--foreground);
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 100;
}

.tooltip:hover::after {
  opacity: 1;
}

/* ─── Section heading ─── */
.section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.section-heading svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.section-heading h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

/* ─── Animation keyframes ─── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* ─── Score badges in category rows ─── */
.score-badges-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.score-badges-row .badge {
  font-size: 11px;
}

/* ─── Header responsive ─── */
@media (max-width: 639px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-right {
    width: 100%;
  }

  .input-form-heading {
    font-size: 24px;
  }
}

/* ─── Focus visible for accessibility ─── */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ─── Status color utilities ─── */
.text-emerald-500 { color: var(--emerald-500); }
.text-emerald-600 { color: var(--emerald-600); }
.text-emerald-700 { color: var(--emerald-700); }
.text-amber-500 { color: var(--amber-500); }
.text-amber-600 { color: var(--amber-600); }
.text-amber-700 { color: var(--amber-700); }
.text-red-500 { color: var(--red-500); }
.text-red-600 { color: var(--red-600); }
.text-red-700 { color: var(--red-700); }
.text-blue-500 { color: var(--blue-500); }
.text-blue-700 { color: var(--blue-700); }
.text-orange-500 { color: var(--orange-500); }
.text-orange-600 { color: var(--orange-600); }
.text-muted-foreground { color: var(--muted-foreground); }
.text-foreground { color: var(--foreground); }

.bg-emerald-500 { background-color: var(--emerald-500); }
.bg-amber-500 { background-color: var(--amber-500); }
.bg-red-500 { background-color: var(--red-500); }
.bg-blue-500 { background-color: var(--blue-500); }

/* #app should handle all rendering */
#app {
  width: 100%;
}

/* ─── Deep Crawl: step-by-step progress ─── */
.loading-inner-wide {
  max-width: 560px;
  width: 100%;
}

.crawl-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.crawl-step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted-foreground);
  background: var(--card);
}

.crawl-step-icon { display: flex; align-items: center; }

.crawl-step-active {
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.crawl-step-done {
  border-color: var(--emerald-500);
  color: var(--emerald-600);
}

.progress-loading {
  width: 100%;
  margin-top: 8px;
}

.crawl-progress-stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--muted-foreground);
}

.crawl-progress-stats span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.loading-message-muted {
  opacity: 0.7;
}

/* ─── Desktop / Mobile device switch ─── */
.device-switch {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.device-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.device-switch-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--accent);
}

/* ─── Grouped category cards (4-pillar SEO score) ─── */
.tabs-list-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (min-width: 768px) {
  .tabs-list-4 { grid-template-columns: repeat(4, 1fr); }
}

.grouped-item {
  align-items: flex-start;
}

.category-item-recommendation {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.5;
}

.category-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--accent);
  font-size: 11px;
  color: var(--muted-foreground);
}

/* ─── Export PDF section ─── */
.export-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}

.export-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}

.export-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
