/* ============================================================
   Pa_Capona_choix_parcours.css
   ─────────────────────────────────────────────────────────────
   Page de sélection du parcours (TEST).

   Layout flex-colonne :
     bg-image      (position: absolute — derrière tout)
     btn-retour    (position: absolute — coin haut-gauche)
     .page-header  (titre + badge session)
     .parcours-zone (flex:1 — liste scrollable des parcours)
     .bottom-zone  (bouton Continuer)
============================================================ */

/* ============================================================
   VARIABLES
============================================================ */
:root {
  --bg-brightness: 1.2;
  --or:            #C9A84C;
  --fond-sombre:   #1a1a2e;
}

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background: var(--fond-sombre);
  -webkit-tap-highlight-color: transparent;
}

/* ============================================================
   ÉCRAN PRINCIPAL — flex-colonne
============================================================ */
.screen {
  position: relative;
  width: 100%; height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ============================================================
   IMAGE DE FOND — pleine page, derrière tout
============================================================ */
.bg-image {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center center;
  z-index: 0;
  filter: brightness(var(--bg-brightness));
}

/* ============================================================
   EN-TÊTE DE PAGE — titre + badge session
============================================================ */
.page-header {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;

  margin-top:   clamp(10px, 2dvh, 20px);
  margin-left:  clamp(12px, 4vw,   36px);
  margin-right: clamp(12px, 4vw,   36px);

  padding: clamp(8px, 1.6dvh, 15px) clamp(14px, 3vw, 24px);
  background: rgba(10, 10, 28, 0.60);
  border-radius: clamp(10px, 1.5vw, 18px);

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  animation: fadeIn 0.55s ease 0.2s both;
}

.page-titre {
  font-size:   clamp(0.88rem, 3.8vw, 1.12rem);
  font-weight: 800;
  color: var(--or);
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Badge session ($SESSION['parcours']) */
.session-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: clamp(0.60rem, 2.4vw, 0.72rem);
  color: #888;
  flex-shrink: 0;
}
.session-badge .code-val {
  background: rgba(42, 42, 80, 0.90);
  color: var(--or);
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 4px;
  font-family: monospace;
}
.session-badge .code-val.vide {
  color: #555;
  font-style: italic;
}

/* ============================================================
   ZONE PARCOURS — flex:1, scrollable
============================================================ */
.parcours-zone {
  position: relative;
  z-index: 3;
  flex: 1 1 0;
  min-height: 0;

  margin-top:   clamp(6px, 1.2dvh, 10px);
  margin-left:  clamp(12px, 4vw,   36px);
  margin-right: clamp(12px, 4vw,   36px);

  background: rgba(10, 10, 28, 0.30);
  border-radius: clamp(10px, 1.5vw, 18px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Liste scrollable */
.liste-wrapper {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: clamp(6px, 1.2dvh, 10px) clamp(8px, 2.5vw, 14px);
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.2dvh, 10px);
  -webkit-overflow-scrolling: touch;
}

/* ── Carte parcours ── */
.parcours-card {
  background: rgba(30, 30, 58, 0.92);
  border: 2px solid rgba(42, 42, 80, 0.80);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  user-select: none;
}
.parcours-card:active { opacity: 0.88; }
.parcours-card.selectionne {
  border-color: #cc0000;
  box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.30);
}

/* ── Images côte à côte ── */
.card-images {
  display: flex;
  height: clamp(105px, 22.5dvh, 165px);
  overflow: hidden;
}
.card-images img {
  flex: 1 1 auto;
  max-width: 50%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
  background: #0d0d20;
}
.card-images img + img {
  border-left: 2px solid #0a0a1a;
}
.img-placeholder {
  flex: 1 1 50%;
  background: #0d0d20;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  font-size: 1.2rem;
}

/* ── Corps texte ── */
.card-body {
  padding: clamp(5px, 1dvh, 8px) clamp(8px, 2.5vw, 14px);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* ── Ligne nom + bouton loupe ── */
.card-nom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card-nom {
  flex: 1 1 auto;
  font-size:   clamp(0.82rem, 3.6vw, 0.96rem);
  font-weight: 700;
  color: var(--or);
}
.card-desc {
  font-size: clamp(0.70rem, 2.8vw, 0.82rem);
  color: #bbb;
  line-height: 1.4;
}
.card-code {
  font-size: clamp(0.62rem, 2.4vw, 0.72rem);
  color: #555;
  font-family: monospace;
  margin-top: 1px;
}

/* ── Badge "sélectionné" ── */
.badge-selectionne {
  display: none;
  background: #cc0000;
  color: #fff;
  font-size:   clamp(0.60rem, 2.4vw, 0.70rem);
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 3px;
  width: fit-content;
}
.parcours-card.selectionne .badge-selectionne { display: inline-block; }

/* ── Bouton loupe — inline avec le nom, loupe + texte en colonne ── */
.agrandir-btn {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: rgba(201, 168, 76, 0.12);
  color: var(--or);
  border: 1px solid rgba(201, 168, 76, 0.45);
  border-radius: 6px;
  padding: 4px 9px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s, border-color 0.15s;
}
.agrandir-btn:hover  {
  background: rgba(201, 168, 76, 0.28);
  border-color: rgba(201, 168, 76, 0.80);
}
.agrandir-btn:active { background: rgba(201, 168, 76, 0.45); }

.agrandir-icone {
  font-size: clamp(1.05rem, 4.5vw, 1.30rem);
  line-height: 1;
}
.agrandir-texte {
  font-size:   clamp(0.50rem, 1.9vw, 0.60rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  line-height: 1;
}

/* ── Aucun parcours ── */
.vide-msg {
  color: #555;
  text-align: center;
  font-size: clamp(0.80rem, 3.2vw, 0.94rem);
  padding: 24px 16px;
  line-height: 1.6;
}

/* ============================================================
   ZONE BAS — lézard centré
============================================================ */
.bottom-zone {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  padding: clamp(6px, 1.4dvh, 12px) clamp(14px, 4vw, 36px) clamp(8px, 1.8dvh, 16px);
  display: flex;
  justify-content: center;
  align-items: center;
}

.img-lezard {
  height: clamp(57px, 11dvh, 90px);
  width: auto;
  cursor: pointer;
  user-select: none;
  filter: drop-shadow(2px 3px 6px rgba(0,0,0,0.45));
  transition: transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.img-lezard:hover  { transform: scale(1.07); }
.img-lezard:active { transform: scale(0.93); }
/* État inactif — aucun parcours sélectionné */
.img-lezard.inactif {
  /*opacity: 0.35;*/
  cursor: default;
  filter: drop-shadow(2px 3px 6px rgba(0,0,0,0.45)) grayscale(0.6);
}

/* ============================================================
   POPUP AGRANDIR
============================================================ */
.popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 24px);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.popup-overlay.visible { display: flex; }

.popup-box {
  background: var(--fond-sombre);
  border: 1px solid #2a2a50;
  border-radius: clamp(12px, 2vw, 20px);
  max-width: min(560px, 96vw);
  width: 100%;
  max-height: 90dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.70);
  animation: fadeIn 0.2s ease;
}

.popup-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(10px, 2dvh, 16px) clamp(14px, 4vw, 20px);
  border-bottom: 1px solid #2a2a50;
}
.popup-nom {
  font-size:   clamp(0.90rem, 4vw, 1.15rem);
  font-weight: 700;
  color: var(--or);
}
.popup-fermer {
  background: none;
  border: none;
  color: #666;
  font-size: clamp(1.4rem, 6vw, 1.8rem);
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.popup-fermer:hover { color: #fff; }

/* Images popup — carte_trace en haut, photo1 en dessous */
.popup-images {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  background: #0a0a1a;
  gap: 4px;
}
.popup-img {
  flex: 0 0 auto;
  width: 100%;
  height: clamp(200px, 38dvh, 300px);
  object-fit: contain;
  object-position: center center;
  background: #0d0d20;
  display: block;
}
.popup-img[src=""] { display: none; }

.popup-info {
  flex: 0 0 auto;
  padding: clamp(8px, 1.5dvh, 14px) clamp(14px, 4vw, 20px);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.popup-desc {
  font-size: clamp(0.76rem, 3.2vw, 0.90rem);
  color: #bbb;
  line-height: 1.45;
}
.popup-code {
  font-size: clamp(0.64rem, 2.5vw, 0.74rem);
  color: #555;
  font-family: monospace;
}

/* ============================================================
   NOTIFICATION AJAX
============================================================ */
#ajax-status {
  position: fixed;
  bottom: clamp(10px, 2dvh, 16px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(42, 42, 80, 0.95);
  color: var(--or);
  font-size:   clamp(0.70rem, 2.8vw, 0.84rem);
  font-weight: 600;
  padding: 6px 18px;
  border-radius: 18px;
  border: 1px solid #3a3a6a;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  white-space: nowrap;
  z-index: 99;
}
#ajax-status.visible { opacity: 1; }
#ajax-status.erreur  {
  color: #ff6666;
  border-color: #661111;
  background: rgba(42, 20, 20, 0.95);
}

/* ============================================================
   OVERLAY DE TRANSITION
============================================================ */
.transition-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 100;
  opacity: 1;
  pointer-events: all;
  transition: opacity 0.4s ease;
}

/* ============================================================
   ANIMATIONS
============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================================
   RESPONSIVE — PORTRAIT TRÈS ÉTROIT (≤ 360 px)
============================================================ */
@media (max-width: 360px) {
  .page-titre  { font-size: 0.72rem; }
  .card-images { height: 60px;       }
}

/* ============================================================
   RESPONSIVE — PAYSAGE MOBILE (hauteur ≤ 450 px)
============================================================ */
@media (max-height: 450px) and (orientation: landscape) {
  .page-header { margin-top: 6px; padding: 4px 10px; }
  .page-titre  { font-size: 0.70rem; }
  .card-images { height: 50px;       }
  .bottom-zone { padding: 4px 14px 6px; }
}
