/* ===== VARIABLES CSS ===== */
:root {
  --primary-color: #00ff41;
  --secondary-color: #00ff65;
  --glass-bg: rgba(0, 0, 0, 0.4);
  --glass-border: rgba(0, 255, 65, 0.3);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.8);
  --shadow-glow: 0 0 8px rgba(0, 255, 65, 0.6);
  --backdrop-blur: blur(8px);
  --color-locked: #ff4136; /* Rouge pour bloqué/non résolu */
  --color-solved: #00ff41; /* Vert pour résolu */
}

html {
  box-sizing: border-box;
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

html,
body {
  background-color: #000;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  /* Gradient background subtil */
  background: radial-gradient(ellipse at center, #0a0a0a 0%, #000000 100%);
  overflow-x: hidden;
  overflow-y: auto;
}


/* Pages */
.page {
  display: none;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 3;
}

.page.active {
  display: block;
}

/* Masquer l'image phacochère sur la page countdown */
#countdown-page .chat-container {
  display: none;
}

/* Page content styles */
.page-content {
  background: rgba(0, 0, 0, 0.95) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 15px;
  padding: 30px;
  margin: 20px;
  margin-bottom: 100px;
  border: 1px solid rgba(0, 255, 0, 0.3);
  box-shadow: 0 8px 32px rgba(0, 255, 0, 0.1);
  min-height: calc(100vh - 160px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
}

.page-content h1 {
  color: var(--primary-color);
  font-size: 2.5rem;
  margin-bottom: 20px;
  text-align: center;
  text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.page-content p {
  color: var(--text-primary);
  font-size: 1.2rem;
  line-height: 1.6;
  text-align: center;
  margin-bottom: 30px;
}

/* Fragments page styles */
.fragments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  width: 100%;
  max-width: 800px;
}

/* Page fragments en mode plein écran */
.page-fragments .fragments-grid {
  position: relative;
  z-index: 2;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  width: min(900px, 90vw);
  margin: 40px auto 120px auto;
  padding: 0 10px;
}

.fragment-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.fragment-modal.visible {
  opacity: 1;
  pointer-events: all;
}

.fragment-modal-dialog {
  position: relative;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(0, 255, 0, 0.3);
  border-radius: 16px;
  padding: 20px;
  max-width: 600px;
  width: min(90vw, 600px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fragment-modal-image {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(0, 255, 0, 0.2);
  object-fit: cover;
  max-height: 60vh;
}

.fragment-modal-caption {
  text-align: center;
  color: var(--text-primary);
  font-size: 1rem;
  letter-spacing: 0.05em;
}

.fragment-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.fragment-modal-close:hover {
  color: var(--primary-color);
}

.fragment-modal-backdrop {
  position: absolute;
  inset: 0;
}

.fragment-modal > .fragment-modal-dialog {
  position: relative;
  z-index: 2;
}

.fragment-modal > .fragment-modal-backdrop {
  z-index: 1;
}

.fragment-open-btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: var(--primary-color);
}

.fragment-open-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.fragment-locked-btn {
  background: rgba(255, 0, 0, 0.15);
  color: rgba(255, 100, 100, 0.9);
  border: 1px solid rgba(255, 0, 0, 0.4);
  font-family: 'Courier New', Courier, monospace;
  letter-spacing: 1px;
}

.fragment-locked-btn:hover {
  background: rgba(255, 0, 0, 0.25);
  box-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
}

.fragment-locked-btn.unlocking {
  transition: all 0.6s ease;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: var(--primary-color);
}

.fragment-modal-open {
  overflow: hidden;
}
.fragment-item {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(0, 255, 0, 0.25);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.3s ease, border-color 0.3s ease,
    background 0.3s ease;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.fragment-item:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 255, 65, 0.5);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55),
    0 0 20px rgba(0, 255, 0, 0.25);
}

.fragment-item img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 15px;
  border: 2px solid rgba(0, 255, 65, 0.3);
  transition: all 0.3s ease;
}

.fragment-item:hover img {
  border-color: var(--primary-color);
  box-shadow: 0 0 15px rgba(0, 255, 65, 0.5);
}

