/* ===== CSS Variables ===== */
:root {
  /* Colors */
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-secondary: #7c3aed;
  --color-accent: #f59e0b;

  --color-bg: #0f172a;
  --color-bg-light: #1e293b;
  --color-bg-card: #334155;

  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --color-text-dark: #64748b;

  --color-border: #475569;
  --color-success: #22c55e;
  --color-warning: #eab308;
  --color-error: #ef4444;

  /* Rarity colors */
  --rarity-common: #9ca3af;
  --rarity-uncommon: #22c55e;
  --rarity-rare: #3b82f6;
  --rarity-epic: #a855f7;
  --rarity-legendary: #f59e0b;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Typography */
  --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;

  /* Layout */
  --max-width: 1400px;
  --sidebar-width: 280px;
  --header-height: 50px;
  --nav-height: 60px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
}

/* ===== Reset ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }

p {
  margin-bottom: var(--space-md);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent);
}

ul, ol {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== Utility Classes ===== */
.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;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ===== Layout ===== */
.main-content {
  min-height: calc(100vh - var(--header-height) - var(--nav-height) - 200px);
  padding: var(--space-xl) 0;
}

.content-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
  display: flex;
  gap: var(--space-xl);
}

.content {
  flex: 1;
  min-width: 0;
}

.content.with-sidebar {
  max-width: calc(100% - var(--sidebar-width) - var(--space-xl));
}

/* ===== Tables ===== */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-lg);
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
}

th, td {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  background: var(--color-bg-light);
  font-weight: 600;
  color: var(--color-text);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--font-size-base);
  font-weight: 500;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
}

.btn-secondary {
  background: var(--color-bg-card);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-bg-light);
}

/* ===== Video Container ===== */
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin-bottom: var(--space-lg);
  border-radius: var(--radius-md);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ===== Details/Summary ===== */
details {
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

summary {
  padding: var(--space-md);
  cursor: pointer;
  font-weight: 500;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: '+';
  margin-right: var(--space-sm);
  font-weight: bold;
}

details[open] summary::before {
  content: '-';
}

details > *:not(summary) {
  padding: 0 var(--space-md) var(--space-md);
}

/* ===== Tags/Badges ===== */
.tag, .badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-sm);
  background: var(--color-bg-light);
}

.level-badge {
  background: var(--color-primary);
  color: white;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  margin-right: var(--space-xs);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .content-wrapper {
    flex-direction: column;
  }

  .content.with-sidebar {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  :root {
    --font-size-3xl: 1.75rem;
    --font-size-2xl: 1.375rem;
  }

  .content-wrapper {
    padding: 0 var(--space-sm);
  }
}
