
/* === Wrapper / Layout === */
.recette-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}
.recette-section {
  background: var(--color-bg-light);
  border-radius: 12px;
  padding: 2rem;
  margin-top: 2rem;
  box-shadow: var(--shadow-sm);
}
.row { display: flex; flex-wrap: wrap; gap: 1rem; }

/* === Image Couverture === */
.image-container {
  position: relative;
  margin-top: 1rem;
  border-radius: 10px;
  overflow: hidden;
  max-height: 400px;
  box-shadow: var(--shadow-sm);
}
.couverture-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.couverture-texte {
  color: #999;
  font-style: italic;
  text-align: center;
  padding: 40px;
}

/* Overlay bas */
.overlayRecette {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(15,15,15,0.6);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
}
.avatarRecette img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #fff;
  margin-right: 0.75rem;
}
.pseudoRecette { font-weight: bold; color: #fff; }

/* Titre & Badge */
.title-overlay {
  position: absolute;
  bottom: 20px; left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 2em; font-weight: bold;
  text-shadow: 1px 1px 8px rgba(0,0,0,0.6);
}
.recette-badge {
  position: absolute; top: 20px; right: 20px;
  background: #facc15; color: #111;
  padding: 0.5rem 1rem;
  font-size: 0.9em; font-weight: bold;
  border-radius: 8px; text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}
.recette-steps {
  padding-top: 1.5rem;
  list-style: none;
}

/* Toutes les étapes ont le même padding */
.recette-steps li {
  background: #1a1a1a;
  border-left: 4px solid var(--color-primary);
  border-radius: 8px;
  padding: 1.5rem;                  /* <-- applique à toutes */
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
  color: var(--color-text);
  transition: transform .3s ease, box-shadow .3s ease;
}

/* Espace vertical entre chaque étape */
.recette-steps li + li {
  margin-top: 1.5rem;               /* <-- seulement espacement */
}

/* Hover */
.recette-steps li:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* disposition en grille pour texte + actions */
.etape-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: start;
}

/* zone texte */
.etape-col.gauche {
  font-size: 1rem;
  line-height: 1.6;
  color: #ddd;
}

/* actions + audio */
.etape-col.droite {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
/* Bouton “Lire l’étape” */
.tts-step-btn {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--color-primary);
  color: #000;
  border: none;
  border-radius: var(--radius);
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  transition: background var(--transition);
  cursor: pointer;
}
.tts-step-btn:hover {
  background: var(--color-secondary);
}
/* === Highlight en background progressif === */
/* Permet de conserver les espaces et retours à la ligne */
.etape-col p {
  white-space: pre-wrap;
}

/* Chaque mot reste inline pour ne pas casser le flux */
.tts-word {
  display: inline;
  background: none;
  transition: background-color 0.2s ease;
}

/* Background progressif */
.tts-word.highlight {
  background-color: var(--color-primary);
  color: #000;
}



/* bouton “jouer” */
.btnEtapePlay {
  background: var(--color-primary);
  color: #000;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  font-weight: bold;
  font-size: 0.9rem;
  transition: background var(--transition);
}

.btnEtapePlay:hover {
  background: var(--color-secondary);
}

/* contrôles d’enregistrement */
.recorder-controls {
  display: flex;
  gap: 0.5rem;
}

.recorder-controls button {
  background: #333;
  color: var(--color-text);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-primary);
  transition: background var(--transition);
}

.recorder-controls button:hover {
  background: #444;
}

/* aperçu audio */
.audio-preview {
  display: block;
  margin-top: 0.5rem;
}

/* formulaire upload */
.upload-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.upload-form .btn-submit {
  background: var(--color-primary);
  color: #000;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
}

.upload-form .btn-submit:hover {
  background: var(--color-secondary);
}

/* Modal “Ajouter / Modifier Étape” */
/* ========== MODALE ÉTAPE CENTRÉE & STYLISÉE ========== */
/* Overlay : fond sombre opaque + flex centré */
#etapeModal {
  position: fixed;
  inset: 0;                                  /* top:0; right:0; bottom:0; left:0; */
  background: rgba(0, 0, 0, 0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

/* Contenu de la modale */
#etapeModal .modal-content {
  position: relative;
  background: #1e1e1e;                       /* fond très sombre */
  border: 2px solid var(--color-primary);    /* bord néon cyan */
  border-radius: 12px;
  width: 90%;
  max-width: 480px;
  padding: 1.5rem 2rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  animation: fadeIn 0.3s var(--transition);
}