.fragment-item h3 {
  color: var(--primary-color);
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.fragment-item p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.fragment-item.selected {
  border-color: var(--primary-color);
  box-shadow: 0 0 25px rgba(0, 255, 65, 0.45),
    0 18px 45px rgba(0, 0, 0, 0.6);
}

.fragment-select-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--primary-color);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  font-family: inherit;
}

.fragment-select-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
  transform: translateY(-2px);
}

.fragment-select-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


/* Localisation page styles */
.location-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  width: 100%;
  max-width: 800px;
}

.location-item {
  background: rgba(0, 255, 0, 0.1);
  border: 1px solid rgba(0, 255, 0, 0.3);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
}

.location-item:hover {
  background: rgba(0, 255, 0, 0.2);
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.location-item img {
  width: 60px;
  height: 60px;
  margin-bottom: 15px;
}

.location-item h3 {
  color: var(--primary-color);
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.location-item p {
  color: var(--text-primary);
  font-size: 1rem;
  margin: 0;
}

/* Styles pour les pages de contenu - override pour permettre scroll */
.page-content {
  background: rgba(0, 0, 0, 0.95) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 40px 20px;
  text-align: center;
  color: var(--text-primary);
  min-height: calc(100vh - 160px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  overflow-y: visible;
}

.page-content h1 {
  color: var(--primary-color);
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
  margin-bottom: 20px;
  font-size: 2rem;
}

.page-content p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.1rem;
}

/* Styles pour l'image locost */
.locost-container {
  position: absolute;
  top: calc(50% - 200px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  text-align: center;
}

.locost-image {
  max-width: 200px;
  max-height: 150px;
  width: auto;
  height: auto;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.locost-image:hover {
  transform: scale(1.05);
}

ul#countdown {
  position: relative;
  top: 50%;
  transform: translateY(-50%);
  width: 50%;
  margin: 0 auto;
  padding: 20px 0 25px 0;
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  border-width: 1px 0;
  overflow: hidden;
  font-family: "Arial Narrow", Arial, sans-serif;
  font-weight: bold;
  list-style: none;
  display: flex;
  justify-content: space-around;
  border-radius: 12px;
  /* Effet glass plus prononcé */
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  z-index: 5;
  /* Effet glow plus intense */
  box-shadow: 0 0 8px rgba(0, 255, 65, 0.6), 0 0 16px rgba(0, 255, 65, 0.4),
    0 0 32px rgba(0, 255, 65, 0.2), inset 0 1px 0 rgba(0, 255, 65, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  animation: smoothGlow 3s ease-in-out infinite alternate;
}

/* Animation glow smooth et élégante */
@keyframes smoothGlow {
  from {
    box-shadow: 0 0 8px rgba(0, 255, 65, 0.6), 0 0 16px rgba(0, 255, 65, 0.4),
      0 0 32px rgba(0, 255, 65, 0.2), inset 0 1px 0 rgba(0, 255, 65, 0.3),
      inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  }
  to {
    box-shadow: 0 0 12px rgba(0, 255, 65, 0.8), 0 0 24px rgba(0, 255, 65, 0.6),
      0 0 48px rgba(0, 255, 65, 0.3), inset 0 1px 0 rgba(0, 255, 65, 0.4),
      inset 0 -1px 0 rgba(0, 0, 0, 0.3);
  }
}

ul#countdown li {
  margin: 0 -3px 0 0;
  padding: 0;
  display: inline-block;
  width: 25%;
  font-size: 72px;
  font-size: 6vw;
  text-align: center;
  position: relative;
  /* Effet glow plus intense sur les chiffres */
  text-shadow: 0 0 4px rgba(0, 255, 65, 0.8), 0 0 8px rgba(0, 255, 65, 0.6),
    0 0 16px rgba(0, 255, 65, 0.4), 0 0 24px rgba(0, 255, 65, 0.2);
  animation: numberSmoothGlow 4s ease-in-out infinite alternate;
  transition: all 0.3s ease;
}

/* Animation glow smooth pour les chiffres */
@keyframes numberSmoothGlow {
  from {
    text-shadow: 0 0 4px rgba(0, 255, 65, 0.8), 0 0 8px rgba(0, 255, 65, 0.6),
      0 0 16px rgba(0, 255, 65, 0.4), 0 0 24px rgba(0, 255, 65, 0.2);
  }
  to {
    text-shadow: 0 0 6px rgba(0, 255, 65, 1), 0 0 12px rgba(0, 255, 65, 0.8),
      0 0 24px rgba(0, 255, 65, 0.6), 0 0 36px rgba(0, 255, 65, 0.3);
  }
}

ul#countdown li .label {
  color: #adafb2;
  font-size: 18px;
  font-size: 1.5vw;
  text-transform: uppercase;
  /* Effet glow plus visible sur les labels */
  text-shadow: 0 0 2px rgba(0, 255, 65, 0.6), 0 0 4px rgba(0, 255, 65, 0.4),
    0 0 8px rgba(0, 255, 65, 0.2);
  animation: labelSmoothGlow 6s ease-in-out infinite alternate;
  transition: all 0.3s ease;
}

/* Animation glow smooth pour les labels */
@keyframes labelSmoothGlow {
  from {
    text-shadow: 0 0 2px rgba(0, 255, 65, 0.6), 0 0 4px rgba(0, 255, 65, 0.4),
      0 0 8px rgba(0, 255, 65, 0.2);
  }
  to {
    text-shadow: 0 0 3px rgba(0, 255, 65, 0.8), 0 0 6px rgba(0, 255, 65, 0.6),
      0 0 12px rgba(0, 255, 65, 0.3);
  }
}

/* =========================
   Terminal Chatbot Styles
========================= */
.page-chatbot {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: 'Roboto Mono', monospace;
  background: transparent;
  color: #c3e88d;
  position: relative;
  padding: 20px 16px 90px 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.terminal-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: hidden;
  z-index: 5;
  margin-bottom: 24px;
}

.terminal-chat__log {
  flex: 1;
  padding: 8px 14px 70px 14px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  overflow-y: auto;
  min-height: 0;
  background: linear-gradient(120deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.08));
  border-radius: 12px;
  border: 1px solid rgba(0, 255, 65, 0.15);
}

.terminal-message {
  width: 100%;
  line-height: 1.35;
  font-size: 0.78rem;
  animation: fadeIn 0.4s ease;
  white-space: pre-wrap;
  word-break: break-word;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: rgba(255, 255, 255, 0.95);
  text-align: left;
}

.terminal-message .prefix {
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.08em;
  flex-shrink: 0;
  text-align: left;
}

.terminal-message.user .prefix {
  color: #32c8ff;
}

.terminal-message.ai .prefix {
  color: #55ff8a;
}

.terminal-message.system {
  color: rgba(255, 255, 255, 0.75);
  font-style: italic;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  opacity: 0.8;
}

.terminal-message.system .prefix {
  display: none;
}

.command-hint {
  color: #32c8ff;
  font-weight: 500;
}

.command-hint.fragment {
  color: #55ff8a;
}

.terminal-message.error .prefix {
  color: #ff8f8f;
}

.terminal-chat__form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  margin-top: 2px;
  margin-bottom: 4px;
}

