/* ========================================================================
   VELKARYN Base Styles
   Modern fantasy gaming platform – global base CSS
   ======================================================================== */

/* ========================================================================
   1. CSS Variables (Design Tokens)
   ======================================================================== */
:root {
  /* Color Palette */
  --color-bg: #050814; /* Deep space / fantasy night */
  --color-bg-elevated: #0b1024;
  --color-bg-muted: #11172f;

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

  --color-primary: #7c5cff; /* Arcane violet */
  --color-primary-soft: rgba(124, 92, 255, 0.18);
  --color-primary-strong: #a887ff;

  --color-success: #1dd89b;
  --color-warning: #ffb347;
  --color-danger: #ff4e6a;

  /* Neutral Grays (used mainly for borders / subtle text) */
  --color-gray-50: #f9fafb;
  --color-gray-100: #edf1f7;
  --color-gray-200: #d7dcec;
  --color-gray-300: #b8c0de;
  --color-gray-400: #8b94c0;
  --color-gray-500: #6b7399;
  --color-gray-600: #4b5273;
  --color-gray-700: #343952;
  --color-gray-800: #1f2336;
  --color-gray-900: #111320;

  /* Borders & Outlines */
  --color-border-subtle: rgba(255, 255, 255, 0.06);
  --color-border-strong: rgba(255, 255, 255, 0.14);
  --color-focus-outline: #ffca5c; /* Golden highlight for focus */

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

  /* Font Sizes (desktop base: 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 Heights */
  --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: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 999px;

  /* Shadows (fantasy / neon-ish) */
  --shadow-xs: 0 0 0 1px rgba(255, 255, 255, 0.02);
  --shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.55);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 40px rgba(124, 92, 255, 0.25);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 60px rgba(0, 255, 209, 0.25);

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

  /* Layout */
  --layout-max-width: 1120px;
  --layout-gutter: var(--space-4);
}

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

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

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

body {
  min-height: 100vh;
}

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

img,
video {
  height: auto;
}

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

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

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

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

/* Remove default link underline, handled in base section */
a {
  text-decoration: none;
  color: inherit;
}

/* ========================================================================
   3. Base Styles
   ======================================================================== */
body {
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
  background-color: radial-gradient(circle at top, #151a3b 0, #050814 55%, #01020a 100%);
  background-color: #050814; /* fallback */
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

main {
  min-height: 60vh;
}

/* Headings (used for immersive, game-like hero typography) */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text);
}

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

h2 {
  font-size: clamp(1.75rem, 2.4vw + 1rem, 2.4rem);
  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;
  margin-bottom: var(--space-2);
}

h5 {
  font-size: 1.125rem;
  margin-bottom: var(--space-1);
}

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

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

strong,
b {
  font-weight: 600;
  color: var(--color-text);
}

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

/* Links – subtle neon hover for fantasy look */
a {
  color: var(--color-primary-strong);
  transition: color var(--transition-normal), text-shadow var(--transition-normal);
}

a:hover,
a:focus-visible {
  color: #ffffff;
  text-shadow: 0 0 12px rgba(124, 92, 255, 0.7);
}

/* Code / preformatted */
code,
pre {
  font-family: var(--font-mono);
}

/* ========================================================================
   4. Accessibility & Motion
   ======================================================================== */

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

:focus {
  outline: none;
}

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

/* 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. Utilities
   ======================================================================== */

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

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

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

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

/* 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 (common ones) */
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }
.py-4 { padding-block: var(--space-4); }
.py-8 { padding-block: var(--space-8); }
.px-4 { padding-inline: var(--space-4); }

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

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

/* Button (primary, secondary, subtle variants) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding-inline: 1.4rem;
  padding-block: 0.7rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: var(--font-size-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
  background: linear-gradient(135deg, #7c5cff, #1dd89b);
  color: #050814;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), filter var(--transition-fast);
}

.btn:hover {
  transform: translateY(-1px) scale(1.01);
  filter: brightness(1.05);
  box-shadow: var(--shadow-lg);
}

.btn:active {
  transform: translateY(0) scale(0.99);
  box-shadow: var(--shadow-sm);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: var(--shadow-xs);
}

.btn-secondary {
  background: rgba(8, 15, 40, 0.9);
  color: var(--color-text);
  border-color: rgba(124, 92, 255, 0.5);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.4), 0 12px 30px rgba(0, 0, 0, 0.7);
}

.btn-secondary:hover {
  background: rgba(16, 24, 64, 0.95);
}

.btn-subtle {
  background: transparent;
  color: var(--color-text-muted);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.btn-subtle:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-text);
}

/* Input & Form Controls */
.input,
select,
textarea {
  width: 100%;
  padding-inline: var(--space-3);
  padding-block: 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background-color: rgba(3, 8, 30, 0.9);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: 1.4;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.01);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal), background-color var(--transition-normal);
}

.input::placeholder,
textarea::placeholder {
  color: var(--color-gray-500);
}

.input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--color-primary-strong);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.9), 0 0 0 4px rgba(124, 92, 255, 0.25);
  outline: none;
}

.input[aria-invalid="true"],
.input--error {
  border-color: var(--color-danger);
}

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

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

.form-field {
  margin-bottom: var(--space-4);
}

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

/* Card – used for lobbies, rankings, fantasy squads etc. */
.card {
  position: relative;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top left, rgba(124, 92, 255, 0.14), transparent 60%),
              radial-gradient(circle at bottom right, rgba(29, 216, 155, 0.12), transparent 55%),
              var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.04), transparent 60%);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow);
}

.card:hover::before {
  opacity: 1;
}

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

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

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

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

/* Tag / Pill (for status, role, rank) */
.badge {
  display: inline-flex;
  align-items: center;
  padding-inline: 0.6rem;
  padding-block: 0.15rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(6, 16, 40, 0.85);
}

.badge--success { border-color: var(--color-success); color: var(--color-success); }
.badge--danger { border-color: var(--color-danger); color: var(--color-danger); }
.badge--warning { border-color: var(--color-warning); color: var(--color-warning); }

/* Simple navigation link style for header */
.nav-link {
  position: relative;
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  padding-block: 0.25rem;
}

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

.nav-link:hover,
.nav-link[aria-current="page"] {
  color: var(--color-text);
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
  width: 100%;
}

/* Simple chip-like element for stats (e.g., puan, seviye) */
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding-inline: 0.8rem;
  padding-block: 0.3rem;
  border-radius: var(--radius-full);
  background: rgba(6, 16, 40, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: var(--font-size-xs);
}

.stat-pill__value {
  font-weight: 600;
  color: var(--color-primary-strong);
}

/* ========================================================================
   End of Base CSS
   ======================================================================== */
