/* ==============================================
   JADIS FEEL — Page Changement d'humeur
   Code adapté EXACTEMENT de la consigne d'Iza
   (fichier user_input_files/interface_style_13fev2026.css)
   ============================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ========== BACKGROUND NORMAL INTERFACE ==========
   Le body a un fond de base rose/jaune fixe.
   C'est le fond "normal" de l'interface. */
body.page-humeur {
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: radial-gradient(
    circle farthest-corner at 10% 20%,
    rgba(240, 139, 139, 1) 0%,
    rgba(243, 252, 166, 1) 90%
  );
  font-family: 'Prata', 'Georgia', serif;
  overflow-x: hidden;
  transition: background 3.2s cubic-bezier(0.22, 0.61, 0.36, 1);
  position: relative;
  isolation: isolate;
  --mood-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Fondu enchaîné du background humeur -> fond normal (sans flou global UI) */
body.page-humeur::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(
      to bottom,
      rgba(22, 18, 20, 0.78) 0%,
      rgba(22, 18, 20, 0.38) 65%,
      transparent 100%
    ) top / 100% 0% no-repeat,
    linear-gradient(
      to top,
      rgba(22, 18, 20, 0.78) 0%,
      rgba(22, 18, 20, 0.38) 65%,
      transparent 100%
    ) bottom / 100% 0% no-repeat;
  opacity: 0;
  backdrop-filter: brightness(1) contrast(1);
  -webkit-backdrop-filter: brightness(1) contrast(1);
}

body.page-humeur::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--mood-overlay-gradient, transparent);
  background-size: 220% 220%;
  background-position: 0% 50%;
  opacity: 0;
}

/* Quand l'humeur est "on" : on désactive le ::before et on active le ::after */
body.mood-overlay-on::before {
  opacity: 0;
  animation: none;
}

body.mood-overlay-on::after {
  opacity: 1;
  background-size: var(--mood-overlay-size, 440% 440%);
  animation: var(--mood-overlay-animation-name, moodGradientFlow) var(--mood-overlay-duration, 12s) var(--mood-overlay-ease, ease-in-out) infinite;
}

/* Quand l'humeur fade (transition) : on ferme le shutter puis on dissout */
body.mood-overlay-fade::before {
  opacity: 1;
  animation: truffautShutterSoft var(--truffaut-blink-duration, 1.15s) var(--mood-ease) forwards;
}

body.mood-overlay-fade::after {
  background-size: var(--mood-overlay-size, 440% 440%);
  animation:
    var(--mood-overlay-animation-name, moodGradientFlow) var(--mood-overlay-duration, 12s) var(--mood-overlay-ease, ease-in-out) infinite,
    moodDissolve var(--truffaut-blink-duration, 1.15s) var(--mood-ease) forwards;
}