.terminal-chat__prompt {
  color: #82aaff;
  font-size: 0.9rem;
}

.terminal-chat__input {
  flex: 1;
  background: transparent;
  border: none;
  color: #f5f5f5;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.9rem;
  outline: none;
  padding: 6px 0;
}

.terminal-chat__input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.terminal-chat__cursor {
  width: 2px;
  height: 0.9rem;
  background: #82aaff;
  animation: blink 1s step-end infinite;
}

.terminal-chat__input:focus + .terminal-chat__cursor {
  display: none;
}

.terminal-thinking {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.terminal-thinking .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1s ease-in-out infinite;
}

.terminal-thinking .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.terminal-thinking .dot:nth-child(3) {
  animation-delay: 0.4s;
}

.terminal-chat__log::-webkit-scrollbar {
  width: 6px;
}

.terminal-chat__log::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50px;
}

/* Navbar mobile */
.navbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(0, 255, 65, 0.4);
  display: flex;
  justify-content: space-around;
  padding: 12px 0;
  z-index: 1000;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  /* Force font consistency across pages */
  font-family: 'Arial', sans-serif;
  line-height: 1.2;
  /* Effet glass avec bordure néon */
  border-radius: 20px 20px 0 0;
  box-shadow: 
    0 -4px 20px rgba(0, 255, 65, 0.3),
    0 -8px 40px rgba(0, 255, 65, 0.2),
    inset 0 1px 0 rgba(0, 255, 65, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3);
  animation: navbarGlassGlow 6s ease-in-out infinite alternate;
}

