/* =========================================================
   Turavo Market Base Styles
   Modern, clean, premium, black & emerald casino-inspired
   ========================================================= */

/* =========================================================
   1. CSS VARIABLES (Design Tokens)
   ========================================================= */
:root {
  /* Color Palette */
  --color-bg-body: #050607; /* deep cinematic black */
  --color-bg-elevated: #0c1014; /* graphite */
  --color-bg-elevated-soft: rgba(12, 16, 20, 0.8);
  --color-surface-glass: rgba(9, 12, 17, 0.7);
  --color-surface-glass-strong: rgba(9, 12, 17, 0.95);

  --color-text: #f5f5f6; /* main text */
  --color-text-muted: #a3a7b3;
  --color-text-soft: #c0c4d0;

  --color-primary: #14b88a; /* emerald */
  --color-primary-soft: rgba(20, 184, 138, 0.16);
  --color-primary-strong: #11a178;

  --color-accent-gold: #f2c46f; /* warm gold */
  --color-accent-gold-soft: rgba(242, 196, 111, 0.18);

  --color-success: #22c55e;
  --color-warning: #facc15;
  --color-danger: #ef4444;

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

  --border-subtle: rgba(148, 163, 184, 0.25);
  --border-strong: rgba(148, 163, 184, 0.55);

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

  --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.15;
  --line-height-snug: 1.3;
  --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-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */
  --space-20: 5rem;    /* 80px */
  --space-24: 6rem;    /* 96px */

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Shadows (soft neon / event lighting) */
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.55);
  --shadow-strong: 0 22px 60px rgba(0, 0, 0, 0.85);
  --shadow-emerald-glow: 0 0 0 1px rgba(20, 184, 138, 0.45), 0 0 40px rgba(20, 184, 138, 0.35);
  --shadow-gold-glow: 0 0 0 1px rgba(242, 196, 111, 0.4), 0 0 42px rgba(242, 196, 111, 0.35);

  /* Transitions / Motion */
  --transition-fast: 120ms ease-out;
  --transition-base: 180ms ease-out;
  --transition-slow: 260ms ease-out;
  --transition-bounce: 220ms cubic-bezier(0.22, 1, 0.36, 1);

  /* Layout */
  --container-max-width: 1120px;
  --container-padding-x: 1.25rem;
  --header-height: 4.25rem;
}

/* Larger screens: upscale headings slightly */
@media (min-width: 768px) {
  :root {
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
    --font-size-5xl: 3.25rem;
  }
}

/* =========================================================
   2. RESET / NORMALIZE
   ========================================================= */
*, *::before, *::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
}

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

ol, ul {
  padding-left: 1.2em;
}

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

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

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

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

textarea {
  resize: vertical;
}

:focus {
  outline: none;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =========================================================
   3. BASE TYPOGRAPHY & ELEMENTS
   ========================================================= */
body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  background-color: var(--color-bg-body);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  min-height: calc(100vh - var(--header-height));
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-text);
}

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

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

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

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

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

h6 {
  font-size: var(--font-size-base);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

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

p:last-child {
  margin-bottom: 0;
}

small {
  font-size: var(--font-size-xs);
}

strong {
  font-weight: 600;
}

/* Links: subtle, with emerald hover */
a {
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition-base),
              text-shadow var(--transition-base);
}

a:hover {
  color: var(--color-primary);
  text-shadow: 0 0 16px rgba(20, 184, 138, 0.65);
}

a:active {
  color: var(--color-accent-gold);
}

/* =========================================================
   4. ACCESSIBILITY & FOCUS STYLES
   ========================================================= */
:focus-visible {
  outline: 2px solid var(--color-accent-gold);
  outline-offset: 3px;
}

/* High contrast focus ring for dark background */
.is-keyboard-user :focus-visible {
  box-shadow: 0 0 0 1px rgba(5, 5, 5, 0.9), 0 0 0 3px var(--color-accent-gold);
}

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

/* =========================================================
   5. LAYOUT UTILITIES
   ========================================================= */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding-x);
  padding-right: var(--container-padding-x);
}

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

@media (min-width: 768px) {
  .section {
    padding-top: var(--space-16);
    padding-bottom: var(--space-16);
  }
}

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

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

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

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

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

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

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

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

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

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

/* Utility spacing classes (limited, common use) */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-sm { margin-top: var(--space-4); }
.mb-sm { margin-bottom: var(--space-4); }
.mt-md { margin-top: var(--space-6); }
.mb-md { margin-bottom: var(--space-6); }
.mt-lg { margin-top: var(--space-10); }
.mb-lg { margin-bottom: var(--space-10); }

.text-center { text-align: center; }
.text-right { text-align: right; }

/* Subtle neon divider for sections */
.section-divider {
  height: 1px;
  width: 100%;
  background: linear-gradient(90deg,
    transparent,
    rgba(20, 184, 138, 0.65),
    rgba(242, 196, 111, 0.85),
    transparent
  );
  opacity: 0.7;
}

/* =========================================================
   6. FORM ELEMENTS
   ========================================================= */
input,
select,
textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background-color: rgba(9, 11, 16, 0.85);
  color: var(--color-text);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.6);
  transition: border-color var(--transition-base),
              box-shadow var(--transition-base),
              background-color var(--transition-base),
              transform var(--transition-fast);
}

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

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9),
              0 0 0 2px rgba(20, 184, 138, 0.75);
  background-color: rgba(9, 11, 16, 0.95);
  transform: translateY(-1px);
}

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

