/* ==================================================================
   Biuro Podatkowe FOP Lilla Borowska - Base Styles
   ================================================================== */

/* ==================================================================
   1. CSS Variables (Design Tokens)
   ================================================================== */
:root {
  /* Color Palette */
  --color-bg: #050714; /* deep night sky */
  --color-bg-elevated: #0b0f24;
  --color-bg-soft: #101632;
  --color-text: #f5f5ff;
  --color-text-muted: #a4accc;

  /* Magical Core Colors */
  --color-primary: #5c7bff; /* arcane blue */
  --color-primary-soft: rgba(92, 123, 255, 0.14);
  --color-primary-strong: #7f8dff;

  --color-accent-purple: #a855ff;
  --color-accent-emerald: #2dd4bf;
  --color-accent-gold: #facc15;

  --color-success: #22c55e;
  --color-warning: #eab308;
  --color-danger: #f97373;

  /* Neutral Grays (cool/fantasy) */
  --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, "Segoe UI", sans-serif;
  --font-display: "Cinzel", "Trajan Pro", Georgia, serif; /* epic / fantasy influenced */

  --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 */
  --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-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: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Shadows (magical glow inspired) */
  --shadow-soft: 0 14px 45px rgba(4, 6, 24, 0.55);
  --shadow-strong: 0 0 60px rgba(88, 142, 255, 0.45);
  --shadow-gold: 0 0 40px rgba(250, 204, 21, 0.35);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-base: 200ms ease-out;
  --transition-slow: 320ms ease-out;

  /* Layout */
  --container-max-width: 1200px;
}

@media (min-width: 768px) {
  :root {
    --font-size-3xl: 2.25rem; /* 36px */
    --font-size-4xl: 3rem;    /* 48px */
    --font-size-5xl: 3.75rem; /* 60px */
  }
}

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

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
}

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

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
 h2,
 h3,
 h4,
 h5,
 h6,
 p {
  margin: 0;
}

a {
  color: inherit;
}

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

/* ==================================================================
   3. Base Typography & Layout
   ================================================================== */
body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  background: radial-gradient(circle at top, #1b2250 0, #050714 55%, #02030a 100%);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

main {
  min-height: 60vh;
}

/* Headings - cinematic, fantasy feel */
h1,
.h1 {
  font-family: var(--font-display);
  font-size: var(--font-size-4xl);
  line-height: var(--line-height-tight);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

h2,
.h2 {
  font-family: var(--font-display);
  font-size: var(--font-size-3xl);
  line-height: var(--line-height-snug);
  letter-spacing: 0.04em;
}

h3,
.h3 {
  font-family: var(--font-display);
  font-size: var(--font-size-2xl);
  line-height: var(--line-height-snug);
}

h4,
.h4 {
  font-size: var(--font-size-xl);
}

h5,
.h5 {
  font-size: var(--font-size-lg);
}

h6,
.h6 {
  font-size: var(--font-size-base);
}

h1,
 h2,
 h3,
 h4,
 h5,
 h6 {
  font-weight: 600;
  margin-bottom: var(--space-3);
}

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

strong {
  font-weight: 600;
}

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

a:hover {
  color: var(--color-accent-gold);
  text-shadow: 0 0 14px rgba(250, 204, 21, 0.55);
}

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

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

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

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

.flex-row {
  flex-direction: row;
}

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

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

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

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

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

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

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

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

/* Spacing Utilities (margin / padding shorthand) */
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.pt-8 { padding-top: var(--space-8); }
.pb-8 { padding-bottom: var(--space-8); }
.pt-12 { padding-top: var(--space-12); }
.pb-12 { padding-bottom: var(--space-12); }

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

/* 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. Accessibility & Focus
   ================================================================== */

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

/* Better focus ring for dark background */
.focus-ring {
  position: relative;
}

.focus-ring:focus-visible::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.8), 0 0 0 3px var(--color-accent-gold);
  pointer-events: none;
}

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

/* Buttons - epic CTAs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: var(--font-size-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(148, 163, 253, 0.1), rgba(129, 140, 248, 0.25));
  color: var(--color-text);
  transition: background var(--transition-base), transform var(--transition-fast), box-shadow var(--transition-base), border-color var(--transition-base);
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(250, 204, 21, 0.45), transparent 55%);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(135deg, #4f46e5, #8b5cf6);
  border-color: rgba(129, 140, 248, 0.5);
  box-shadow: var(--shadow-soft);
}

.btn-secondary {
  background: radial-gradient(circle at top, rgba(45, 212, 191, 0.16), rgba(15, 23, 42, 0.9));
  border-color: rgba(45, 212, 191, 0.5);
}

.btn-ghost {
  background: transparent;
  border-color: rgba(148, 163, 253, 0.4);
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-strong);
}

.btn:hover:not(:disabled)::before {
  opacity: 1;
}

.btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: var(--shadow-soft);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

/* Inputs & Form Controls */
.input,
textarea,
select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 253, 0.35);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.9));
  color: var(--color-text);
  font-size: var(--font-size-sm);
  transition: border-color var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
}

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

.input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  border-color: var(--color-accent-emerald);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.95), 0 0 0 3px rgba(45, 212, 191, 0.45);
  outline: none;
}

.field-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text);
}

.field-help {
  margin-top: var(--space-1);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* Card - used for sections like Heroes, Creatures, News */
.card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.18), transparent 55%),
              linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(148, 163, 253, 0.4);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at top right, rgba(168, 85, 247, 0.3), transparent 55%);
  opacity: 0;
  transition: opacity var(--transition-slow), transform var(--transition-slow);
  transform: translate3d(-10px, -10px, 0);
  pointer-events: none;
}

.card:hover::before {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

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

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

/* Hero / Cinematic Background Helpers (optional) */
.hero-full {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  color: var(--color-text);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: saturate(1.15) contrast(1.05);
  z-index: -2;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(129, 140, 248, 0.65), transparent 55%),
              linear-gradient(to bottom, rgba(5, 7, 20, 0.85), rgba(5, 7, 20, 0.98));
  mix-blend-mode: soft-light;
  z-index: -1;
}

/* Subtle floating particle effect container */
.particles-soft {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Basic tag / pill for categories like Quests, News, etc. */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(129, 140, 248, 0.65);
  font-size: var(--font-size-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  background: radial-gradient(circle at top, rgba(129, 140, 248, 0.15), transparent 65%);
}

/* ==================================================================
   7. Media & Layout Adjustments
   ================================================================== */

@media (min-width: 768px) {
  .hero-full {
    min-height: 90vh;
  }
}

@media (max-width: 640px) {
  h1,
  .h1 {
    font-size: var(--font-size-3xl);
  }

  .btn {
    width: 100%;
  }
}
