/* ===== Phrase Positive du Jour – COSMIC v1.4 ===== */

/* ── 0. WRAPPER – Simple conteneur, pas de full-bleed ───────── */
.pp-phrase-universe {
  margin: 2rem 0;
}


:root {
  --pp-bg-cosmic:    linear-gradient(135deg, #023047 0%, #1a1a2e 55%, #240b36 100%);
  --pp-glass:        rgba(255, 255, 255, 0.08);
  --pp-glass-border: rgba(255, 255, 255, 0.13);
  --pp-orange:       #F8703E;
  --pp-orange-glow:  rgba(248, 112, 62, 0.35);
  --pp-indigo:       #818cf8;
  --pp-text:         #ffffff;
  --pp-soft:         #dbeafe;
  --pp-radius:       24px;
}

/* ── 1. CONTENEUR ───────────────────────────────────────────── */
.pp-phrase-wow {
  position: relative;
  overflow: hidden;
  border-radius: var(--pp-radius);
  background: var(--pp-bg-cosmic);
  border: 1px solid rgba(248, 112, 62, 0.28);
  box-shadow:
    0 0 0 1px rgba(129, 140, 248, 0.08),
    0 20px 60px -15px rgba(2, 48, 71, 0.7),
    0 0 40px -5px rgba(248, 112, 62, 0.08) inset;
  color: var(--pp-text);
  font-family: 'Quicksand', 'Segoe UI', sans-serif;
  text-align: center;
  max-width: 820px;
  margin: 0 auto;
  padding: 3rem 2rem 2.5rem;
  z-index: 1;

  /* Lueur pulsante sur la bordure */
  animation: pp-container-pulse 6s ease-in-out infinite;
}

@keyframes pp-container-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(129, 140, 248, 0.08),
      0 20px 60px -15px rgba(2, 48, 71, 0.7),
      0 0 40px -5px rgba(248, 112, 62, 0.08) inset;
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(129, 140, 248, 0.12),
      0 20px 60px -15px rgba(2, 48, 71, 0.7),
      0 0 60px -5px rgba(248, 112, 62, 0.14) inset;
  }
}