label {
  display: inline-block;
  margin-bottom: var(--space-1);
  font-size: var(--font-size-sm);
  color: var(--color-text-soft);
}

.field-helper {
  margin-top: 0.25rem;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

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

/* =========================================================
   7. BUTTONS
   ========================================================= */
.button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-size: var(--font-size-sm);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  color: #050607 !important;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent-gold));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.8);
  transition: transform var(--transition-bounce),
              box-shadow var(--transition-bounce),
              background var(--transition-base),
              color var(--transition-base);
}

.button::before,
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.26), transparent 55%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.button:hover::before,
.btn:hover::before {
  opacity: 1;
}

.button:hover,
.btn:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.95);
}

.button:active,
.btn:active {
  transform: translateY(0) scale(0.99);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.9);
}

.button:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--color-accent-gold);
  outline-offset: 3px;
}

.button--ghost,
.btn--ghost {
  background: transparent;
  color: var(--color-text) !important;
  border-color: rgba(148, 163, 184, 0.4);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.85);
  white-space: normal;
  text-align: center;
  line-height: 1.3;
}

.button--ghost:hover,
.btn--ghost:hover {
  background: radial-gradient(circle at top left, rgba(20, 184, 138, 0.22), transparent 70%);
  border-color: var(--color-primary);
}

.button--outline,
.btn--outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.button--outline:hover,
.btn--outline:hover {
  background: var(--color-primary-soft);
}

.button--secondary,
.btn--secondary {
  background: linear-gradient(135deg, #101623, #1f2937);
  color: var(--color-text);
  border-color: rgba(148, 163, 184, 0.45);
}

.button--danger,
.btn--danger {
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #050607;
}

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

/* =========================================================
   8. CARD COMPONENTS (Glass / Casino Feel)
   ========================================================= */
.card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  background: var(--color-surface-glass);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  overflow: hidden;
  transition: transform var(--transition-bounce),
              box-shadow var(--transition-bounce),
              border-color var(--transition-base),
              background var(--transition-base);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(20, 184, 138, 0.22), transparent 40%),
    linear-gradient(315deg, rgba(242, 196, 111, 0.22), transparent 45%);
  opacity: 0.25;
  mix-blend-mode: screen;
  pointer-events: none;
}

.card-hoverable:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-strong);
  border-color: rgba(20, 184, 138, 0.6);
  background: var(--color-surface-glass-strong);
}

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

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

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

.card-body {
  position: relative;
  z-index: 1;
}

/* Compact card variant for chips / small highlights */
.card--compact {
  padding: var(--space-4);
  border-radius: var(--radius-md);
}

/* Neon border card (for CTAs / key offers) */
.card--neon {
  border: 1px solid transparent;
  box-shadow: var(--shadow-emerald-glow);
}

/* =========================================================
   9. HERO / BACKDROP HELPERS (Optional, Reusable)
   ========================================================= */
.hero-backdrop {
  position: relative;
  isolation: isolate;
}

.hero-backdrop::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(20, 184, 138, 0.18), transparent 70%),
    radial-gradient(circle at bottom right, rgba(242, 196, 111, 0.18), transparent 70%),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 65%);
  opacity: 0.9;
  pointer-events: none;
  z-index: -2;
}

.hero-overlay {
  position: relative;
  background: linear-gradient(to bottom, rgba(5, 6, 13, 0.94), rgba(5, 6, 13, 0.96));
}

/* Optional accent line for headings */
.heading-accent {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.heading-accent::before {
  content: "";
  width: 42px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent-gold));
}

/* =========================================================
   10. BADGES / TAGS (for Event Types, Pages like Poker etc.)
   ========================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: var(--color-text-muted);
  background: rgba(10, 16, 24, 0.8);
  backdrop-filter: blur(8px);
}

.badge--primary {
  border-color: rgba(20, 184, 138, 0.8);
  color: var(--color-primary);
  background: rgba(20, 184, 138, 0.08);
}

.badge--gold {
  border-color: rgba(242, 196, 111, 0.9);
  color: var(--color-accent-gold);
  background: rgba(242, 196, 111, 0.1);
}

/* =========================================================
   11. MEDIA HELPERS (Gallery / Cinematic Images)
   ========================================================= */
.media-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.9);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.9);
  background-color: #020617;
}

.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 320ms ease-out, filter 320ms ease-out, opacity 320ms ease-out;
}

.media-frame:hover img {
  transform: scale(1.04);
  filter: saturate(1.15);
}

/* =========================================================
   12. TABLE HELPERS (Rules / Event Flow on Poker Page)
   ========================================================= */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.table th,
.table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
}

.table thead th {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gray-300);
  border-bottom: 1px solid rgba(148, 163, 184, 0.4);
}

.table tbody tr:nth-child(even) {
  background-color: rgba(15, 23, 42, 0.55);
}

.table tbody tr:nth-child(odd) {
  background-color: rgba(15, 23, 42, 0.35);
}

.table tbody tr:hover {
  background-color: rgba(20, 184, 138, 0.06);
}

.table tbody td {
  border-bottom: 1px solid rgba(15, 23, 42, 0.9);
}

/* =========================================================
   13. MISC UTILS
   ========================================================= */
.hidden { display: none !important; }

.uppercase { text-transform: uppercase; }

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

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: radial-gradient(circle at 20% 0%, rgba(242, 196, 111, 0.3), rgba(15, 23, 42, 1));
  border: 1px solid rgba(242, 196, 111, 0.7);
  font-size: var(--font-size-xs);
}