/* Animation glass glow pour la navbar */
@keyframes navbarGlassGlow {
  from {
    box-shadow: 
      0 -4px 20px rgba(0, 255, 65, 0.3),
      0 -8px 40px rgba(0, 255, 65, 0.2),
      inset 0 1px 0 rgba(0, 255, 65, 0.2),
      inset 0 -1px 0 rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(0, 255, 65, 0.4);
  }
  to {
    box-shadow: 
      0 -6px 30px rgba(0, 255, 65, 0.5),
      0 -12px 60px rgba(0, 255, 65, 0.3),
      inset 0 1px 0 rgba(0, 255, 65, 0.3),
      inset 0 -1px 0 rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(0, 255, 65, 0.6);
  }
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 50px;
  border-radius: 6px;
  position: relative;
}

.nav-item.active {
  color: var(--text-primary);
  background: rgba(0, 255, 65, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  box-shadow: 
    0 0 8px rgba(0, 255, 65, 0.4), 
    inset 0 1px 0 rgba(0, 255, 65, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(0, 255, 65, 0.3);
}

.nav-item.active .nav-icon {
  background: rgba(0, 255, 65, 0.2);
  border: 1px solid rgba(0, 255, 65, 0.4);
  box-shadow: 0 0 8px rgba(0, 255, 65, 0.4);
}

.nav-item.locked {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.6);
}

.nav-item:not(.active) {
  color: #666;
}

.nav-icon {
  font-size: 18px;
  margin-bottom: 3px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(0, 255, 65, 0.1);
  border: 1px solid rgba(0, 255, 65, 0.2);
  box-shadow: 0 0 4px rgba(0, 255, 65, 0.2);
}

.nav-icon img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

/* Réduire légèrement la taille du phacochère qui est visuellement trop gros */
.nav-icon img[alt="Phacochère"] {
  width: 18px;
  height: 18px;
}

.nav-label {
  font-size: 12px !important;
  font-family: 'Arial';
  text-align: center;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.nav-item:hover {
  color: var(--text-primary);
  transform: translateY(-2px);
  background: rgba(0, 255, 65, 0.05);
  /* Effet glow smooth au hover */
  text-shadow: 0 0 2px rgba(0, 255, 65, 0.4), 0 0 4px rgba(0, 255, 65, 0.2);
  box-shadow: 0 0 6px rgba(0, 255, 65, 0.2);
  transition: all 0.3s ease;
}

/* Effet de particules subtiles */
ul#countdown::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(0, 255, 65, 0.03) 50%,
    transparent 70%
  );
  animation: shimmer 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shimmer {
  0%,
  100% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(100%);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  ul#countdown {
    width: 90%;
    font-size: 4vw;
    padding: 15px 0 20px 0;
  }

  ul#countdown li .label {
    font-size: 2vw;
  }

  .nav-label {
    font-size: 8px;
  }

  .nav-item {
    padding: 5px 6px;
    min-width: 45px;
  }
}

@media (max-width: 480px) {
  ul#countdown {
    width: 95%;
    font-size: 5vw;
    padding: 12px 0 18px 0;
  }

  ul#countdown li .label {
    font-size: 2.5vw;
  }

  .nav-icon {
    font-size: 16px;
  }

  .nav-label {
    font-size: 7px;
  }

  .nav-item {
    padding: 4px 5px;
    min-width: 40px;
  }
}

/* ===== CARTE DE BERLIN ===== */
#map {
  height: 100vh;
  width: 100%;
  background: #000;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  pointer-events: auto;
  overflow: hidden;
}

/* S'assurer que la carte remplit toujours l'écran */
#map .leaflet-container {
  height: 100vh !important;
  width: 100% !important;
  background: #000 !important;
}

/* Masquer les bordures noires */
#map .leaflet-tile-pane {
  background: #000 !important;
}

/* ===== HEADER LOCALISATION ===== */
.location-header {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 20;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 255, 65, 0.3);
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  animation: locationGlow 2s ease-in-out infinite alternate;
}

