/* ============================================================
   SiteGuard Monitor — Premium Dark Theme Design System
   ============================================================
   A comprehensive CSS design system for a website monitoring
   dashboard featuring glassmorphism, smooth animations, and
   responsive layouts.
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── CSS Custom Properties ───────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-primary: hsl(230, 25%, 8%);
  --bg-secondary: hsl(230, 20%, 12%);
  --bg-card: hsla(230, 25%, 15%, 0.6);
  --bg-card-hover: hsla(230, 25%, 18%, 0.7);
  --bg-input: hsla(230, 25%, 12%, 0.8);

  /* Accent — Emerald */
  --accent: hsl(160, 84%, 39%);
  --accent-glow: hsla(160, 84%, 39%, 0.3);
  --accent-light: hsl(160, 84%, 50%);

  /* Danger — Red */
  --danger: hsl(0, 72%, 51%);
  --danger-glow: hsla(0, 72%, 51%, 0.3);

  /* Warning — Amber */
  --warning: hsl(38, 92%, 50%);
  --warning-glow: hsla(38, 92%, 50%, 0.3);

  /* Text */
  --text-primary: hsl(210, 40%, 96%);
  --text-secondary: hsl(215, 20%, 65%);
  --text-muted: hsl(215, 15%, 45%);

  /* Borders */
  --border: hsla(215, 20%, 30%, 0.4);
  --border-light: hsla(215, 20%, 40%, 0.3);

  /* Misc */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px hsla(0, 0%, 0%, 0.2);
  --shadow-md: 0 4px 16px hsla(0, 0%, 0%, 0.25);
  --shadow-lg: 0 8px 32px hsla(0, 0%, 0%, 0.35);
  --shadow-glow-accent: 0 0 20px var(--accent-glow);
  --shadow-glow-danger: 0 0 20px var(--danger-glow);

  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 0%, hsla(230, 40%, 18%, 0.5) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 100%, hsla(160, 50%, 12%, 0.15) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Thin scrollbar — WebKit */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: hsla(215, 20%, 35%, 0.6);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: hsla(215, 20%, 45%, 0.8);
}

/* Thin scrollbar — Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: hsla(215, 20%, 35%, 0.6) var(--bg-secondary);
}

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

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

/* ── 2. Container ────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* ── 3. Header ───────────────────────────────────────────── */
.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 40px 0 24px;
}

.header__left {
  flex: 1;
  text-align: center;
}

.header__right {
  flex-shrink: 0;
  padding-top: 4px;
}

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

.header__logo {
  font-size: 1.75rem;
}

.header__title {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent) 0%, hsl(185, 80%, 50%) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

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

/* ── 4. Hero Title ───────────────────────────────────────── */
.hero-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  background: linear-gradient(135deg, var(--accent) 0%, hsl(185, 80%, 50%) 50%, hsl(200, 90%, 60%) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
  margin-bottom: 8px;
}

/* ── 5. Hero Subtitle ────────────────────────────────────── */
.hero-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 400;
  text-align: center;
  margin-bottom: 32px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* ── 6. Input Section ────────────────────────────────────── */
.input-section {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 28px;
  transition: border-color var(--transition-base);
}

.input-section:hover {
  border-color: var(--border-light);
}

.input-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
  min-width: 200px;
}

.input-icon {
  position: absolute;
  left: 14px;
  font-size: 1.1rem;
  pointer-events: none;
  z-index: 1;
}

.input-wrapper .url-input {
  padding-left: 42px;
}

/* ── 7. URL Input ────────────────────────────────────────── */
.url-input {
  flex: 1;
  min-width: 200px;
  padding: 12px 16px;
  font-family: var(--font-family);
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

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

.url-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-sm);
}

/* ── 8-11. Buttons ───────────────────────────────────────── */

/* Shared button base */
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-family);
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-base),
    background var(--transition-base),
    border-color var(--transition-base),
    color var(--transition-base);
  white-space: nowrap;
}

/* 8. Primary button — emerald gradient */
.btn-primary {
  padding: 12px 24px;
  font-size: 0.9375rem;
  color: hsl(230, 25%, 8%);
  background: linear-gradient(135deg, var(--accent) 0%, hsl(170, 78%, 42%) 100%);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm), 0 0 16px var(--accent-glow);
  font-weight: 600;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 28px var(--accent-glow);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 9. Secondary button — outlined */
