/* ========================================================================
   Variables
   ======================================================================== */
:root {
  /* Colors */
  --color-background: #050b16; /* deep blue background */
  --color-surface: #0f1724;    /* elevated surface */
  --color-surface-soft: #141c2b;
  --color-text: #f9fafb;
  --color-text-muted: #9ca3af;
  --color-border-subtle: #1f2933;
  --color-primary: #1d4ed8; /* action blue */
  --color-primary-soft: rgba(37, 99, 235, 0.12);
  --color-success: #16a34a; /* soft green accent for trusted/verified */
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-graphite: #111827; /* graphite gray for panels / text */
  --color-neutral-50: #f9fafb;
  --color-neutral-100: #f3f4f6;
  --color-neutral-200: #e5e7eb;
  --color-neutral-300: #d1d5db;
  --color-neutral-400: #9ca3af;
  --color-neutral-500: #6b7280;
  --color-neutral-600: #4b5563;
  --color-neutral-700: #374151;
  --color-neutral-800: #1f2933;
  --color-neutral-900: #111827;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  --font-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Font sizes (rem-based) */
  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 1rem;    /* 16px */
  --font-size-lg: 1.125rem;  /* 18px */
  --font-size-xl: 1.25rem;   /* 20px */
  --font-size-2xl: 1.5rem;   /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */
  --font-size-4xl: 2.25rem;  /* 36px */

  /* Line heights */
  --line-height-tight: 1.2;
  --line-height-snug: 1.35;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing scale (px) */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Radius */
  --radius-xs: 3px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Shadows (subtle, to maintain trustworthy, clean look) */
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.45);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-normal: 180ms ease-out;
  --transition-slow: 240ms ease-out;
}

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
  :root {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ========================================================================
   Reset / Normalize
   ======================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
}

h1, h2, h3, h4, h5, h6,
p, figure, blockquote,
dl, dd {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
}

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

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

button {
  border: none;
  padding: 0;
  background: none;
}

a {
  text-decoration: none;
  color: inherit;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ========================================================================
   Base Styles
   ======================================================================== */
body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  display: block;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: var(--line-height-tight);
  color: var(--color-neutral-50);
}

h1 { font-size: var(--font-size-4xl); margin-bottom: var(--space-4); }
h2 { font-size: var(--font-size-3xl); margin-bottom: var(--space-3); }
h3 { font-size: var(--font-size-2xl); margin-bottom: var(--space-3); }
h4 { font-size: var(--font-size-xl); margin-bottom: var(--space-2); }
h5 { font-size: var(--font-size-lg); margin-bottom: var(--space-2); }
h6 { font-size: var(--font-size-base); margin-bottom: var(--space-1); }

p {
  margin-bottom: var(--space-3);
  color: var(--color-text-muted);
}

strong {
  font-weight: 600;
  color: var(--color-text);
}

code, pre {
  font-family: var(--font-mono);
}

/* Links: keep clean, subtle underline on hover for clarity */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-normal);
}

a:hover {
  color: #60a5fa;
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

/* ========================================================================
   Accessibility & Focus
   ======================================================================== */
:focus-visible {
  outline: 2px solid var(--color-success);
  outline-offset: 3px;
}

:focus {
  outline: none;
}

/* Screen reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========================================================================
   Layout Utilities
   ======================================================================== */
.container {
  width: 100%;
  max-width: 1120px; /* Comfortable width for comparison grids */
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 1024px) {
  .container {
    padding-inline: var(--space-6);
  }
}

/* Flex helpers */
.flex { display: flex; }
.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

/* Grid helpers for offer comparison layouts */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-auto-fit-min-260 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}
.grid-gap-4 { gap: var(--space-4); }

@media (max-width: 767px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Spacing utilities (commonly used) */
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.pt-4 { padding-top: var(--space-4); }
.pb-4 { padding-bottom: var(--space-4); }

/* ========================================================================
   Components
   ======================================================================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  font-weight: 500;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background-color var(--transition-normal),
    color var(--transition-normal),
    border-color var(--transition-normal),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.btn-primary {
  background: var(--color-primary);
  color: #e5f0ff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.4);
}

.btn-primary:active {
  background: #1d4ed8;
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: var(--color-border-subtle);
}

.btn-ghost:hover {
  background: var(--color-surface-soft);
  color: var(--color-text);
}

.btn-success {
  background: var(--color-success);
  color: #ecfdf3!important;
}

.btn-success:hover {
  background: #16a34a;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn:focus-visible {
  outline: 2px solid #a7f3d0;
  outline-offset: 2px;
}

.btn-sm {
  padding: 0.45rem 0.75rem;
  font-size: var(--font-size-xs);
}

/* Inputs */
.input,
.select,
.textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-subtle);
  background-color: var(--color-surface-soft);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  transition:
    border-color var(--transition-normal),
    box-shadow var(--transition-fast),
    background-color var(--transition-normal);
}

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

.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: 0;
  border-color: var(--color-success);
  box-shadow: 0 0 0 1px var(--color-success);
}

.input[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--color-danger);
}

/* Cards - used for offer comparison blocks */
.card {
  position: relative;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top left, #111827, #020617);
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.card-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-neutral-50);
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.card-body {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.card-footer {
  margin-top: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

/* Offer badges - trusted / verified indicators */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge-verified {
  background-color: rgba(34, 197, 94, 0.1);
  color: #bbf7d0;
  border: 1px solid rgba(34, 197, 94, 0.45);
}

.badge-neutral {
  background-color: rgba(148, 163, 184, 0.08);
  color: var(--color-text-muted);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

/* Comparison-specific helpers (e.g. rating / odds row) */
.offer-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.offer-meta-label {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

.offer-meta-value {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-neutral-50);
}

/* ========================================================================
   Page-level helpers
   ======================================================================== */

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-main {
  flex: 1 0 auto;
  padding-block: var(--space-8);
}

.page-header,
.page-footer {
  flex-shrink: 0;
}

.page-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  background: linear-gradient(180deg, #020617, rgba(15, 23, 42, 0.9));
  backdrop-filter: blur(12px);
}

.page-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  background-color: #020617;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  padding-block: var(--space-4);
}

/* Trust / responsible gaming note style */
.responsibility-note {
  margin-top: var(--space-4);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background-color: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* ========================================================================
   End of base.css
   ======================================================================== */
