/* Styles specific to analysis pages (extracted from pages/gainage.html) */

/* PDF brand (hidden image used as source for PDF generation) */
#pdf-brand {
  display: none;
}

/* Hero image */
header.hero img#main-logo {
  width: 160px;
  height: 160px;
  object-fit: contain;
  margin-bottom: 10px;
}

/* Hero lead paragraph */
header.hero p {
  font-size: 1.5rem;
  text-align: center;
  color: #E6E6E6;
  font-family: 'Segoe UI Black', sans-serif;
  line-height: 1.4;
  margin-top: 10px;
}

/* Make cyan spans in hero consistent with site variable */
header.hero p span {
  color: var(--fu-cyan);
}

/* Choice / camera / upload panels */
#choice-panel {
  margin-top: 8px;
}

#camera-instructions {
  display: none;
  text-align: center;
  color: #ccc;
  margin-top: 6px;
}

#camera-panel {
  flex-direction: column;
  align-items: center;
  margin-top: 8px;
}

/* Initially hidden control buttons */
#recordStartBtn,
#stopCameraBtn,
#flipCameraBtn,
#analyzeBtn,
#fileUpload {
  display: none;
}

/* Upload label cursor */
#upload-panel label[for="fileUpload"] {
  cursor: pointer;
}

#upload-panel {
  margin-top: 8px;
}

/* Download row / feedback */
#download-row {
  display: none;
}

#feedback {
  display: none;
}

/* Contact form spacing */
#contact-form {
  text-align: center;
  margin-top: 12px;
}

/* Plank chronometer default presentation (kept here if small tweaks needed) */
.plank-chrono {
  display: block;
  text-align: center;
  margin: 8px auto 0;
}

/* Contact form PDF button: small left spacing used across analysis pages */
#contact-form .btn {
  margin-left: 8px;
}

/* Espace supplémentaire entre les contrôles (caméra / import) et les cases vidéo */
#camera-panel,
#upload-panel,
#choice-panel {
  margin-bottom: 18px; /* descends visuellement les deux cases noires */
}

/* Assure un espacement quand les panels sont masqués/affichés */
.preview-grid {
  margin-top: 18px;
  gap: 12px;
}

/* ===============================
   Bouton feedback désactivé
   =============================== */

button[disabled],
.btn[disabled] {
  background: linear-gradient(135deg, #2a2a2a, #1e1e1e);
  color: #777;
  border: 1px solid #333;
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
  transform: none;
}

/* Supprime tout effet hover quand désactivé */
button[disabled]:hover,
.btn[disabled]:hover {
  background: linear-gradient(135deg, #2a2a2a, #1e1e1e);
  box-shadow: none;
  transform: none;
}

/* Espace sous le bouton principal "Commencer maintenant" sur les pages d'analyse */
#startNow {
  margin-bottom: 12px;
}

/* Style spécifique pour le bouton 'Voir mon historique (connexion)' utilisé dans les pages d'analyse */
.fu-disclose .fu-btn.fu-btn--outline,
.fu-disclose a.fu-btn.fu-btn--outline {
  display: inline-block;
  padding: 6px 10px; /* juste un peu plus large que le texte */
  border-radius: 10px;
  border: 1px solid #00FFFF; /* bordure cyan demandée */
  color: #00FFFF;
  background: transparent;
  text-decoration: none;
  font-weight: 700;
  margin: 8px 0 0;
  text-align: center;
  width: auto; /* s'ajuste au texte */
}

@media (min-width: 820px) {
  /* conserve un comportement naturel sur bureau (pas de largeur forcée) */
  .fu-disclose .fu-btn.fu-btn--outline,
  .fu-disclose a.fu-btn.fu-btn--outline { width: auto; }
}


/* ===============================
   Variables utilisées par le menu
   (sinon var(--fu-bg-deeper) peut devenir "vide" => fond transparent)
   =============================== */
:root {
  --fu-graphite: #2E2E2E;
  --fu-cyan: #00FFFF;
  --fu-silver: #D9D9D9;
  --fu-bg-deeper: #242424; /* ← fond du menu déroulant */
  --fu-border: #3a3a3a;

  --fu-radius: 14px;
  --fu-shadow: 0 2px 14px rgba(0, 0, 0, .25);
}

/* ===============================
   Liens navbar (style identique)
   =============================== */
.fu-navbar__links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.fu-navbar__links a {
  color: var(--fu-silver);
  text-decoration: none;
  opacity: .95;
  margin: 0;
}

.fu-navbar__links a:hover {
  color: var(--fu-cyan);
}
/* Mobile: menu hamburger — largeur limitée et espacement augmenté */
@media (max-width: 768px) {
  .fu-navbar__links {
    display: none;
  }

  .fu-navbar__links.is-open {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    position: absolute;
    top: 58px;
    right: 8px;        /* Menu collé à droite */
    left: auto;
    transform: none;   /* On désactive le centrage */
    width: 200px;      /* ← si tu veux qu'il soit plus étroit */
    background: var(--fu-bg-deeper);
    border: 1px solid var(--fu-border);
    border-radius: var(--fu-radius);
    box-shadow: var(--fu-shadow);
    z-index: 1000;
}


  /* augmenter l'aire de clic / espacement interne des liens */
  .fu-navbar__links a {
    padding: 12px 10px;
  }

  .fu-navbar {
    position: relative;
  }

  .fu-hamburger {
    display: inline-block;
    position: relative;
    z-index: 1101;
  }
}

/* ===============================
   Preview video fixes (camera + upload)
   Objectifs:
   1) Le format des cases reste stable quand on active la caméra (pas de ratio qui saute)
   2) Les deux cases (brute + annotée) restent dans le même sens (pas de miroir inversé)
   =============================== */

/* Ratio "design" stable par page (ignore les --video-ratio posés en JS) */
body[data-exercise="pushup"],
body[data-exercise="plank"] {
  --fu-preview-ratio: 16/9;
}
body[data-exercise="squat"] {
  --fu-preview-ratio: 9/16;
}

/* Force le ratio des cases (stabilité au switch caméra / upload) */
.preview-rect {
  aspect-ratio: var(--fu-preview-ratio, 16/9) !important;
  width: 100%;
  max-width: 980px;
  margin-inline: auto;
}

/* Les médias remplissent la case sans déformer */
.preview-rect > video,
.preview-rect > canvas {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  display: block;
}

/* Stack propre */
.preview-rect > video { z-index: 1; }
.preview-rect > canvas { z-index: 2; pointer-events: none; }

/* Neutralise les règles mobiles qui "cassent" le ratio en jouant sur #video/#output */
#video,
#videoRaw,
#output {
  max-width: none !important;
}

/* Même sens pour les deux cases en caméra frontale.
   Le JS met déjà #video en scaleX(-1) quand facingMode='user'.
   On "copie" ce miroir sur #videoRaw uniquement dans ce cas, via :has().
   (Supporté sur Chrome/Edge récents.) */
.preview-grid:has(#video[style*="scaleX(-1)"]) #videoRaw {
  transform: scaleX(-1) !important;
}

/* En caméra arrière / upload, on reste normal */
.preview-grid:has(#video[style*="scaleX(1)"]) #videoRaw {
  transform: scaleX(1) !important;
}

/* ===============================
   End preview video fixes
   =============================== */