/* Titre */
#etapeModal .modal-content h3 {
  margin-top: 0;
  color: var(--color-secondary);
  font-size: 1.5rem;
}

/* Bouton fermer (croix) */
#etapeModal .closeModalBtn {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  font-size: 1.6rem;
  color: var(--color-text);
  cursor: pointer;
  transition: color var(--transition);
}
#etapeModal .closeModalBtn:hover {
  color: var(--color-error);
}

/* textarea */
#etapeModal textarea {
  width: 100%;
  min-height: 100px;
  background: #2a2a2a;
  color: var(--color-text);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius);
  padding: 0.8rem;
  resize: vertical;
}

/* Bouton “Ajouter une étape” */
#etapeModal .submitEtape .post-button {
  width: 100%;
  margin-top: 1rem;
  background: var(--color-primary);
  color: #000;
  font-weight: bold;
  padding: 0.8rem;
  border-radius: var(--radius);
  transition: background var(--transition);
}
#etapeModal .submitEtape .post-button:hover {
  background: var(--color-secondary);
}

/* Effet d’entrée */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* Audio */
.audio-list p { font-weight: bold; color: #444; }
.audio-item { display: flex; align-items: center; gap: 0.5rem; margin-top:20px;}
.audio-date { font-size: 0.85rem; color: var(--color-muted); }
.upload-form { display: flex; align-items: center; gap: 10px; margin-top: 10px; }

/* Boutons spécifiques */
.option-btn {
  background: #252525;
  border: 1px solid #444;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  color: var(--color-secondary);
  font-size: 0.9rem;
}
.btn-playall, .btnEtapePlay {
  background: #4caf50; color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: background var(--transition);
}
.btn-playall:hover, .btnEtapePlay:hover { background: #388e3c; }

/* === Formulaires === */
form { display: flex; flex-direction: column; gap: 1rem; }
input, textarea, select {
  background: #1e1e1e;
  color: var(--color-text);
  border: 1px solid #333;
  padding: 0.6rem;
  border-radius: var(--radius);
  width: 100%;
}

/* === Modales & Overlays génériques === */
.modal-overlay, #etapeModal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: none; justify-content: center; align-items: center;
  z-index: 9000;
}
.modal-overlay.show, #etapeModal.show { display: flex; }
.modal, .edit-modal-content, .modaleEtape, .modalEtapeImageContent {
  background: #1f1f1f;
  padding: 2rem; border-radius: 12px;
  max-width: 500px; width: 90%;
  box-shadow: var(--shadow-md);
  position: relative;
  animation: fadeIn 0.3s var(--transition);
}
.modal .close-modal, .closeEdit-modal, .closeModalBtn,
.closeEtape, .closeEtapeImage {
  position: absolute; top: 1rem; right: 1rem;
  font-size: 1.5rem; color: var(--color-text);
  cursor: pointer; transition: color var(--transition);
}
.modal .close-modal:hover, .closeEdit-modal:hover,
.closeModalBtn:hover, .closeEtape:hover, .closeEtapeImage:hover {
  color: var(--color-error);
}

/* Specific modal layouts */
.modal-content, .modal-comment-content, .modalEdit-theme,
.modalEdit-soustheme, .modaleTemps-content, .modaleDescription-content,
.modaleEtape-content {
  display: flex; flex-direction: column; gap: 1rem;
}

/* === Carousel === */
.carousel-theme-section { max-width: 1000px; margin: 4rem auto; text-align: center; }
.carousel-wrapper { position: relative; overflow: hidden; display: flex; align-items: center; }
.carousel-track {
  display: flex; gap: 1.5rem; overflow-x: auto;
  scroll-behavior: smooth; padding: 1rem;
}
.carousel-card {
  flex: 0 0 auto; width: 260px;
  background: #1e1e1e; border-radius: 10px;
  overflow: hidden; color: var(--color-text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  transition: transform var(--transition);
}