.btn-secondary {
  padding: 12px 24px;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.btn-secondary:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
  background: hsla(230, 25%, 18%, 0.4);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:active {
  transform: translateY(0);
}

/* 10. Danger button — red outlined */
.btn-danger {
  padding: 12px 24px;
  font-size: 0.9375rem;
  color: var(--danger);
  background: transparent;
  border: 1px solid hsla(0, 72%, 51%, 0.3);
  border-radius: var(--radius-md);
}

.btn-danger:hover {
  background: hsla(0, 72%, 51%, 0.1);
  border-color: hsla(0, 72%, 51%, 0.5);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-danger);
}

.btn-danger:active {
  transform: translateY(0);
}

/* 11. Icon button — compact */
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 1.125rem;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.btn-icon:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

/* ── Large primary button ────────────────────────────────── */
.btn-primary--large {
  padding: 14px 32px;
  font-size: 1rem;
}

/* ── 12. Site List ───────────────────────────────────────── */
.site-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.site-chip__name {
  font-size: 0.8125rem;
}

/* ── Action Bar ──────────────────────────────────────────── */
.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.action-bar__info {
  font-size: 0.8125rem;
}

/* ── Progress Container ─────────────────────────────────── */
.progress-container {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
  animation: fadeIn 0.3s ease;
}

.progress-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

/* ── Section Title ───────────────────────────────────────── */
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.section-title svg {
  color: var(--text-muted);
}

/* ── 13. Site Chip ───────────────────────────────────────── */
.site-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  transition:
    border-color var(--transition-base),
    background var(--transition-base);
  animation: fadeIn 0.3s ease forwards;
}

.site-chip:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

.site-chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: hsla(215, 20%, 30%, 0.4);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  transition:
    color var(--transition-fast),
    background var(--transition-fast);
}

.site-chip__remove:hover {
  color: var(--danger);
  background: var(--danger-glow);
}

/* ── 14. Results Grid ────────────────────────────────────── */
.results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

@media (min-width: 640px) {
  .results-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .results-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── 15. Result Card ─────────────────────────────────────── */
.result-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition:
    transform var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-slow);
  animation: fadeIn 0.4s ease forwards;
  overflow: hidden;
}

.result-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-light);
  box-shadow: var(--shadow-lg);
}

/* ── 16. Result Card Header ──────────────────────────────── */
.result-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.result-card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.result-card__globe {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.result-card__domain {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.result-table-header {
  display: none;
}

@media (min-width: 640px) {
  .result-table-header {
    display: grid;
    grid-template-columns: 1fr auto auto auto auto;
    gap: 10px;
    padding: 4px 10px 8px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
  }
}

/* ── 17. Result Card Body ────────────────────────────────── */
.result-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── 18. Result Row ──────────────────────────────────────── */
.result-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
  background: hsla(230, 25%, 12%, 0.4);
  transition: background var(--transition-fast);
}

.result-row:hover {
  background: hsla(230, 25%, 16%, 0.5);
}

.result-row--ok { border-left: 3px solid var(--accent); }
.result-row--error { border-left: 3px solid var(--danger); }
.result-row--warning { border-left: 3px solid var(--warning); }
.result-row--pending { border-left: 3px solid var(--text-muted); }

.result-row__flag {
  font-size: 1.125rem;
  flex-shrink: 0;
}

.result-row__country {
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 70px;
  flex: 1;
}

.result-row__country small {
  font-weight: 400;
}

.result-row__status {
  flex-shrink: 0;
  font-size: 0.9rem;
}

.result-row__code {
  color: var(--text-muted);
  font-size: 0.75rem;
  min-width: 60px;
}

.result-row__time {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  min-width: 50px;
  text-align: right;
}

/* ── Source Badge Variants ───────────────────────────────── */
.source-badge--checkhost {
  color: hsl(200, 70%, 60%);
  border-color: hsla(200, 70%, 60%, 0.2);
}

.source-badge--globalping {
  color: hsl(280, 60%, 65%);
  border-color: hsla(280, 60%, 65%, 0.2);
}

/* ── 19. Status Badge ────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.status-badge--success,
.status-badge--ok {
  color: var(--accent);
  background: hsla(160, 84%, 39%, 0.12);
  border: 1px solid hsla(160, 84%, 39%, 0.2);
}

.status-badge--danger,
.status-badge--error {
  color: var(--danger);
  background: hsla(0, 72%, 51%, 0.12);
  border: 1px solid hsla(0, 72%, 51%, 0.2);
}

.status-badge--warning,
.status-badge--slow {
  color: var(--warning);
  background: hsla(38, 92%, 50%, 0.12);
  border: 1px solid hsla(38, 92%, 50%, 0.2);
}

.status-badge--pending {
  color: var(--text-muted);
  background: hsla(215, 15%, 45%, 0.12);
  border: 1px solid hsla(215, 15%, 45%, 0.2);
}

/* ── 20. Status Dot ──────────────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-muted);
}

.status-dot--success,
.status-dot--ok {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}

.status-dot--danger,
.status-dot--error {
  background: var(--danger);
  box-shadow: 0 0 6px var(--danger-glow);
}

.status-dot--warning,
.status-dot--slow {
  background: var(--warning);
  box-shadow: 0 0 6px var(--warning-glow);
}

.status-dot--pending {
  background: var(--text-muted);
}

/* ── 21. Source Badge ────────────────────────────────────── */
.source-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background: hsla(215, 20%, 25%, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  text-transform: uppercase;
  flex-shrink: 0;
}

/* ── 22-23. Progress Bar ─────────────────────────────────── */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 12px 0;
}