/* ── 2. ÉTOILES – 3 COUCHES ─────────────────────────────────── */
.pp-stars-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.pp-stars-l1 {
  background-image:
    radial-gradient(1.5px 1.5px at 50px  160px, #fff, transparent),
    radial-gradient(2px   2px   at 90px   40px, rgba(255,255,255,.8), transparent),
    radial-gradient(1px   1px   at 130px  80px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 340px  60px, rgba(255,255,255,.7), transparent),
    radial-gradient(1px   1px   at 480px 130px, #fff, transparent),
    radial-gradient(2px   2px   at 600px  45px, rgba(255,255,255,.6), transparent),
    radial-gradient(1px   1px   at 700px 180px, #fff, transparent);
  background-size: 760px 220px;
  opacity: 0.45;
  animation: twinkle1 6s ease-in-out infinite alternate;
}

.pp-stars-l2 {
  background-image:
    radial-gradient(1px   1px   at 70px   90px, rgba(255,255,255,.5), transparent),
    radial-gradient(1.5px 1.5px at 200px  30px, rgba(255,255,255,.7), transparent),
    radial-gradient(1px   1px   at 390px  110px, rgba(255,255,255,.4), transparent),
    radial-gradient(2px   2px   at 550px  70px, rgba(255,255,255,.6), transparent),
    radial-gradient(1px   1px   at 650px  150px, rgba(255,255,255,.5), transparent),
    radial-gradient(1.5px 1.5px at 750px  30px, rgba(255,255,255,.7), transparent);
  background-size: 820px 190px;
  opacity: 0.3;
  animation: twinkle2 9s ease-in-out infinite alternate-reverse;
}

.pp-stars-l3 {
  background-image:
    radial-gradient(1px 1px at 150px 50px,  rgba(129,140,248,.6), transparent),
    radial-gradient(1px 1px at 420px 120px, rgba(248,112,62,.3),  transparent),
    radial-gradient(1px 1px at 680px 55px,  rgba(129,140,248,.4), transparent);
  background-size: 820px 180px;
  opacity: 0.5;
  animation: twinkle3 12s ease-in-out infinite alternate;
}

@keyframes twinkle1 {
  0%   { opacity: 0.3; transform: translateY(0); }
  100% { opacity: 0.55; transform: translateY(-10px); }
}
@keyframes twinkle2 {
  0%   { opacity: 0.2; transform: translateY(0) translateX(0); }
  100% { opacity: 0.42; transform: translateY(-7px) translateX(4px); }
}
@keyframes twinkle3 {
  0%   { opacity: 0.35; }
  100% { opacity: 0.65; }
}

/* ── 3. DATE ─────────────────────────────────────────────────── */
.pp-date {
  position: relative;
  z-index: 1;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--pp-orange);
  margin-bottom: 1.75rem;
  font-weight: 700;
  text-shadow: 0 0 16px var(--pp-orange-glow);
}

/* ── 4. BULLE PHRASE – Animation entrée ─────────────────────── */
.pp-bulle {
  position: relative;
  z-index: 1;
  display: inline-block;
  width: 100%;
  max-width: 92%;
  padding: 2rem 2rem;
  margin: 0 auto 2rem;

  background: var(--pp-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--pp-glass-border);
  border-radius: 20px;

  font-family: 'Caveat', cursive;
  font-size: 2.3rem;
  line-height: 1.42;
  font-weight: 500;
  color: #fff;

  /* État initial pour l'animation d'entrée */
  opacity: 0;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.4s cubic-bezier(.22,.68,0,1.2), box-shadow 0.3s ease;
}

.pp-bulle.pp-revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
  /* On gère la transition initiale via JS pour éviter un flash */
  transition: opacity 0.65s cubic-bezier(.22,.68,0,1.2),
              transform 0.65s cubic-bezier(.22,.68,0,1.2),
              box-shadow 0.3s ease;
}

.pp-bulle:hover {
  transform: translateY(-4px) scale(1.005);
  box-shadow: 0 20px 50px rgba(0,0,0,.25), 0 0 0 1px rgba(255,255,255,.1);
}

/* ── 5. BOUTONS ACTIONS ─────────────────────────────────────── */
.pp-actions {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.pp-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.65rem 1.35rem;
  border: none;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  font-family: 'Quicksand', sans-serif;
  line-height: 1;
  white-space: nowrap;
}

.pp-btn:hover  { transform: translateY(-2px) scale(1.03); }
.pp-btn:active { transform: translateY(0) scale(0.98); }

/* Copier */
.pp-btn-copy {
  background: var(--pp-orange);
  color: #fff;
  box-shadow: 0 4px 18px var(--pp-orange-glow);
}
.pp-btn-copy:hover { box-shadow: 0 6px 28px rgba(248,112,62,.55); }

/* WhatsApp */
.pp-btn-wa {
  background: rgba(255,255,255,.07);
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
}
.pp-btn-wa:hover { background: rgba(255,255,255,.15); }

/* Télécharger image */
.pp-btn-img {
  background: rgba(129,140,248,.18);
  color: #fff;
  border: 1px solid rgba(129,140,248,.3);
}
.pp-btn-img:hover { background: rgba(129,140,248,.3); border-color: rgba(129,140,248,.55); }

/* Intégrer */
.pp-btn-embed {
  background: rgba(248,112,62,.1);
  color: #fff;
  border: 1px solid rgba(248,112,62,.3);
}
.pp-btn-embed:hover,
.pp-btn-embed.is-active {
  background: rgba(248,112,62,.22);
  border-color: rgba(248,112,62,.6);
}

/* ── 6. RÉSONANCE ────────────────────────────────────────────── */
.pp-resonance {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.pp-resonate-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.55rem 1.2rem;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50px;
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.75);
  font-size: 0.88rem;
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s ease;
}

.pp-resonate-btn:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
  border-color: rgba(255,255,255,.3);
}

.pp-resonate-btn.pp-resonated {
  background: rgba(248, 112, 62, 0.18);
  border-color: rgba(248, 112, 62, 0.5);
  color: var(--pp-orange);
}

.pp-heart {
  font-size: 1.1em;
  display: inline-block;
  transition: transform 0.2s ease;
}

