/* =========================================================
   Team Guérande — balou-search.css
   Modal "Recherche de Balou" : carte du monde, scan 5s, flou + KO
   ========================================================= */

/* -------- Bouton declencheur -------- */
.bs-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
  padding: 0.85rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: background var(--transition), border-color var(--transition), transform var(--transition), color var(--transition);
}

.bs-trigger:hover,
.bs-trigger:focus-visible {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #ef4444;
  transform: translateY(-2px);
  outline: none;
}

.bs-trigger-icon {
  font-size: 1.1rem;
  line-height: 1;
}

/* -------- Modal full-screen -------- */
.bs-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 15, 0.75);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  padding: 1.5rem;
  animation: bs-fade-in 0.2s ease-out;
}

.bs-modal.is-open { display: flex; }

@keyframes bs-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.bs-frame {
  position: relative;
  width: min(900px, 100%);
  max-height: calc(100vh - 3rem);
  background: var(--surface);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* En-tete modal */
.bs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--glass-border);
  background: var(--surface-2);
}

.bs-head h2 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.bs-head h2 .bs-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  margin-right: 0.5rem;
  vertical-align: middle;
  animation: bs-pulse 1s ease-in-out infinite;
}

@keyframes bs-pulse {
  0%, 100% { opacity: 1;   box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  50%      { opacity: 0.5; box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

.bs-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.bs-close:hover,
.bs-close:focus-visible {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  outline: none;
  transform: rotate(90deg);
}

/* -------- Zone de la carte -------- */
.bs-map {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
  background:
    radial-gradient(ellipse at center, rgba(20, 30, 50, 0.4) 0%, rgba(10, 10, 15, 0.6) 70%),
    var(--surface);
  overflow: hidden;
}

.bs-map svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Continents : paths du SVG en fill gris transparent */
.bs-map .continent {
  fill: rgba(120, 140, 170, 0.25);
  stroke: rgba(160, 180, 210, 0.45);
  stroke-width: 0.4;
  transition: fill 0.4s ease, opacity 0.4s ease;
}

/* Grille radar */
.bs-map .grid line {
  stroke: rgba(74, 222, 128, 0.10);
  stroke-width: 0.3;
}

/* Barre de scan verticale (de gauche a droite).
   On utilise un pseudo-element qui prend toute la largeur du parent,
   avec un degrade lineaire etroit, et on anime background-position
   (propriete GPU-friendly, pas de calcul de %). */
.bs-scan-bar {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    transparent 35%,
    rgba(74, 222, 128, 0.18) 47%,
    rgba(74, 222, 128, 0.55) 50%,
    rgba(74, 222, 128, 0.18) 53%,
    transparent 65%,
    transparent 100%
  );
  background-size: 50% 100%;
  background-repeat: no-repeat;
  animation: bs-scan 1.6s linear infinite;
}

@keyframes bs-scan {
  0%   { background-position: -50% 0; }
  100% { background-position: 150% 0; }
}

/* Blip : point rouge qui se balade */
.bs-blip {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #fff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.8);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
  animation: bs-blip-ring 1.4s ease-out infinite;
}

@keyframes bs-blip-ring {
  0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  100% { box-shadow: 0 0 0 18px rgba(239, 68, 68, 0); }
}

/* -------- Bandeau bas : statut / timer -------- */
.bs-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--glass-border);
  background: var(--surface-2);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.bs-status .bs-stage {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.7rem;
}

/* -------- Etat final : KO "Balou not found" -------- */
.bs-stage {
  position: relative;
}

.bs-modal.is-found .bs-map {
  filter: blur(18px) brightness(0.55);
}

.bs-modal.is-found .bs-scan-bar,
.bs-modal.is-found .bs-blip {
  display: none;
}

.bs-result {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 1.5rem;
  z-index: 3;
}

.bs-modal.is-found .bs-result { display: flex; }

.bs-result .bs-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 4px 12px rgba(239, 68, 68, 0.5));
}

.bs-result .bs-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ef4444;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.bs-result .bs-sub {
  color: var(--text);
  font-size: 0.95rem;
  max-width: 380px;
  line-height: 1.5;
}

.bs-result .bs-reward {
  margin-top: 1rem;
  padding: 0.5rem 0.9rem;
  background: rgba(246, 173, 26, 0.12);
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Reduced motion : on garde l'anim de scan (juste ralentie),
   on coupe juste le pulse du header (l'anneau du blip et la barre restent) */
@media (prefers-reduced-motion: reduce) {
  .bs-scan-bar       { animation-duration: 4s; }
  .bs-head h2 .bs-pulse { animation: none; }
}

/* Responsive : modal plein ecran sur mobile */
@media (max-width: 600px) {
  .bs-modal { padding: 0; }
  .bs-frame { max-height: 100vh; border-radius: 0; }
  .bs-head h2 { font-size: 0.95rem; }
  .bs-result .bs-title { font-size: 1.25rem; }
}
