/* BreachClaw — Dark-first theme matching openclaw.ai */
/* Colors sourced directly from openclaw.ai CSS variables */

/* Clash Display (OpenClaw display font) isn't on Google Fonts;
   Plus Jakarta Sans is the closest geometric-humanist match available */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Backgrounds — exact OpenClaw values */
  --bg-primary:   #050810;
  --bg-secondary: #0a0f1a;
  --bg-card:      rgba(10, 15, 26, 0.8);
  --bg-elevated:  #111827;

  /* Text — OpenClaw blue-tinted palette */
  --text-primary:   #f0f4ff;
  --text-secondary: #8892b0;
  --text-muted:     #5a6480;

  /* Accent — OpenClaw coral (--coral-bright) */
  --accent:       #ff4d4d;
  --accent-hover: #e63946;
  --accent-dark:  #991b1b;

  /* Secondary accent — OpenClaw teal (--cyan-bright) */
  --teal:         #00e5cc;
  --teal-mid:     #14b8a6;

  /* Risk levels */
  --risk-critical: #ff4d4d;
  --risk-high:     #f97316;
  --risk-medium:   #eab308;
  --risk-low:      #3b82f6;

  /* Borders */
  --border:        rgba(136, 146, 176, 0.15);
  --border-accent: rgba(255, 77, 77, 0.3);

  /* Shadows */
  --shadow-accent-soft:   rgba(255, 77, 77, 0.15);
  --shadow-accent-mid:    rgba(255, 77, 77, 0.25);
}

[data-theme="light"] {
  --bg-primary:   #ffffff;
  --bg-secondary: #f3f4f6;
  --bg-card:      #ffffff;
  --bg-elevated:  #e5e7eb;
  --text-primary:   #111827;
  --text-secondary: #6b7280;
  --text-muted:     #9ca3af;
  --accent:       #e63946;
  --accent-hover: #ff4d4d;
  --border:        #e5e7eb;
  --border-accent: rgba(230, 57, 70, 0.3);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  /* Satoshi (OpenClaw body font) ≈ Plus Jakarta Sans */
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  line-height: 1.6;
  /* Nebula background — matches OpenClaw's subtle radial glow */
  background-image:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(255, 77, 77, 0.10), transparent 50%),
    radial-gradient(ellipse 60% 60% at 80% 30%, rgba(0, 229, 204, 0.06), transparent 50%),
    radial-gradient(ellipse 90% 70% at 50% 90%, rgba(255, 77, 77, 0.05), transparent 50%);
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ---- Theme toggle — fixed top-right, OpenClaw style ---- */

.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-secondary);
  backdrop-filter: blur(12px);
  transition: border-color 0.25s ease, color 0.25s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

/* ---- Hero ---- */

.hero {
  text-align: center;
  padding: 4rem 0 2.5rem;
}

.hero-logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 1.5rem;
}

