/* ═══════════════════════════════════════════════════════
   WMN Checker — Amber Noir Design System
   "Apple Precision meets Blade Runner Atmosphere"
   ═══════════════════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  /* Backgrounds */
  --void: #09090b;
  --base: #18181b;
  --surface: #27272a;
  --elevated: #3f3f46;

  /* Amber Spectrum */
  --amber-glow: #fef3c7;
  --amber-light: #fcd34d;
  --amber: #f59e0b;
  --amber-deep: #b45309;

  /* Semantic */
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #6366f1;

  /* Text */
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;

  /* Glass */
  --glass: rgba(39, 39, 42, 0.7);
  --glass-border: rgba(250, 204, 21, 0.1);
  --glass-glow: rgba(245, 158, 11, 0.15);

  /* Atmospherics */
  --scan-line: rgba(245, 158, 11, 0.03);

  /* Fonts */
  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--void);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Scan Lines Overlay ── */
.atmosphere::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    var(--scan-line) 2px,
    var(--scan-line) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ── Typography ── */
.text-hero {
  font-size: 48px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 500;
}

.text-title {
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 500;
}

.text-heading {
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 500;
}

.text-body {
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
}

.text-caption {
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0.01em;
  font-weight: 400;
  color: var(--text-secondary);
}

.text-mono {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
}

/* ── Layout ── */
.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, rgba(9, 9, 11, 0.95) 0%, rgba(9, 9, 11, 0.8) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(245, 158, 11, 0.06);
  padding: 16px 0;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--amber) 0%, var(--amber-deep) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--void);
}

.logo-text {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.logo-text span {
  color: var(--amber);
}

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

.header-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.header-link:hover {
  color: var(--amber);
  background: rgba(245, 158, 11, 0.08);
}

/* ── Hero Section ── */
.hero {
  position: relative;
  padding: 80px 0 48px;
  text-align: center;
}

.hero::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(
    ellipse at center,
    rgba(245, 158, 11, 0.12) 0%,
    rgba(245, 158, 11, 0.04) 40%,
    transparent 70%
  );
  filter: blur(60px);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin-bottom: 12px;
}

.hero h1 .amber {
  color: var(--amber);
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 18px;
  margin-bottom: 40px;
}

/* ── Search ── */
.search-wrapper {
  position: relative;
  max-width: 640px;
  margin: 0 auto 32px;
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--amber);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.search-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  animation: amberPulse 2s infinite;
}

.search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid rgba(245, 158, 11, 0.1);
  border-radius: 14px;
  padding: 18px 20px 18px 44px;
  font-size: 16px;
  font-family: var(--font-display);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow:
    0 0 0 4px rgba(245, 158, 11, 0.1),
    0 0 20px rgba(245, 158, 11, 0.08);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-hint {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--elevated);
  color: var(--text-muted);
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  pointer-events: none;
}

@keyframes amberPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
}

/* ── Category Pills ── */
.pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 900px;
  margin: 0 auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--elevated);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.pill:hover {
  border-color: var(--amber);
  color: var(--text-primary);
}

.pill.active {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--void);
  font-weight: 500;
}

.pill-count {
  font-size: 11px;
  opacity: 0.7;
}

/* ── Stats Bar ── */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 20px 0;
  margin: 32px 0;
  border-top: 1px solid rgba(245, 158, 11, 0.06);
  border-bottom: 1px solid rgba(245, 158, 11, 0.06);
}

.stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.stat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.stat-dot.verified { background: var(--success); }
.stat-dot.fp-risk { background: var(--warning); }
.stat-dot.broken { background: var(--danger); }
.stat-dot.cloudflare { background: var(--info); }

.stat-value {
  font-weight: 600;
  color: var(--text-primary);
}

/* ── View Toggle ── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.result-count {
  font-size: 14px;
  color: var(--text-secondary);
}

.result-count strong {
  color: var(--text-primary);
}

.view-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-btn {
  background: none;
  border: 1px solid var(--elevated);
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-family: var(--font-display);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.view-btn:hover {
  border-color: var(--amber);
  color: var(--text-primary);
}

.view-btn.active {
  border-color: var(--amber);
  color: var(--amber);
  background: rgba(245, 158, 11, 0.08);
}

/* ── Status Filter Buttons ── */
.status-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.status-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--elevated);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all 0.2s ease;
}

.status-btn:hover, .status-btn.active {
  border-color: currentColor;
}

.status-btn.active {
  font-weight: 500;
}

.status-btn[data-status="verified"] { --btn-color: var(--success); }
.status-btn[data-status="fp_risk"] { --btn-color: var(--warning); }
.status-btn[data-status="cloudflare"] { --btn-color: var(--info); }
.status-btn[data-status="broken"] { --btn-color: var(--danger); }

.status-btn.active[data-status="verified"] { color: var(--success); background: rgba(34, 197, 94, 0.08); }
.status-btn.active[data-status="fp_risk"] { color: var(--warning); background: rgba(245, 158, 11, 0.08); }
.status-btn.active[data-status="cloudflare"] { color: var(--info); background: rgba(99, 102, 241, 0.08); }
.status-btn.active[data-status="broken"] { color: var(--danger); background: rgba(239, 68, 68, 0.08); }

