/* =========================================
   Trevio Space Base Styles
   ========================================= */

/* =========================================
   1. CSS Variables (Design Tokens)
   ========================================= */
:root {
  /* Color Palette */
  --color-bg: #05070c; /* główne tło, bardzo ciemny granat/czerń */
  --color-surface: #0c1018; /* karty, panele */
  --color-surface-alt: #121826;

  --color-text: #f5f7ff;
  --color-text-muted: #a5b0c6;

  --color-primary: #4f46e5; /* fiolet / indygo - nowoczesny akcent */
  --color-primary-soft: rgba(79, 70, 229, 0.12);
  --color-primary-strong: #3730a3;

  --color-success: #10b981;
  --color-success-soft: rgba(16, 185, 129, 0.12);

  --color-warning: #f59e0b;
  --color-warning-soft: rgba(245, 158, 11, 0.12);

  --color-danger: #ef4444;
  --color-danger-soft: rgba(239, 68, 68, 0.12);

  /* Neutral Grays */
  --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;

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

  /* Font Sizes (desktop base 16px) */
  --fs-xs: 0.75rem;   /* 12px */
  --fs-sm: 0.875rem;  /* 14px */
  --fs-base: 1rem;    /* 16px */
  --fs-lg: 1.125rem;  /* 18px */
  --fs-xl: 1.25rem;   /* 20px */
  --fs-2xl: 1.5rem;   /* 24px */
  --fs-3xl: 1.875rem; /* 30px */
  --fs-4xl: 2.25rem;  /* 36px */
  --fs-5xl: 3rem;     /* 48px */

  /* Line Heights */
  --lh-tight: 1.2;
  --lh-snug: 1.35;
  --lh-normal: 1.5;
  --lh-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-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: 0.125rem; /* 2px */
  --radius-sm: 0.25rem;  /* 4px */
  --radius-md: 0.5rem;   /* 8px */
  --radius-lg: 0.75rem;  /* 12px */
  --radius-xl: 1rem;     /* 16px */
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 14px 35px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 55px rgba(0, 0, 0, 0.6);

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

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-base: 0ms;
    --transition-slow: 0ms;
  }

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

/* =========================================
   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,
figure,
blockquote,
ul,
ol,
li,
dl,
dt,
dd {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: none;
  border-radius: 0;
}

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

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

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

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

main {
  min-height: 60vh;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--color-text);
}

h1 {
  font-size: clamp(var(--fs-3xl), 4vw, var(--fs-5xl));
  margin-bottom: var(--space-4);
}

h2 {
  font-size: clamp(var(--fs-2xl), 3vw, var(--fs-4xl));
  margin-bottom: var(--space-3);
}

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

h4 {
  font-size: var(--fs-lg);
  margin-bottom: var(--space-2);
}

p {
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

strong {
  font-weight: 600;
}

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

/* Links */
a {
  position: relative;
  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;
}

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

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

.sr-only-focusable:active,
.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* =========================================
   5. Layout Utilities
   ========================================= */
/* Container with comfortable max-width for event listings & opis oferty */
.container {
  width: 100%;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

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

/* Spacing utilities (basic set for layout) */
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-4 { margin-top: var(--space-4) !important; }
.mb-4 { margin-bottom: var(--space-4) !important; }
.mt-8 { margin-top: var(--space-8) !important; }
.mb-8 { margin-bottom: var(--space-8) !important; }

/* 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-col {
  display: flex;
  flex-direction: column;
}

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

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

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

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

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

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

/* Width utilities */
.w-full { width: 100%; }

/* =========================================
   6. Basic Components
   ========================================= */
/* Buttons - primary CTA (e.g., "Dołącz do turnieju", "Zarezerwuj stolik") */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  border: 1px solid transparent;
  transition:
    background-color var(--transition-base),
    color var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), #7c3aed);
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.4);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(79, 70, 229, 0.55);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-text);
  border-color: rgba(148, 163, 184, 0.5);
}

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

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

.btn-ghost:hover {
  color: var(--color-text);
  background-color: rgba(15, 23, 42, 0.7);
}

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

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

/* Inputs & form fields (rezerwacje, formularze udziału) */
.input,
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.4);
  background-color: rgba(15, 23, 42, 0.85);
  color: var(--color-text);
  font-size: var(--fs-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-muted);
}

.input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary-soft), 0 0 0 4px rgba(79, 70, 229, 0.4);
}

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

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

label {
  display: inline-block;
  font-size: var(--fs-sm);
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

/* Card component - dla opisów turniejów, pakietów, stref */
.card {
  position: relative;
  background: radial-gradient(circle at top left, rgba(79, 70, 229, 0.12), transparent 55%),
    var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
}

.card--soft {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

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

.card-title {
  font-size: var(--fs-xl);
  margin-bottom: 0.25rem;
}

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

.card:hover {
  border-color: rgba(79, 70, 229, 0.7);
}

/* Tag / pill for formats like "Texas Hold'em", "Sit & Go", etc. */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background-color: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: var(--color-text-muted);
}

.tag--primary {
  background-color: var(--color-primary-soft);
  border-color: rgba(79, 70, 229, 0.7);
  color: var(--color-text);
}

/* Status badges for events ("Na żywo", "Nadchodzący", "Zakończony") */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 500;
}

.badge-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: var(--radius-full);
}

.badge--live {
  background-color: var(--color-danger-soft);
  color: var(--color-danger);
}

.badge--live .badge-dot {
  background-color: var(--color-danger);
}

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

.badge--ended {
  background-color: rgba(15, 23, 42, 0.9);
  color: var(--color-text-muted);
}

/* =========================================
   7. Helpers Specific to Trevio Space Theme
   ========================================= */
/* Section spacing */
.section {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

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

.section-header {
  margin-bottom: var(--space-8);
}

.section-kicker {
  font-size: var(--fs-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(var(--fs-2xl), 3.2vw, var(--fs-4xl));
  margin-bottom: 0.5rem;
}

.section-subtitle {
  max-width: 36rem;
}

/* Subtle gradient borders for interactive zones */
.border-gradient {
  position: relative;
}

.border-gradient::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.9), rgba(16, 185, 129, 0.6));
  -webkit-mask: 
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Hero style background for główna strona */
.hero-section {
  position: relative;
  padding-top: var(--space-20);
  padding-bottom: var(--space-16);
  overflow: hidden;
}

.hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(79, 70, 229, 0.42), transparent 55%),
    radial-gradient(circle at 80% 10%, rgba(16, 185, 129, 0.24), transparent 55%);
  opacity: 0.8;
  pointer-events: none;
}

.hero-section > * {
  position: relative;
  z-index: 1;
}

/* Navigation helpers */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: linear-gradient(to bottom, rgba(5, 7, 12, 0.97), rgba(5, 7, 12, 0.8));
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  padding: 0.25rem 0;
  position: relative;
}

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

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

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

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

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

/* Footer baseline */
.site-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.9), rgba(5, 7, 12, 1));
}

.site-footer p {
  margin-bottom: 0;
}

/* =========================================
   8. Misc Small Utilities
   ========================================= */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

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

.badge-uppercase { text-transform: uppercase; letter-spacing: 0.08em; }

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

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.hide-on-mobile {
  display: block;
}

@media (max-width: 640px) {
  .hide-on-mobile {
    display: none !important;
  }
}

.show-on-mobile {
  display: none;
}

@media (max-width: 640px) {
  .show-on-mobile {
    display: block !important;
  }
}
