/* ==================================================================
   FLEXGAMEPRO Base Styles
   Modern, clean, structured gaming platform aesthetic
   ================================================================== */

/* ==================================================================
   1. CSS Variables (Design Tokens)
   ================================================================== */
:root {
  /* Color Palette */
  --color-bg: #050816; /* deep gaming background */
  --color-bg-elevated: #0b1020;
  --color-bg-soft: #111827;
  --color-surface: #111827;
  --color-surface-alt: #1f2937;

  --color-text: #e5e7eb;
  --color-text-muted: #9ca3af;
  --color-text-soft: #6b7280;
  --color-border-subtle: #1f2937;
  --color-border-strong: #374151;

  --color-primary: #3b82f6; /* main brand accent, gaming blue */
  --color-primary-soft: rgba(59, 130, 246, 0.1);
  --color-primary-strong: #2563eb;

  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;

  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji',
    'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    'Liberation Mono', 'Courier New', monospace;

  --font-size-root: 16px;
  --font-size-xs: 0.75rem;  /* 12px */
  --font-size-sm: 0.875rem; /* 14px */
  --font-size-md: 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 */
  --font-size-5xl: 3rem;    /* 48px */

  --line-height-tight: 1.1;
  --line-height-snug: 1.3;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing Scale (px converted to rem assuming 16px base) */
  --space-0: 0;
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */
  --space-20: 5rem;    /* 80px */
  --space-24: 6rem;    /* 96px */

  /* Radius */
  --radius-xs: 0.125rem;
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.4);
  --shadow-md: 0 8px 20px rgba(15, 23, 42, 0.65);
  --shadow-lg: 0 20px 45px rgba(15, 23, 42, 0.85);
  --shadow-soft-glow: 0 0 0 1px rgba(59, 130, 246, 0.4),
    0 0 30px rgba(59, 130, 246, 0.25);

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

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

html {
  font-size: var(--font-size-root);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
}

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

ul[role='list'],
ol[role='list'] {
  list-style: none;
  padding: 0;
  margin: 0;
}

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

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

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

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

/* Reduce animation for users that prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==================================================================
   3. Base Typography & Layout
   ================================================================== */
body {
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
  background-color: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  min-height: 100vh;
}

/* Headings - modern, modular rhythm */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--color-gray-50);
}

h1 {
  font-size: clamp(2.25rem, 4vw, 3rem);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-4);
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-3);
}

h3 {
  font-size: 1.5rem;
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-2);
}

h4 {
  font-size: 1.25rem;
  line-height: var(--line-height-normal);
  margin-bottom: var(--space-2);
}

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

strong {
  font-weight: 600;
}

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

/* Links */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--color-primary-strong);
}

a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Lists */
ul,
ol {
  margin: 0 0 var(--space-3) var(--space-5);
  padding: 0;
}

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

/* 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;
}

/* ==================================================================
   5. Layout Utilities
   ================================================================== */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
  max-width: 1120px; /* tuned for modular, readable layouts */
}

@media (min-width: 1280px) {
  .container {
    max-width: 1200px;
  }
}

.section {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}

.section--dense {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}

/* Flex utilities */
.flex {
  display: flex;
}

.inline-flex {
  display: inline-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;
}

.gap-sm {
  gap: var(--space-3);
}

.gap-md {
  gap: var(--space-4);
}

.gap-lg {
  gap: var(--space-6);
}

/* Grid utilities */
.grid {
  display: grid;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
}

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

/* Alignment helpers for structured smartplay-style layouts */
.stack-sm > * + * {
  margin-top: var(--space-2);
}

.stack-md > * + * {
  margin-top: var(--space-3);
}

.stack-lg > * + * {
  margin-top: var(--space-4);
}

/* Basic spacing utilities (y-axis) */
.mt-0 { margin-top: 0; }
.mt-xs { margin-top: var(--space-1); }
.mt-sm { margin-top: var(--space-2); }
.mt-md { margin-top: var(--space-3); }
.mt-lg { margin-top: var(--space-4); }
.mt-xl { margin-top: var(--space-6); }

.mb-0 { margin-bottom: 0; }
.mb-xs { margin-bottom: var(--space-1); }
.mb-sm { margin-bottom: var(--space-2); }
.mb-md { margin-bottom: var(--space-3); }
.mb-lg { margin-bottom: var(--space-4); }
.mb-xl { margin-bottom: var(--space-6); }

/* ==================================================================
   6. Components
   ================================================================== */

/* 6.1 Buttons - primary, secondary, ghost (hero CTAs) */
.btn {
  --btn-bg: var(--color-surface-alt);
  --btn-color: var(--color-gray-50);
  --btn-border: transparent;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--btn-border);
  background-color: var(--btn-bg);
  color: var(--btn-color);
  font-weight: 600;
  font-size: var(--font-size-sm);
  line-height: 1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background-color var(--transition-base),
    color var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-fast);
  white-space: nowrap;
}

.btn--primary {
  --btn-bg: var(--color-primary);
  --btn-color: #0b1120;
  --btn-border: transparent;
  box-shadow: var(--shadow-md);
}

.btn--primary:hover {
  background-color: var(--color-primary-strong);
  box-shadow: var(--shadow-soft-glow);
  transform: translateY(-1px);
}