/* ── Results Grid ── */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ── Card ── */
.card {
  background: linear-gradient(135deg, rgba(39, 39, 42, 0.8) 0%, rgba(24, 24, 27, 0.9) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(245, 158, 11, 0.06);
  border-radius: 14px;
  padding: 20px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.02),
    0 4px 24px rgba(0, 0, 0, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: rgba(245, 158, 11, 0.18);
  box-shadow:
    0 0 0 1px rgba(245, 158, 11, 0.08),
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 40px rgba(245, 158, 11, 0.06);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.card-icon img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.card-title {
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-url {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-top: 2px;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.card-category {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: capitalize;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-verified {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.badge-fp_risk {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.badge-broken, .badge-changed {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.badge-cloudflare {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

/* ── Card Actions ── */
.card-actions {
  display: flex;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  border: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--amber);
  color: var(--void);
}

.btn-primary:hover {
  background: var(--amber-light);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--elevated);
}

.btn-secondary:hover {
  border-color: var(--amber);
  color: var(--amber);
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

/* ── Table View ── */
.results-table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.06);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.results-table th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: rgba(39, 39, 42, 0.5);
  border-bottom: 1px solid rgba(245, 158, 11, 0.06);
  white-space: nowrap;
}

.results-table td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
}

.results-table tr:hover td {
  background: rgba(245, 158, 11, 0.03);
}

.results-table .site-name {
  color: var(--text-primary);
  font-weight: 500;
}

.results-table .site-url {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.results-table a {
  color: var(--amber);
  text-decoration: none;
}

.results-table a:hover {
  text-decoration: underline;
}

/* ── Footer ── */
.footer {
  margin-top: 64px;
  padding: 32px 0;
  border-top: 1px solid rgba(245, 158, 11, 0.06);
  text-align: center;
}

.footer-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.footer-text {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-text a {
  color: var(--amber);
  text-decoration: none;
}

.footer-text a:hover {
  text-decoration: underline;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state-text {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.empty-state-hint {
  font-size: 14px;
}

/* ── Loading ── */
.loading {
  display: flex;
  justify-content: center;
  padding: 40px;
}

.loading-dots {
  display: flex;
  gap: 6px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  animation: loadBounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(2) { animation-delay: 0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0.32s; }

@keyframes loadBounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

/* ── Stagger Animation ── */
.card-enter {
  animation: fadeUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .text-hero {
    font-size: 32px;
  }

  .hero {
    padding: 48px 0 32px;
  }

  .hero-subtitle {
    font-size: 15px;
  }

  .stats-bar {
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
  }

  .results-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-hint {
    display: none;
  }

  .header-link.hide-mobile {
    display: none;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .pills {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .card {
    padding: 16px;
  }

  .footer-actions {
    flex-direction: column;
    align-items: center;
  }
}

/* ═══════════════════════════════════════════════════════
   CHECKER MODE STYLES
   ═══════════════════════════════════════════════════════ */

/* ── Search Button (Check CTA) ── */
.search-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-btn {
  background: var(--amber);
  color: var(--void);
  border: none;
  border-radius: 14px;
  padding: 18px 28px;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.search-btn:hover:not(:disabled) {
  background: var(--amber-light);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.search-btn:active:not(:disabled) {
  transform: scale(0.97);
}

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

/* ── Progress Bar ── */
.check-progress {
  margin-bottom: 24px;
}

.check-progress-track {
  width: 100%;
  height: 4px;
  background: var(--surface);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}

.check-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--amber-deep), var(--amber), var(--amber-light));
  border-radius: 2px;
  transition: width 0.3s ease-out;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.check-stats-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

/* ── Found result stat dots ── */
.stat-dot.found { background: var(--success); }
.stat-dot.not-found { background: var(--text-muted); }
.stat-dot.error-dot { background: var(--danger); }

/* ── Found Text ── */
.text-found {
  color: var(--success);
}

/* ── Card: Found variant (green glow) ── */
.card-found {
  border-color: rgba(34, 197, 94, 0.2) !important;
  animation: fadeUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) both, greenGlow 0.6s ease-out 0.35s both;
}

.card-found:hover {
  border-color: rgba(34, 197, 94, 0.4) !important;
  box-shadow:
    0 0 0 1px rgba(34, 197, 94, 0.15),
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 40px rgba(34, 197, 94, 0.1) !important;
}

@keyframes greenGlow {
  from {
    box-shadow:
      0 0 0 1px rgba(34, 197, 94, 0.3),
      0 0 30px rgba(34, 197, 94, 0.2),
      0 4px 24px rgba(0, 0, 0, 0.3);
  }
  to {
    box-shadow:
      0 0 0 1px rgba(34, 197, 94, 0.1),
      0 0 15px rgba(34, 197, 94, 0.08),
      0 4px 24px rgba(0, 0, 0, 0.3);
  }
}

/* ── Check Result Badges ── */
.badge-check-found {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}

.badge-check-not_found {
  background: rgba(82, 82, 91, 0.2);
  color: var(--text-muted);
}

.badge-check-cloudflare {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

.badge-check-timeout,
.badge-check-error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* ── Table: found row highlight ── */
.row-found td {
  background: rgba(34, 197, 94, 0.03);
}

.row-found .site-name {
  color: var(--success);
}

/* ── Site filter input (catalog toolbar) ── */
.site-filter-input {
  background: var(--surface);
  border: 1px solid var(--elevated);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-family: var(--font-display);
  color: var(--text-primary);
  width: 160px;
  transition: border-color 0.2s ease;
}

.site-filter-input:focus {
  outline: none;
  border-color: var(--amber);
}

.site-filter-input::placeholder {
  color: var(--text-muted);
}

/* ── Pulse active (only when not checking) ── */
.pulse-active {
  animation: amberPulse 2s infinite;
}

/* ── Copy success flash ── */
.copy-flash {
  color: var(--success) !important;
  transition: color 0.15s ease;
}

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

::-webkit-scrollbar-track {
  background: var(--void);
}

::-webkit-scrollbar-thumb {
  background: var(--elevated);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