/* ========== KEYFRAMES (référence d'Iza) ========== */
@keyframes moodGradientFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes ondeZen {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes ondeZenVolutes {
  0% {
    background-position: 8% 30%, 92% 68%, 0% 50%;
  }
  50% {
    background-position: 62% 36%, 36% 46%, 100% 50%;
  }
  100% {
    background-position: 8% 30%, 92% 68%, 0% 50%;
  }
}

@keyframes sereneCloudDrift {
  0% {
    background-position: 0px 22%, 260px 76%, 0px 58%;
  }
  100% {
    background-position: 1080px 22%, 760px 76%, 1480px 58%;
  }
}

@keyframes truffautShutterSoft {
  0% {
    opacity: 0;
    background-size: 100% 0%, 100% 0%;
    backdrop-filter: brightness(1) contrast(1);
    -webkit-backdrop-filter: brightness(1) contrast(1);
  }
  32% {
    opacity: var(--truffaut-mid-opacity, 0.50);
    background-size: 100% 26%, 100% 26%;
    backdrop-filter: brightness(0.38) contrast(1.06) grayscale(0.06);
    -webkit-backdrop-filter: brightness(0.38) contrast(1.06) grayscale(0.06);
  }
  52% {
    opacity: var(--truffaut-peak-opacity, 0.52);
    background-size: 100% 47%, 100% 47%;
    backdrop-filter: brightness(0.12) contrast(1.12) grayscale(0.18);
    -webkit-backdrop-filter: brightness(0.12) contrast(1.12) grayscale(0.18);
  }
  76% {
    opacity: 0.46;
    background-size: 100% 22%, 100% 22%;
    backdrop-filter: brightness(0.52) contrast(1.03) grayscale(0.04);
    -webkit-backdrop-filter: brightness(0.52) contrast(1.03) grayscale(0.04);
  }
  100% {
    opacity: 0;
    background-size: 100% 0%, 100% 0%;
    backdrop-filter: brightness(1) contrast(1);
    -webkit-backdrop-filter: brightness(1) contrast(1);
  }
}

@keyframes moodDissolve {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* ========== GRADIENTS HUMEURS - FOND DE PAGE (body) ==========
   6 humeurs, comme dans le code d'Iza. */

/* Humeur : tendresse (rose pâle -> rose vif) */
body.humeur-tendresse {
  background: radial-gradient(
    circle,
    rgb(255, 255, 255) 2%,
    rgb(255, 182, 193) 77%,
    rgb(255, 105, 180) 100%
  ) !important;
  --truffaut-blink-duration: 1.15s;
  --mood-overlay-animation-name: moodGradientFlow;
  --mood-overlay-duration: 12s;
  --mood-overlay-ease: ease-in-out;
  --mood-overlay-size: 240% 240%;
}

/* SÉRÉNITÉ — demandée par Iza comme page par défaut */
body.humeur-serenite {
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.63) 2%,
    rgba(216, 131, 230, 0.79) 77%,
    rgba(206, 194, 252, 0.83) 100%
  ) !important;
  --truffaut-blink-duration: 1.55s;
  --truffaut-mid-opacity: 0.46;
  --truffaut-peak-opacity: 0.48;
  --mood-overlay-animation-name: truffautShutterSoft;
  --mood-overlay-duration: 8.4s;
  --mood-overlay-ease: linear;
  --mood-overlay-size: 440% 440%;
}

body.humeur-serenite {
  background-size: 440% 440% !important;
  animation: ondeZen 8.4s linear infinite !important;
}

body.humeur-serenite::after {
  opacity: 1;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.63) 2%,
    rgba(216, 131, 230, 0.79) 77%,
    rgba(206, 194, 252, 0.83) 100%
  );
  background-size: 440% 440%;
  background-position: 0% 50%;
  animation: ondeZen 8.4s linear infinite;
  mix-blend-mode: normal;
}