.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, hsl(185, 80%, 50%) 100%);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
  position: relative;
  animation: progressGlow 2s ease-in-out infinite;
}

.progress-bar__fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    hsla(0, 0%, 100%, 0.25) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s ease-in-out infinite;
}

/* ── 24. History Section ─────────────────────────────────── */
.history-section {
  margin-top: 32px;
  margin-bottom: 32px;
}

.history-section__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ── 25. History Item ────────────────────────────────────── */
.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  font-size: 0.8125rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast);
}

.history-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}

.history-item__time {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.history-item__summary {
  color: var(--text-secondary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── 26. Modal Overlay ───────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: hsla(230, 30%, 5%, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay[hidden] {
  display: none;
}

/* ── 27. Modal ───────────────────────────────────────────── */
.modal {
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), 0 0 60px hsla(0, 0%, 0%, 0.4);
  animation: fadeIn 0.3s ease;
}

/* ── 28. Modal Header ────────────────────────────────────── */
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-size: 1.125rem;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    color var(--transition-fast),
    background var(--transition-fast);
}

.modal__close:hover {
  color: var(--text-primary);
  background: hsla(215, 20%, 30%, 0.3);
}

/* ── 29. Modal Body ──────────────────────────────────────── */
.modal__body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── 30. Modal Footer ────────────────────────────────────── */
.modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ── 31. Form Group ──────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ── 32. Form Label ──────────────────────────────────────── */
.form-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ── 33. Form Input ──────────────────────────────────────── */
.form-input {
  padding: 10px 14px;
  font-family: var(--font-family);
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

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

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── 34. Form Checkbox ───────────────────────────────────── */
.form-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-light);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.form-checkbox input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.form-checkbox input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--bg-primary);
}