.pp-resonate-btn:hover .pp-heart {
  transform: scale(1.25);
}

.pp-resonate-btn.pp-resonated .pp-heart {
  animation: heartbeat 0.5s cubic-bezier(.36,.07,.19,.97) forwards;
}

@keyframes heartbeat {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.5); }
  60%  { transform: scale(0.9); }
  80%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.pp-resonate-count {
  font-size: 0.82rem;
  color: var(--pp-soft);
  opacity: 0.7;
  font-style: italic;
  min-width: 80px;
  text-align: left;
  transition: opacity 0.3s;
}

/* ── 7. ZONE EMBED ───────────────────────────────────────────── */
.pp-embed-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 92%;
  margin: 0 auto 1.5rem;
  background: rgba(2, 48, 71, 0.5);
  border: 1px solid rgba(248,112,62,.22);
  border-radius: 18px;
  padding: 1.4rem 1.6rem;
  text-align: left;
  animation: pp-slide-down 0.28s cubic-bezier(.22,.68,0,1.2);
}

@keyframes pp-slide-down {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pp-embed-label {
  font-size: 0.83rem;
  color: var(--pp-soft);
  margin-bottom: 0.9rem;
  font-style: italic;
  opacity: 0.85;
}

/* Sélecteur de format */
.pp-embed-formats {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}

.pp-fmt-btn {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.6);
  font-size: 0.82rem;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.pp-fmt-btn:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}

.pp-fmt-btn.pp-fmt-active {
  background: rgba(248,112,62,.18);
  border-color: rgba(248,112,62,.5);
  color: var(--pp-orange);
}

.pp-fmt-sub {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.7;
}

/* Code iframe */
.pp-embed-code-wrap {
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
}

.pp-embed-textarea {
  flex: 1;
  min-width: 0;
  background: rgba(0, 10, 20, 0.5);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  color: #93c5fd;
  font-family: 'Courier New', monospace;
  font-size: 0.76rem;
  line-height: 1.55;
  padding: 0.65rem 0.85rem;
  resize: none;
  cursor: text;
}
.pp-embed-textarea:focus {
  outline: none;
  border-color: rgba(248,112,62,.45);
}

.pp-btn-copy-embed {
  background: var(--pp-orange);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0 1.1rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Quicksand', sans-serif;
  white-space: nowrap;
  transition: all 0.18s ease;
  align-self: stretch;
}
.pp-btn-copy-embed:hover {
  box-shadow: 0 0 18px var(--pp-orange-glow);
  transform: translateY(-1px);
}

.pp-embed-credit {
  font-size: 0.76rem;
  color: rgba(219,234,254,.5);
  margin-top: 0.75rem;
  font-style: italic;
}
.pp-embed-credit strong {
  color: rgba(248,112,62,.75);
}

/* ── 8. MICROTEXT & BRANDING ─────────────────────────────────── */
.pp-microtext {
  position: relative;
  z-index: 1;
  font-size: 0.88rem;
  color: var(--pp-soft);
  font-style: italic;
  margin-bottom: 0.4rem;
  opacity: 0.7;
}

.pp-branding {
  position: relative;
  z-index: 1;
  font-size: 0.72rem;
  color: var(--pp-soft);
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.38;
  margin-top: 0.75rem;
}

/* ── 9. RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 620px) {
  .pp-phrase-wow {
    padding: 2.5rem 1.25rem 2rem;
    border-radius: 18px;
    margin: 1rem auto;
    width: 96%;
  }
  .pp-bulle {
    font-size: 1.85rem;
    padding: 1.5rem 1.1rem;
    max-width: 100%;
  }
  .pp-actions {
    gap: 0.5rem;
  }
  .pp-btn {
    padding: 0.6rem 0.9rem;
    font-size: 0.82rem;
  }
  .pp-embed-box {
    max-width: 100%;
    padding: 1.1rem 1rem;
  }
  .pp-embed-code-wrap {
    flex-direction: column;
  }
  .pp-btn-copy-embed {
    width: 100%;
    padding: 0.7rem;
    text-align: center;
  }
  .pp-embed-formats {
    flex-direction: column;
  }
}
