/* ============================================
   GLOBAL STYLES — RPG Theme
   ============================================ */

:root {
  /* Colors */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1a1f35;
  --bg-card-hover: #232847;
  --text-primary: #e8e6e3;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent-gold: #f59e0b;
  --accent-gold-dim: #b45309;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;
  --border-color: #2d3250;
  --border-glow: rgba(245, 158, 11, 0.3);

  /* Difficulty colors */
  --diff-novice: #10b981;
  --diff-apprenti: #3b82f6;
  --diff-compagnon: #f59e0b;
  --diff-expert: #ef4444;
  --diff-maitre: #f59e0b;

  /* Spacing */
  --nav-height: 60px;

  /* Fonts */
  --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-title: 'Georgia', 'Times New Roman', serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

/* ============================================
   NAVBAR
   ============================================ */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  z-index: 1000;
  gap: 2rem;
}

.nav-logo {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--accent-gold);
  text-decoration: none;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  flex: 1;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: var(--bg-card);
}

.nav-xp {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.xp-badge {
  background: linear-gradient(135deg, var(--accent-gold-dim), var(--accent-gold));
  color: #000;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  white-space: nowrap;
}

.xp-bar-mini {
  width: 80px;
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  overflow: hidden;
}

.xp-fill-mini {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold-dim), var(--accent-gold));
  border-radius: 3px;
  transition: width 0.5s ease;
  width: 0%;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

main {
  padding-top: var(--nav-height);
}

.section-title {
  font-family: var(--font-title);
  font-size: 1.8rem;
  color: var(--accent-gold);
  text-align: center;
  margin-bottom: 2rem;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn-primary {
  display: inline-block;
  padding: 0.85rem 2rem;
  background: linear-gradient(135deg, var(--accent-gold-dim), var(--accent-gold));
  color: #000;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  margin: 0.5rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.btn-secondary {
  display: inline-block;
  padding: 0.85rem 2rem;
  background: transparent;
  color: var(--accent-gold);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border-radius: 8px;
  border: 2px solid var(--accent-gold-dim);
  cursor: pointer;
  transition: all 0.3s;
  margin: 0.5rem;
}

.btn-secondary:hover {
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--accent-gold);
  transform: translateY(-2px);
}

.btn-small {
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* ============================================
   PROGRESS BARS
   ============================================ */

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
}

/* ============================================
   DIFFICULTY BADGES
   ============================================ */

.diff-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.diff-novice { background: rgba(16, 185, 129, 0.15); color: var(--diff-novice); }
.diff-apprenti { background: rgba(59, 130, 246, 0.15); color: var(--diff-apprenti); }
.diff-compagnon { background: rgba(245, 158, 11, 0.15); color: var(--diff-compagnon); }
.diff-expert { background: rgba(239, 68, 68, 0.15); color: var(--diff-expert); }
.diff-maitre { background: rgba(245, 158, 11, 0.2); color: var(--diff-maitre); }

/* ============================================
   QUEST STATUS BADGES
   ============================================ */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-locked { background: rgba(107, 114, 128, 0.2); color: var(--text-muted); }
.status-available { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.status-in-progress { background: rgba(245, 158, 11, 0.15); color: var(--accent-gold); }
.status-completed { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }

/* ============================================
   FOOTER
   ============================================ */

.footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-sub {
  margin-top: 0.3rem;
  font-size: 0.75rem;
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .navbar {
    padding: 0 1rem;
    gap: 1rem;
  }

  .nav-links {
    gap: 0.5rem;
  }

  .nav-link {
    font-size: 0.85rem;
    padding: 0.3rem 0.5rem;
  }

  .xp-bar-mini {
    display: none;
  }

  .section-title {
    font-size: 1.4rem;
  }
}

@media (max-width: 480px) {
  .nav-logo {
    font-size: 1rem;
  }

  .nav-links {
    gap: 0.25rem;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes glow {
  0%, 100% { text-shadow: 0 0 10px rgba(245, 158, 11, 0.5); }
  50% { text-shadow: 0 0 20px rgba(245, 158, 11, 0.8), 0 0 40px rgba(245, 158, 11, 0.3); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.fade-in {
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
}

/* ============================================
   TOAST NOTIFICATIONS (global)
   ============================================ */

.toast-container {
  position: fixed;
  top: calc(var(--nav-height) + 1rem);
  right: 1rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.8rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 250px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.4s ease forwards;
  pointer-events: auto;
}

.toast.toast-xp { border-color: var(--accent-gold-dim); }
.toast.toast-badge { border-color: var(--accent-purple); }

.toast-icon { font-size: 1.5rem; }

.toast-text { flex: 1; }

.toast-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.toast-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100px); }
}

/* ============================================
   ACCESSIBILITY — Reduced motion
   ============================================ */

@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;
  }

  .toast {
    animation: none !important;
    opacity: 1;
  }
}

/* ============================================
   ACCESSIBILITY — Focus visible
   ============================================ */

a:focus-visible, button:focus-visible, input:focus-visible,
[role="button"]:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

/* ============================================
   SKIP LINK (screen readers)
   ============================================ */

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent-gold);
  color: #000;
  padding: 0.5rem 1rem;
  z-index: 10000;
  font-weight: 700;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  top: 0;
}
