/* ==========================================================
   Nutrition.Nelles — Générateur de recettes V9
   Style unifié, premium et cohérent avec la charte du site
   ========================================================== */

/* TYPOGRAPHIE GÉNÉRALE */
body, input, select, button {
  font-family: 'Poppins', sans-serif;
  color: #333;
}

h1, h2, h3, h4 {
  font-family: 'Lora', serif;
  color: #00B5B8;
  font-weight: 600;
}

/* STRUCTURE DE PAGE */
.nn-form select,
.nn-form input {
  width: 100%;
  padding: .6rem;
  margin-top: .3rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 1rem;
}

.nn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.nn-form label {
  font-weight: 500;
  display: block;
  color: #444;
  text-align: left;
}

.btn-principal {
  background: #00B5B8;
  color: white;
  border: none;
  padding: .9rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background .3s, transform .2s;
}
.btn-principal:hover {
  background: #00989B;
  transform: scale(1.02);
}

/* SUGGESTIONS — LISTE DÉROULANTE ENRICHI */
.suggestions {
  list-style: none;
  margin: 0;
  padding: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  margin-top: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
  display: none;
  position: absolute;
  width: 100%;
  z-index: 20;
}

/* Carte individuelle */
.suggestion-card {
  display: flex;
  align-items: center;
  padding: 0.8rem;
  border-bottom: 1px solid #eee;
  transition: background 0.3s, transform 0.2s;
  cursor: pointer;
  position: relative;
}

.suggestion-card:hover {
  background: #f9fefe;
  transform: scale(1.01);
}

.suggestion-card img {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  margin-right: 1rem;
  flex-shrink: 0;
}

.suggestion-text h4 {
  margin: 0;
  color: #333;
  font-size: 1rem;
}

.suggestion-text p {
  margin: 0.3rem 0 0;
  color: #777;
  font-size: 0.9rem;
}

.suggestion-text .tag {
  display: inline-block;
  background: #00B5B8;
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 6px;
  margin-top: 4px;
}

/* Badge IA (optionnel) */
.suggestion-card::after {
  content: attr(data-badge);
  display: none;
  position: absolute;
  top: 6px;
  right: 10px;
  background: rgba(0,181,184,0.85);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
}
.suggestion-card[data-badge]:not([data-badge=""])::after {
  display: inline-block;
}

/* SECTION RECETTE */
.nn-recipe {
  font-family: 'Lora', serif;
  line-height: 1.6;
  color: #333;
  margin: 3rem auto;
  max-width: 750px;
}
.nn-recipe h1, .nn-recipe h2 {
  color: #00B5B8;
  font-family: 'Lora', serif;
  margin-top: 2rem;
}
.nn-recipe p {
  margin-bottom: 1rem;
}
.nn-recipe ul, .nn-recipe ol {
  padding-left: 1.2rem;
  margin-bottom: 1.5rem;
}

/* IMAGE DE RECETTE */
.nn-figure {
  text-align: center;
  margin: 3rem auto;
}
.nn-figure img {
  max-width: 100%;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  display: none;
}

/* EFFET DE VAGUE TURQUOISE */
.nn-wave {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  background: #00B5B8;
  z-index: 9999;
  transition: height 1.8s ease-in-out;
}
.nn-wave.active {
  height: 100%;
}

/* ANIMATION FADE PROGRESSIVE */
.fade-block {
  opacity: 0;
  transition: opacity 0.6s ease-in;
}

/* CONTENEUR PRINCIPAL */
.fiche-details {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin: 2rem auto;
  max-width: 900px;
}
.fiche-details h1 {
  text-align: center;
  margin-bottom: 1rem;
}
.fiche-details p.lead {
  text-align: center;
  color: #666;
  margin-bottom: 2rem;
}

/* BOUTONS ET CHAMPS DE FORMULAIRE */
input[type="text"], input[type="number"], select {
  font-size: 1rem;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  box-sizing: border-box;
}
input[type="text"]:focus, input[type="number"]:focus, select:focus {
  outline: none;
  border-color: #00B5B8;
  box-shadow: 0 0 0 2px rgba(0,181,184,0.2);
}
button:focus {
  outline: none;
}

/* RESPONSIVE */
@media (max-width: 600px) {
  .suggestion-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .suggestion-card img {
    width: 100%;
    height: 150px;
    margin-bottom: 0.5rem;
  }
  .suggestion-text h4 {
    font-size: 1rem;
  }
}

/* ===========================================
   Suggestions dynamiques — Nutrition.Nelles
   =========================================== */

.suggestions {
  position: absolute;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  margin-top: 4px;
  width: 100%;
  max-width: 680px;
  list-style: none;
  padding: 0;
  z-index: 1000;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  font-family: "Lora", serif;
  text-align: left;
}

.suggestion-item {
  display: flex;
  align-items: center;
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f3f3f3;
  transition: background 0.25s ease;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background: #f6fbfb;
}

.suggestion-item img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  margin-right: 12px;
  border: 1px solid #e0f0ef;
}

.suggestion-item h4 {
  margin: 0;
  font-size: 15px;
  color: #333;
  font-weight: 600;
}

.suggestion-item p {
  margin: 2px 0 0 0;
  font-size: 13px;
  color: #666;
}

#form-recette label {
  position: relative;
  display: block;
}

/* === Conteneur parent pour suggestions === */
#form-recette label {
  position: relative;
  display: block;
}

/* === Liste déroulante visible sous le champ === */
.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  margin-top: 4px;
  width: 100%;
  list-style: none;
  padding: 0;
  z-index: 1000;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  font-family: "Lora", serif;
  text-align: left;
  max-height: 320px;
  overflow-y: auto;
}

/* === Style des cartes de suggestion === */
.suggestion-item {
  display: flex;
  align-items: center;
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f3f3f3;
  transition: background 0.25s ease;
}

.suggestion-item:hover {
  background: #f6fbfb;
}

.suggestion-item img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  margin-right: 12px;
  border: 1px solid #e0f0ef;
}

.suggestion-item h4 {
  margin: 0;
  font-size: 15px;
  color: #333;
  font-weight: 600;
}

.suggestion-item p {
  margin: 2px 0 0 0;
  font-size: 13px;
  color: #666;
}