@keyframes locationGlow {
  0% {
    border-color: rgba(0, 255, 65, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 10px rgba(0, 255, 65, 0.2);
  }
  100% {
    border-color: rgba(0, 255, 65, 0.6);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 255, 65, 0.4);
  }
}

.location-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.location-city {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.location-separator {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 18px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
}

.location-label {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.location-subtitle {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== MARKERS LOCALISATION ===== */
.map-marker {
  position: relative;
  width: 32px;
  height: 32px;
}

.map-marker .marker-outer {
  position: absolute;
  display: block;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 65, 54, 0.25);
  border: 1px solid rgba(255, 65, 54, 0.5);
  box-shadow: 0 0 20px rgba(255, 65, 54, 0.45);
  animation: markerPulse 2s infinite ease-in-out;
  box-sizing: border-box;
}

.map-marker .marker-core {
  position: absolute;
  display: block;
  width: 12px;
  height: 12px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: linear-gradient(135deg, #ff4136, #c70000);
  box-shadow: 0 0 10px rgba(255, 65, 54, 0.7);
}

.map-marker.active .marker-core {
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: 0 0 16px rgba(255, 65, 54, 0.85);
}

@keyframes markerPulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.7;
  }
  70% {
    transform: translate(-50%, -50%) scale(1.4);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.6);
    opacity: 0;
  }
}

/* Styles pour marker SOLVED (Vert + Pulse vert) */
.map-marker.solved .marker-outer {
  border-color: var(--color-solved);
  background: rgba(0, 255, 65, 0.25);
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.45);
  /* On garde l'animation mais en vert ? Ou on l'arrête ? L'utilisateur a demandé "écho vert" donc pulse vert */
  animation: markerPulseSolved 2s infinite ease-in-out;
}

.map-marker.solved .marker-core {
  background: linear-gradient(135deg, #00ff41, #008f24);
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.7);
}

.map-marker.solved.active .marker-core {
  box-shadow: 0 0 16px rgba(0, 255, 65, 0.85);
}

@keyframes markerPulseSolved {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.7;
  }
  70% {
    transform: translate(-50%, -50%) scale(1.4);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.6);
    opacity: 0;
  }
}

/* ===== POPUPS LOCALISATION ===== */
.checkpoint-popup-wrapper .leaflet-popup-content-wrapper {
  background: rgba(12, 18, 26, 0.35); /* Fond beaucoup plus transparent */
  border: 1px solid rgba(173, 216, 255, 0.15);
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  backdrop-filter: blur(16px) saturate(180%); /* Effet glass flouté prononcé */
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  overflow: hidden;
}

/* Popup verrouillé ou non résolu (ROUGE) */
.checkpoint-popup.locked .popup-title {
    color: var(--color-locked);
}
.checkpoint-popup.locked .popup-id {
    color: var(--color-locked);
    border-color: var(--color-locked);
    background: rgba(255, 65, 54, 0.1);
}
.checkpoint-popup.locked .popup-mission-input {
    border: 1px solid rgba(255, 65, 54, 0.3); /* Bordure subtile pour l'input */
    background: rgba(0, 0, 0, 0.2);
}
.checkpoint-popup.locked .popup-mission-input:focus {
    border-color: var(--color-locked);
    box-shadow: 0 0 10px rgba(255, 65, 54, 0.2);
}
.checkpoint-popup.locked .popup-mission-submit {
    border-color: var(--color-locked);
    color: var(--color-locked);
    background: rgba(255, 65, 54, 0.1);
}
.checkpoint-popup.locked .popup-mission-submit:hover {
    background: var(--color-locked);
    color: white;
}
.checkpoint-popup.locked .popup-mission-image {
    border: none; /* Plus de bordure rouge sur l'image */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Style pour l'état "Inaccessible" (le vrai verrouillé) */
.checkpoint-popup.inaccessible {
    opacity: 0.9;
}

/* Popup résolu (VERT - Standard) */
.checkpoint-popup.solved .popup-title {
    color: var(--color-solved);
}
.checkpoint-popup.solved .popup-id {
    color: var(--color-solved);
    border-color: var(--color-solved);
    background: rgba(0, 255, 65, 0.1);
}
.checkpoint-popup.solved .popup-mission-image {
    border: none;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.15);
}