.hero h1 {
  /* Matches openclaw.ai hero title exactly:
     clamp size, 700 weight, -0.03em tracking, coral-threaded gradient */
  font-size: clamp(3rem, 10vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0 0 1rem;
  /* OpenClaw title gradient: coral (left) → teal (right), horizontal */
  background: linear-gradient(to right, #ff4d4d 0%, #00e5cc 100%);
  background-size: 200% 200%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Coral accent character overrides gradient for individual letters */
.hero h1 .hero-accent {
  -webkit-text-fill-color: var(--accent);
  color: var(--accent);
}

[data-theme="light"] .hero h1 {
  background: linear-gradient(to right, #e63946 0%, #14b8a6 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .hero h1 .hero-accent {
  -webkit-text-fill-color: var(--accent);
}

/* Uppercase coral tagline — mirrors OpenClaw's "THE AI THAT ACTUALLY DOES THINGS." */
.hero-tagline {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin: 0 0 1.25rem;
}

.hero p {
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.7;
}

/* ---- Section titles — matches OpenClaw's › chevron header style ---- */

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.4rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
  color: var(--text-primary);
}

.section-chevron {
  color: var(--accent);
  font-weight: 700;
  font-size: 1.2em;
  line-height: 1;
}

/* ---- Search form — matches OpenClaw newsletter input+button style ---- */

.search-form {
  display: flex;
  gap: 0.75rem;
  margin: 0 0 2rem;
}

.search-form input {
  flex: 1;
  /* Explicit height so input and button are identical */
  height: 3rem;
  padding: 0 1.125rem;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  outline: none;
  backdrop-filter: blur(12px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

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

.search-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 77, 77, 0.18);
}

.search-form button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 3rem;
  padding: 0 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  /* Coral gradient — matches OpenClaw's subscribe/CTA button */
  background: linear-gradient(135deg, #ff4d4d 0%, #991b1b 100%);
  color: #fff;
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(255, 77, 77, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 77, 77, 0.35);
}

.search-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ---- Stats ---- */

.stats {
  display: flex;
  gap: 1rem;
  margin: 0 0 2rem;
}

.stat-card {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  text-align: center;
  backdrop-filter: blur(12px);
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.stats-placeholder {
  text-align: center;
  color: var(--text-secondary);
  padding: 0 0 2rem;
}

.stats-updated {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 0 0 1.5rem;
  margin-top: -0.5rem;
}

/* ---- Card grid — openclaw.ai style (centered icon + title + text) ---- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 0 0 2rem;
}

.card-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  text-align: center;
  text-decoration: none;
  backdrop-filter: blur(12px);
  transition: border-color 0.25s ease, transform 0.2s ease;
}

.info-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  color: inherit;
}

.info-card-icon {
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.info-card-icon svg {
  width: 28px;
  height: 28px;
}

.info-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: var(--text-primary);
}

.info-card-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* ---- Subscribe form (inside info-card) ---- */

.subscribe-form {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.subscribe-form input {
  flex: 1;
  min-width: 0;
  height: 2.25rem;
  padding: 0 0.75rem;
  font-size: 0.82rem;
  font-family: inherit;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  outline: none;
  transition: border-color 0.25s ease;
}

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

.subscribe-form input:focus {
  border-color: var(--accent);
}

.subscribe-form button {
  height: 2.25rem;
  padding: 0 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  background: linear-gradient(135deg, #ff4d4d 0%, #991b1b 100%);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s ease;
}

.subscribe-form button:hover {
  transform: translateY(-1px);
}

.subscribe-success {
  color: var(--teal) !important;
  font-weight: 600;
}

.subscribe-error {
  color: var(--risk-critical) !important;
  font-weight: 500;
}

/* ---- Newsletter wide card ---- */

.newsletter-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 2rem;
  margin: 0 0 2rem;
  backdrop-filter: blur(12px);
  text-align: center;
}

.newsletter-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0 0 1.25rem;
  line-height: 1.6;
}

.subscribe-form-wide {
  max-width: 480px;
  margin: 0 auto;
  justify-content: center;
}

.subscribe-form-wide input {
  height: 3rem;
  padding: 0 1.125rem;
  font-size: 0.95rem;
  border-radius: 0.75rem;
}

.subscribe-form-wide button {
  height: 3rem;
  padding: 0 1.5rem;
  font-size: 0.95rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 20px rgba(255, 77, 77, 0.25);
}

.subscribe-form-wide button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 77, 77, 0.35);
}

/* ---- Inline check results ---- */

.check-results {
  margin: -0.5rem 0 2rem;
}

.leak-type-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.leak-type-pill {
  display: inline-block;
  background: var(--bg-secondary);
  border: 1px solid var(--border-accent);
  border-radius: 0.375rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
}

/* ---- Results page ---- */

.results-header {
  margin: 2rem 0 1.5rem;
}

.results-header h1 {
  font-size: 1.5rem;
  word-break: break-all;
}

.alert-card {
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.good-news {
  background: var(--bg-card);
  border: 1px solid #22c55e;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.error-card {
  background: var(--bg-card);
  border: 1px solid var(--risk-critical);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.25rem 5rem 1.25rem 1.25rem;
  margin-bottom: 1rem;
  position: relative;
}

.risk-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.2rem 0.6rem;
  border-radius: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
}

.risk-critical { background: var(--risk-critical); }
.risk-high { background: var(--risk-high); }
.risk-medium { background: var(--risk-medium); color: #111; }
.risk-low { background: var(--risk-low); }

.result-field {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.result-field strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.result-field a {
  word-break: break-all;
}

.category-pill {
  display: inline-block;
  background: var(--bg-secondary);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0.15rem 0.25rem 0.15rem 0;
}

.recommendation {
  margin-top: 0.75rem;
  padding: 0.6rem 0.8rem;
  background: var(--bg-secondary);
  border-radius: 0.375rem;
  font-size: 0.85rem;
  color: var(--risk-critical);
  font-weight: 500;
}

.search-again {
  display: inline-block;
  margin-top: 1.5rem;
  color: var(--accent);
  font-weight: 500;
}

/* ---- About page ---- */

.about-content {
  padding: 2rem 0;
}

.about-content h1 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}

.about-content h2 {
  font-size: 1.2rem;
  margin: 2rem 0 0.5rem;
}

.about-content p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* ---- Footer ---- */

footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8rem;
  max-width: 800px;
  margin: 3rem auto 0;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--text-primary);
}

footer small {
  display: block;
  margin-top: 0.5rem;
}

/* ---- Responsive ---- */

@media (max-width: 600px) {
  .search-form {
    flex-direction: column;
  }

  .search-form input,
  .search-form button {
    width: 100%;
    border-radius: 0.75rem;
  }

  .search-form button {
    justify-content: center;
  }

  .stats {
    flex-direction: column;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .card-grid-3 {
    grid-template-columns: 1fr;
  }

  .subscribe-form {
    flex-direction: column;
  }

  .subscribe-form input,
  .subscribe-form button {
    width: 100%;
  }
}