body.humeur-rieuse {
  background: linear-gradient(307deg,
    #f9e860,
    #dfa872,
    #f2c464,
    #ff9d00,
    #e58e26,
    #f9d423) !important;
  --truffaut-blink-duration: 0.90s;
  --truffaut-mid-opacity: 0.48;
  --truffaut-peak-opacity: 0.50;
  --mood-overlay-animation-name: moodGradientFlow;
  --mood-overlay-duration: 12s;
  --mood-overlay-ease: ease;
  --mood-overlay-size: 600% 600%;
}

body.humeur-pensive {
  background: linear-gradient(269deg,
    #17225d,
    #130f36,
    #58a2f7,
    #08ffd5) !important;
  --truffaut-blink-duration: 1.55s;
  --truffaut-mid-opacity: 0.48;
  --truffaut-peak-opacity: 0.50;
  --mood-overlay-animation-name: moodGradientFlow;
  --mood-overlay-duration: 12s;
  --mood-overlay-ease: ease;
  --mood-overlay-size: 800% 800%;
}

body.humeur-rossignol {
  background: linear-gradient(66deg,
    #d22828,
    #262558,
    #f2bc88,
    #322c20) !important;
  --truffaut-blink-duration: 1.55s;
  --truffaut-mid-opacity: 0.48;
  --truffaut-peak-opacity: 0.50;
  --mood-overlay-animation-name: moodGradientFlow;
  --mood-overlay-duration: 16s;
  --mood-overlay-ease: ease;
  --mood-overlay-size: 800% 800%;
}

body.humeur-bougonne {
  background: linear-gradient(298deg,
    #67675d,
    #9f95b0,
    #cebfa0,
    #92805c) !important;
  --truffaut-blink-duration: 0.90s;
  --truffaut-mid-opacity: 0.48;
  --truffaut-peak-opacity: 0.50;
  --mood-overlay-animation-name: moodGradientFlow;
  --mood-overlay-duration: 5s;
  --mood-overlay-ease: ease;
  --mood-overlay-size: 800% 800%;
}

/* Animation commune à toutes les humeurs (référence d'Iza) */
body.humeur-tendresse,
body.humeur-serenite,
body.humeur-rieuse,
body.humeur-pensive,
body.humeur-rossignol,
body.humeur-bougonne {
  background-size: var(--mood-overlay-size, 240% 240%) !important;
  animation: var(--mood-overlay-animation-name, moodGradientFlow) var(--mood-overlay-duration, 12s) var(--mood-overlay-ease, ease-in-out) infinite;
}

/* ========== MISE EN PAGE ========== */

/* ========== ZONE DE SAISIE ==========
   L'humeur ne se choisit pas : elle se détecte à partir de ce que
   l'invité écrit ici. Il n'y a donc aucun bouton d'humeur. */
.humeur-input-zone {
  width: 100%;
  max-width: 580px;
  margin: 0 auto var(--s-lg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.humeur-input-label {
  font-family: 'Special Elite', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: rgba(22, 18, 20, 0.8);
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
}

.humeur-input {
  width: 100%;
  resize: vertical;
  min-height: 92px;
  padding: 14px 16px;
  font-family: 'Prata', 'Georgia', serif;
  font-size: 1rem;
  line-height: 1.55;
  color: #1a1a1a;
  background: rgba(254, 250, 235, 0.9);
  border: 1.5px solid rgba(110, 79, 41, 0.28);
  border-radius: 12px;
  box-shadow:
    0 6px 18px rgba(43, 28, 20, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  transition: border-color 0.3s var(--mood-ease), box-shadow 0.3s var(--mood-ease);
}

.humeur-input:focus {
  outline: none;
  border-color: rgba(22, 18, 20, 0.55);
  box-shadow:
    0 8px 22px rgba(43, 28, 20, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.75);
}

.humeur-input::placeholder {
  color: rgba(22, 18, 20, 0.45);
  font-style: italic;
}

/* Indicateur discret de l'humeur perçue */
.humeur-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Special Elite', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: rgba(22, 18, 20, 0.75);
}

.humeur-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(22, 18, 20, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.45);
  flex: none;
}

/* Contenu principal */
.humeur-main {
  position: relative;
  z-index: 1;
  padding: var(--s-md) var(--s-md) var(--s-xl);
  max-width: 720px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.humeur-intro {
  text-align: center;
  margin-bottom: var(--s-lg);
  color: #1a1a1a;
}
.humeur-title {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-size: clamp(1.8rem, 4.5vw, 2.4rem);
  font-weight: 500;
  color: #1a1a1a;
  margin: 0 0 var(--s-xs);
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
}
.humeur-subtitle {
  font-family: 'Prata', 'Georgia', serif;
  font-size: 1.05rem;
  font-style: italic;
  color: #2b1c14;
  opacity: 0.85;
  margin: 0;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
}

/* Chatbox */
.chatbox {
  background: rgba(254, 250, 235, 0.92);
  border: 1.5px solid rgba(110, 79, 41, 0.2);
  border-radius: 12px;
  padding: var(--s-md);
  box-shadow:
    0 8px 24px rgba(43, 28, 20, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  min-height: 320px;
  display: flex;
  flex-direction: column;
}
.chatbox__messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  margin-bottom: var(--s-sm);
  max-height: 420px;
}
.chatbox__msg {
  font-family: 'Prata', 'Georgia', serif;
  font-size: 1rem;
  line-height: 1.55;
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 78%;
  animation: messageAppear 0.6s var(--mood-ease) both;
  word-wrap: break-word;
}
.chatbox__msg--jadis {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.85);
  color: #1a1a1a;
  border: 1px solid rgba(110, 79, 41, 0.15);
  border-bottom-left-radius: 2px;
}
.chatbox__msg--user {
  align-self: flex-end;
  background: rgba(22, 18, 20, 0.85);
  color: #fafbf8;
  border-bottom-right-radius: 2px;
}
.chatbox__msg--typing::after {
  content: "▍";
  font-size: 1.2em;
  animation: caretBlink 0.9s steps(1) infinite;
  color: rgba(22, 18, 20, 0.65);
  margin-left: 2px;
}
.chatbox__hint {
  text-align: center;
  font-size: 0.82rem;
  color: rgba(22, 18, 20, 0.65);
  margin: 0;
  font-family: 'Prata', 'Georgia', serif;
  font-style: italic;
}

@keyframes messageAppear {
  0%   { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes caretBlink {
  0%, 50%   { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Lien retour en haut */
.page-header-humeur {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 20;
}
.back-link {
  font-family: 'Special Elite', monospace;
  font-size: 0.85rem;
  color: rgba(22, 18, 20, 0.78);
  background: rgba(255, 255, 255, 0.6);
  padding: 6px 12px;
  border-radius: 14px;
  border: 1px solid rgba(22, 18, 20, 0.18);
  text-decoration: none;
  transition: all 0.2s ease;
}
.back-link:hover {
  background: rgba(22, 18, 20, 0.85);
  color: #fafbf8;
}

/* Footer */
.site-footer {
  position: relative;
  z-index: 1;
  padding: var(--s-md);
  text-align: center;
  font-size: 0.82rem;
  color: rgba(22, 18, 20, 0.65);
  font-family: 'Prata', serif;
}
.site-footer p { margin: 0 0 var(--s-xs); }
.site-footer a { color: rgba(22, 18, 20, 0.85); text-decoration: underline; }

/* Responsive */
@media (max-width: 600px) {
  .chatbox__msg { max-width: 92%; }
  .humeur-input { min-height: 110px; }
}

/* ========== BADGE D'HUMEUR ==========
   Petit badge flottant qui apparaît 3s quand une humeur est activée. */
.mood-badge {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  background: rgba(22, 18, 20, 0.85);
  color: #fafbf8;
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-size: 1rem;
  font-style: italic;
  letter-spacing: 0.02em;
  padding: 8px 18px;
  border-radius: 22px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--mood-ease), transform 0.4s var(--mood-ease);
  z-index: 30;
  white-space: nowrap;
}
.mood-badge.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========== PHRASE CENTRALE (RUBAN) ==========
   Grande phrase poétique, change selon l'humeur. Disparaît après 10s. */
.phrase-centrale {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-size: clamp(1.4rem, 3.5vw, 1.9rem);
  font-style: italic;
  text-align: center;
  color: #1a1a1a;
  margin: 0 auto var(--s-lg);
  max-width: 580px;
  padding: var(--s-md) var(--s-md);
  background: rgba(255, 255, 255, 0.55);
  border-left: 2px solid rgba(22, 18, 20, 0.45);
  border-right: 2px solid rgba(22, 18, 20, 0.45);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
  opacity: 0.3;
  transform: translateY(8px);
  transition: opacity 0.8s var(--mood-ease), transform 0.8s var(--mood-ease);
}
.phrase-centrale.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========== BOUTON RETOUR INTERFACE NORMALE ==========
   Bouton simple : aucune rotation, seulement un fondu au survol. */
.btn-back-mood {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto var(--s-xl);
  padding: 12px 22px;
  font-family: 'Special Elite', monospace;
  font-size: 0.92rem;
  color: rgba(22, 18, 20, 0.9);
  background: rgba(255, 255, 255, 0.72);
  border: 1.5px solid rgba(22, 18, 20, 0.35);
  border-radius: 24px;
  cursor: pointer;
  transition:
    background 0.3s var(--mood-ease),
    color 0.3s var(--mood-ease),
    box-shadow 0.3s var(--mood-ease);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  text-align: center;
  align-self: center;
  letter-spacing: 0.04em;
}
.btn-back-mood:hover {
  background: rgba(22, 18, 20, 0.85);
  color: #fafbf8;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}
.btn-back-mood__icon {
  font-size: 1.1rem;
  display: inline-block;
}

/* ========== SECTION DÉMO ==========
   Bloc explicatif sous le bouton retour. */
.humeur-demo {
  position: relative;
  margin: var(--s-lg) 0 0;
  padding: var(--s-md);
  background: rgba(255, 255, 255, 0.5);
  border: 1px dashed rgba(22, 18, 20, 0.25);
  border-radius: 8px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.humeur-demo__title {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-size: 1.2rem;
  font-weight: 500;
  color: #1a1a1a;
  margin: 0 0 var(--s-sm);
  letter-spacing: 0.01em;
}
.humeur-demo__steps {
  font-family: 'Prata', 'Georgia', serif;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #1a1a1a;
  padding-left: 1.2em;
  margin: 0 0 var(--s-sm);
}
.humeur-demo__steps li {
  margin-bottom: 0.4em;
}
.humeur-demo__steps strong {
  color: rgba(22, 18, 20, 0.85);
}
.humeur-demo__note {
  font-family: 'Prata', 'Georgia', serif;
  font-size: 0.85rem;
  font-style: italic;
  color: rgba(22, 18, 20, 0.7);
  margin: var(--s-sm) 0 0;
}

/* Mise en page principale (flex centré) */
.humeur-main {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.humeur-intro {
  text-align: center;
  width: 100%;
}