.form-checkbox input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.form-checkbox__label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ── 35. Form Help Text ──────────────────────────────────── */
.form-help {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.form-help-block {
  background: hsla(230, 25%, 15%, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.form-help-block strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 8px;
}

.form-help-block ol {
  margin: 0;
  padding-left: 20px;
}

.form-help-block li {
  margin-bottom: 4px;
}

.form-help-block code {
  background: hsla(230, 25%, 20%, 0.6);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.8em;
  color: var(--accent);
}

/* ── 36-38. Toast Notifications ──────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  min-width: 280px;
  max-width: 420px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastSlideIn 0.35s ease forwards;
}

.toast--exiting,
.toast--exit {
  animation: toastSlideOut 0.3s ease forwards;
}

/* 37. Success toast */
.toast--success {
  border-left: 3px solid var(--accent);
}

.toast--success .toast__icon {
  color: var(--accent);
}

/* 38. Error toast */
.toast--error {
  border-left: 3px solid var(--danger);
}

.toast--error .toast__icon {
  color: var(--danger);
}

.toast__icon {
  font-size: 1.125rem;
  flex-shrink: 0;
}

.toast__message {
  flex: 1;
}

.toast__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: color var(--transition-fast);
}

.toast__close:hover {
  color: var(--text-primary);
}

/* ── 39. Footer ──────────────────────────────────────────── */
.footer {
  padding: 32px 0;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

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

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

/* ── 40. Loading Spinner ─────────────────────────────────── */
.loading-spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.loading-spinner--small,
.loading-spinner--sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.loading-spinner--lg {
  width: 44px;
  height: 44px;
  border-width: 4px;
}

/* ── 41. Skeleton Loader ─────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    hsla(230, 20%, 18%, 0.6) 0%,
    hsla(230, 20%, 24%, 0.6) 40%,
    hsla(230, 20%, 18%, 0.6) 80%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton--text {
  height: 14px;
  width: 100%;
  margin-bottom: 8px;
}

.skeleton--text-sm {
  height: 10px;
  width: 60%;
}

.skeleton--circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton--card {
  height: 160px;
  border-radius: var(--radius-lg);
}

/* ── 42. Empty State ─────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state__icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state__title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state__description {
  font-size: 0.875rem;
  max-width: 320px;
  line-height: 1.5;
}

/* ============================================================
   Keyframe Animations
   ============================================================ */

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

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

@keyframes progressGlow {
  0%, 100% {
    box-shadow: 0 0 8px var(--accent-glow);
  }
  50% {
    box-shadow: 0 0 18px var(--accent-glow);
  }
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* ============================================================
   Responsive — Mobile-first
   ============================================================ */

/* Small adjustments for mobile */
@media (max-width: 639px) {
  .container {
    padding: 0 16px;
  }

  .header {
    padding: 28px 0 16px;
  }

  .input-section {
    padding: 16px;
  }

  .input-section__row {
    flex-direction: column;
  }

  .url-input {
    width: 100%;
  }

  .btn-primary,
  .btn-secondary,
  .btn-danger {
    width: 100%;
    justify-content: center;
  }

  .result-card {
    padding: 16px;
  }

  .modal {
    max-width: 100%;
    border-radius: var(--radius-lg);
  }

  .toast-container {
    bottom: 16px;
    right: 16px;
    left: 16px;
  }

  .toast {
    min-width: 0;
    max-width: 100%;
  }

  .modal__header,
  .modal__body,
  .modal__footer {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Tablet */
@media (min-width: 640px) and (max-width: 1023px) {
  .header {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .header {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* ============================================================
   Utility Classes
   ============================================================ */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-accent  { color: var(--accent); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted   { color: var(--text-muted); }

.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-sm      { gap: 6px; }
.gap-md      { gap: 12px; }
.gap-lg      { gap: 20px; }

.mt-sm  { margin-top: 8px; }
.mt-md  { margin-top: 16px; }
.mt-lg  { margin-top: 32px; }
.mb-sm  { margin-bottom: 8px; }
.mb-md  { margin-bottom: 16px; }
.mb-lg  { margin-bottom: 32px; }

.w-full { width: 100%; }
.text-center { text-align: center; }

/* ============================================================
   Extended Components — Check Types, Hints, Tooltips
   ============================================================ */

/* -- Check Type Section inside result card -- */
.check-type-section {
  margin-bottom: 12px;
}

.check-type-section:last-child {
  margin-bottom: 0;
}

.check-type-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin-bottom: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--type-color, var(--text-secondary));
  border-left: 3px solid var(--type-color, var(--border));
  background: hsla(230, 25%, 14%, 0.5);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.check-type-icon {
  font-size: 0.875rem;
}

.check-type-label {
  color: var(--type-color, var(--text-primary));
}

.check-type-count {
  margin-left: auto;
  font-weight: 400;
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: none;
}

/* -- Result card meta info -- */
.result-card__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.source-tag {
  display: inline-flex;
  padding: 1px 6px;
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: hsla(230, 25%, 18%, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
}

/* -- Hint icon (💡) with tooltip -- */
.result-hint {
  cursor: help;
  font-size: 0.75rem;
  margin-left: 4px;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.result-hint:hover {
  opacity: 1;
}

/* -- Tooltip -- */
.tooltip {
  position: fixed;
  z-index: 3000;
  max-width: 320px;
  padding: 8px 14px;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-primary);
  background: hsl(230, 25%, 18%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  animation: fadeIn 0.15s ease;
  line-height: 1.5;
}

/* -- Source badge variants for new APIs -- */
.source-badge--cloudflare {
  color: hsl(25, 90%, 55%);
  border-color: hsla(25, 90%, 55%, 0.2);
}

.source-badge--google {
  color: hsl(120, 50%, 55%);
  border-color: hsla(120, 50%, 55%, 0.2);
}

/* -- Adjust grid for bigger cards (1-2 columns) -- */
@media (min-width: 640px) {
  .results-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .results-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Auth Overlay */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 23, 0.95);
  backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2.5rem;
  border-radius: var(--radius);
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: modal-fade-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.auth-modal__icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.auth-modal h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.auth-modal .text-muted {
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.text-danger {
  color: #ff4b4b;
}