.checkpoint-popup-wrapper .leaflet-popup-tip {
  background: rgba(12, 18, 26, 0.35); /* Même fond transparent */
  border: 1px solid rgba(173, 216, 255, 0.15);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Bordure colorée wrapper selon état */
.checkpoint-popup.locked {
    /* On ne peut pas styler le wrapper parent facilement en CSS pur sans :has(), 
       mais le contenu interne suffit pour l'effet */
}

.checkpoint-popup {
  padding: 12px 16px 16px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.popup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.popup-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-color);
  letter-spacing: 0.3px;
  line-height: 1.2;
  transition: color 0.3s ease;
}

.popup-id {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: rgba(0, 255, 65, 0.95);
  background: rgba(0, 255, 65, 0.1);
  border: 1px solid rgba(0, 255, 65, 0.3);
  border-radius: 6px;
  padding: 4px 8px;
  letter-spacing: 0.55px;
  text-transform: uppercase;
  align-self: flex-start;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.popup-codename {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 0 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.popup-mission-image {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 65, 0.2);
  margin-top: 4px;
  transition: border-color 0.3s ease;
}

.popup-description {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.1px;
}

/* Zone de réponse mission */
.popup-mission-zone {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.popup-mission-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 255, 65, 0.3);
  border-radius: 4px;
  color: #fff;
  padding: 8px;
  font-family: 'Roboto Mono', monospace;
  font-size: 12px;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.popup-mission-input:focus {
  border-color: var(--primary-color);
}

.popup-mission-input.error {
    animation: shake 0.4s ease-in-out;
    border-color: #ff0000 !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.popup-mission-submit {
  background: rgba(0, 255, 65, 0.15);
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  border-radius: 4px;
  padding: 0 12px;
  cursor: pointer;
  font-weight: bold;
  font-size: 12px;
  transition: all 0.3s;
}

.popup-mission-submit:hover {
  background: var(--primary-color);
  color: #000;
}

.popup-mission-success {
    margin-top: 8px;
    padding: 10px;
    background: rgba(0, 255, 65, 0.15);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    color: var(--primary-color);
    font-weight: bold;
    text-align: center;
    font-size: 12px;
    text-transform: uppercase;
    animation: fadeIn 0.5s ease-out;
}

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

.popup-footer {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: rgba(255, 71, 58, 0.9);
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 71, 58, 0.18);
  text-align: right;
}

.popup-footer.locked {
  color: rgba(255, 71, 58, 1);
}

.checkpoint-popup-wrapper .leaflet-popup-close-button {
  color: rgba(255, 255, 255, 0.6);
  font-size: 16px;
  padding: 8px 8px 0 0;
}

.checkpoint-popup-wrapper .leaflet-popup-close-button:hover {
  color: var(--primary-color);
}

/* Masquer le background animé sur la page localisation */
.page-localisation {
  overflow: hidden;
}

.page-localisation canvas {
  display: none !important;
}

/* ===== CLASSES UTILITAIRES ===== */
.glass-effect {
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
}

.glow-effect {
  box-shadow: var(--shadow-glow);
}

.text-primary {
  color: var(--text-primary);
}

.text-secondary {
  color: var(--text-secondary);
}


/* ===== LOADING SCREEN STYLES ===== */
.loading-screen {
  margin: 40vh 20%;
  width: 60%;
  color: var(--text-primary);
}

.loading-screen .col {
  display: flex;
  flex-direction: row;
  gap: 1em;
  margin: 2em 0;
}

.loading-screen .right {
  text-align: right;
}

.loading-screen .center {
  text-align: center;
}

.loading-screen .last {
  margin-bottom: 0;
  display: grid;
  place-items: center;
}

.loading-screen .last > * {
  grid-area: 1 / 1;
}

.loading-screen .last h2 {
  color: black;
}

.loading-screen h1 {
  font-size: 8vh;
  margin: 0;
  opacity: 0;
}

.loading-screen h2 {
  font-size: 6vh;
  margin: 47vh 0;
  opacity: 0;
}

.loading-screen p {
  font-size: 3vh;
  margin: 0;
  opacity: 0;
}

.loading-screen img {
  opacity: 0;
  margin: 2em 0;
  width: 100%;
}

.loading-screen .col > img {
  max-width: 40%;
  margin: 0;
}
