/* ========================================================================
   Drive Core Garage - Base Styles
   ======================================================================== */

/* ========================================================================
   1. CSS Variables (Design Tokens)
   ======================================================================== */
:root {
  /* Colors - Core Palette */
  --color-bg: #06070a; /* Deep graphite / almost black */
  --color-bg-elevated: #101219;
  --color-bg-muted: #181b23;

  --color-text: #f5f5f5;
  --color-text-muted: #a0a4b0;
  --color-text-soft: #7b7f8a;

  --color-primary: #e32732; /* Deep, intense red */
  --color-primary-soft: rgba(227, 39, 50, 0.15);
  --color-primary-strong: #ff3a47;

  --color-success: #25c58a;
  --color-warning: #ffb347;
  --color-danger: #ff4b5c;

  /* Neutral Grays (metallic / concrete) */
  --gray-50: #f8f9fb;
  --gray-100: #e4e6eb;
  --gray-200: #c7cad3;
  --gray-300: #a5a9b4;
  --gray-400: #848998;
  --gray-500: #64697a;
  --gray-600: #474c5b;
  --gray-700: #303442;
  --gray-800: #1f222d;
  --gray-900: #13151d;

  /* Accent / Effects */
  --color-metal: #b8c2cc;      /* metallic accent */
  --color-concrete: #2b2f3a;   /* concrete / wall */
  --color-neon: #ff195a;       /* slight neon magenta for details */

  /* Typography */
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Oswald", "Impact", system-ui, sans-serif; /* for bold, urban headings */

  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 1rem;    /* 16px */
  --font-size-md: 1.0625rem; /* 17px */
  --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.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing scale (0–96px) */
  --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-7: 1.75rem;  /* 28px */
  --space-8: 2rem;     /* 32px */
  --space-9: 2.25rem;  /* 36px */
  --space-10: 2.5rem;  /* 40px */
  --space-11: 2.75rem; /* 44px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */
  --space-20: 5rem;    /* 80px */
  --space-24: 6rem;    /* 96px */

  /* Radius */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 999px;

  /* Shadows (hard-edged, cinematic) */
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-strong: 0 18px 60px rgba(0, 0, 0, 0.75);
  --shadow-outline-primary: 0 0 0 1px rgba(227, 39, 50, 0.7), 0 0 0 4px rgba(227, 39, 50, 0.25);

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

  /* Layout */
  --container-max-width: 1200px;
  --container-gutter: var(--space-4);

  /* Z-index */
  --z-header: 50;
  --z-overlay: 100;
  --z-modal: 200;
}

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

html,
body {
  padding: 0;
  margin: 0;
}

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

body {
  min-height: 100vh;
}

/* Remove default margins */
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

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

li {
  list-style: none;
}

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

img {
  height: auto;
}

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

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

textarea {
  resize: vertical;
}

a {
  color: inherit;
}

/* ========================================================================
   3. Base Typography & Body Styles
   ======================================================================== */
body {
  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-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings - bold, urban, automotive feel */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-50);
}

h1 {
  font-size: var(--font-size-5xl);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-4);
}

h2 {
  font-size: var(--font-size-4xl);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-3);
}

h3 {
  font-size: var(--font-size-3xl);
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-3);
}

h4 {
  font-size: var(--font-size-2xl);
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-2);
}

h5 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-2);
}

h6 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-1);
}

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

strong,
b {
  font-weight: 600;
}

/* Links - clean, with subtle automotive red accent */
a {
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition-base), opacity var(--transition-fast);
}

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

a:active {
  opacity: 0.85;
}

/* ========================================================================
   4. Utilities
   ======================================================================== */

/* Layout: container */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-gutter);
  padding-right: var(--container-gutter);
}

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

.inline-flex {
  display: inline-flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.flex-column {
  display: flex;
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

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

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

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

/* Simple grid utilities */
.grid {
  display: grid;
  gap: var(--space-4);
}

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

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

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

/* Visibility - screen reader only */
.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;
}

/* Spacing utilities (limited, for layout tweaks) */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-sm { margin-top: var(--space-2); }
.mb-sm { margin-bottom: var(--space-2); }
.mt-md { margin-top: var(--space-4); }
.mb-md { margin-bottom: var(--space-4); }
.mt-lg { margin-top: var(--space-6); }
.mb-lg { margin-bottom: var(--space-6); }

/* Background helpers */
.bg-elevated {
  background-color: var(--color-bg-elevated);
}

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

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

/* Text helpers */
.text-center {
  text-align: center;
}

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

.text-soft {
  color: var(--color-text-soft);
}

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

/* ========================================================================
   5. Components
   ======================================================================== */

/* Buttons - bold, automotive-inspired */
.button {
  --btn-bg: var(--color-primary);
  --btn-bg-hover: var(--color-primary-strong);
  --btn-color: #ffffff;
  --btn-radius: var(--radius-full);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);

  padding: 0.75rem 1.75rem;
  border-radius: var(--btn-radius);
  border: 1px solid rgba(255, 255, 255, 0.08);

  font-family: var(--font-display);
  font-size: var(--font-size-sm);
  letter-spacing: 0.15em;
  text-transform: uppercase;

  background: linear-gradient(135deg, var(--btn-bg), #aa111a);
  color: var(--btn-color);

  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7), 0 14px 30px rgba(0, 0, 0, 0.85);

  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-base), opacity var(--transition-fast);
}

.button:hover {
  background: linear-gradient(135deg, var(--btn-bg-hover), #ff4f5f);
  transform: translateY(-1px);
  box-shadow: var(--shadow-strong);
  color: #ffffff;
}

.button:active {
  transform: translateY(0);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.8);
}

.button--ghost {
  --btn-bg: transparent;
  --btn-bg-hover: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

.button--ghost:hover {
  background: var(--btn-bg-hover);
  box-shadow: 0 0 0 1px rgba(227, 39, 50, 0.6);
}

.button--secondary {
  --btn-bg: var(--gray-800);
  --btn-bg-hover: #252838;
}

.button[disabled],
.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Inputs - clean, aligned with dark industrial theme */
.input,
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;

  background-color: #06070a;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);

  color: var(--color-text);

  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);
}

.input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary-strong);
  box-shadow: var(--shadow-outline-primary);
  background-color: #05060a;
}

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

/* Card - for sections like events, menu, poker info */
.card {
  position: relative;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top left, rgba(227, 39, 50, 0.15), transparent 55%),
              linear-gradient(145deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.9));
  padding: var(--space-6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent 30%, transparent 70%, rgba(255, 255, 255, 0.04));
  mix-blend-mode: soft-light;
  opacity: 0.15;
}

.card--tight {
  padding: var(--space-4);
}

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

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

.card-subtitle {
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-soft);
}

/* ========================================================================
   6. Accessibility & Motion
   ======================================================================== */

/* focus-visible outline consistent across interactive elements */
:where(a, button, input, textarea, select, summary):focus-visible {
  outline: none;
  box-shadow: var(--shadow-outline-primary);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