.btn--secondary {
  --btn-bg: transparent;
  --btn-color: var(--color-gray-50);
  --btn-border: var(--color-border-strong);
}

.btn--secondary:hover {
  background-color: rgba(15, 23, 42, 0.9);
  border-color: var(--color-primary);
}

.btn--ghost {
  --btn-bg: var(--color-primary-soft);
  --btn-color: var(--color-primary);
  --btn-border: transparent;
}

.btn--ghost:hover {
  background-color: rgba(59, 130, 246, 0.18);
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

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

/* 6.2 Form Elements - contact, newsletter, filters */
label {
  display: inline-block;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-soft);
  margin-bottom: var(--space-1);
}

input[type='text'],
input[type='email'],
input[type='url'],
input[type='password'],
input[type='search'],
textarea,
select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background-color: rgba(15, 23, 42, 0.8);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: 1.4;
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    background-color var(--transition-base);
}

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

textarea {
  min-height: 140px;
  resize: vertical;
}

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

input:disabled,
textarea:disabled,
select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.field-error {
  color: var(--color-danger);
  font-size: var(--font-size-xs);
  margin-top: var(--space-1);
}

.input-error {
  border-color: var(--color-danger);
}

/* 6.3 Cards - modular game sections, features, updates */
.card {
  background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.16), transparent 55%),
    var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  border: 1px solid rgba(55, 65, 81, 0.7);
  box-shadow: var(--shadow-sm);
}

.card--soft {
  background: var(--color-bg-soft);
}

.card--outlined {
  background: transparent;
}

.card-header {
  margin-bottom: var(--space-3);
}

.card-title {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-1);
}

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

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

/* 6.4 Badges / Pills - for status, update tags */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge--primary {
  background-color: rgba(59, 130, 246, 0.18);
  color: var(--color-primary);
}

.badge--success {
  background-color: rgba(16, 185, 129, 0.18);
  color: var(--color-success);
}

.badge--warning {
  background-color: rgba(245, 158, 11, 0.18);
  color: var(--color-warning);
}

.badge--danger {
  background-color: rgba(239, 68, 68, 0.18);
  color: var(--color-danger);
}

/* 6.5 Section Headers - consistent modular sections */
.section-header {
  max-width: 640px;
  margin-bottom: var(--space-6);
}

.section-eyebrow {
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-soft);
  margin-bottom: var(--space-2);
}

.section-title {
  font-size: clamp(1.75rem, 2.4vw, 2.1rem);
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-2);
}

.section-description {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* ==================================================================
   7. Page-Specific Foundations (Hero, Navigation)
   ================================================================== */

/* Navigation shell for all pages */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.82));
  border-bottom: 1px solid rgba(31, 41, 55, 0.9);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.site-logo {
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.site-logo span {
  color: var(--color-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--font-size-sm);
}

.nav-link {
  position: relative;
  color: var(--color-text-soft);
  padding: 0.25rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), #22c55e);
  transition: width var(--transition-base);
}

.nav-link:hover {
  color: var(--color-gray-50);
}

.nav-link:hover::after,
.nav-link--active::after {
  width: 100%;
}

.nav-link--active {
  color: var(--color-gray-50);
}

/* Hero - shared structure for homepage and key landing sections */
.hero {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--space-10);
  align-items: center;
}

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

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-full);
  background-color: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(55, 65, 81, 0.9);
  margin-bottom: var(--space-3);
}

.hero-kicker-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-soft);
}

.hero-title {
  font-size: clamp(2.6rem, 4vw, 3.2rem);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-3);
}

.hero-subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-muted);
  max-width: 36rem;
  margin-bottom: var(--space-5);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-5);
  font-size: var(--font-size-xs);
  color: var(--color-text-soft);
}

.hero-meta-item strong {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--color-gray-50);
}

.hero-visual {
  position: relative;
  min-height: 260px;
}

.hero-orbit {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background:
    radial-gradient(circle at 20% 0%, rgba(59, 130, 246, 0.6), transparent 60%),
    radial-gradient(circle at 80% 100%, rgba(34, 197, 94, 0.5), transparent 55%),
    radial-gradient(circle at 50% 40%, rgba(15, 23, 42, 0.95), transparent 70%);
  filter: blur(0.8px);
  opacity: 0.9;
}

.hero-panel {
  position: relative;
  z-index: 1;
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(55, 65, 81, 0.95);
  box-shadow: var(--shadow-lg);
}

/* ==================================================================
   8. Media & Misc Utilities
   ================================================================== */

.responsive-media {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.responsive-media iframe,
.responsive-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.img-rounded {
  border-radius: var(--radius-lg);
}

.img-border {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(55, 65, 81, 0.7);
}

/* Utility to visually separate structured sections */
.section-divider {
  border-top: 1px solid rgba(31, 41, 55, 0.9);
  margin-top: var(--space-12);
  margin-bottom: var(--space-12);
}

/* Status text */
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }
.text-muted { color: var(--color-text-muted); }

/* Tables for update / changelog pages */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

thead {
  background-color: rgba(15, 23, 42, 0.9);
}

th,
td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(31, 41, 55, 0.9);
}

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

tr:nth-child(even) td {
  background-color: rgba(15, 23, 42, 0.5);
}

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