/* ============================================================
   PREZO-EFFECTS — 9 efeitos visuais curados
   Mobile-first, prefers-reduced-motion respeitado.
   Cada projeto importa e usa 2 a 4 efeitos.
   ============================================================ */

/* ================= 01. Glass Panel ================= */

.fx-glass {
  padding: 1.5rem 2rem;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.fx-glass--dark {
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.15);
}

/* ================= 02. Aurora Background ================= */

.fx-aurora {
  position: relative;
  overflow: hidden;
}

.fx-aurora__bg {
  position: absolute;
  inset: -20%;
  background: conic-gradient(
    from 140deg at 60% 40%,
    rgba(196, 105, 79, 0.55),
    rgba(122, 158, 126, 0.35),
    rgba(245, 240, 232, 0.2),
    rgba(196, 105, 79, 0.55)
  );
  filter: blur(48px);
  opacity: 0.85;
  animation: fx-aurora-spin 18s linear infinite;
  will-change: transform;
  pointer-events: none;
}

.fx-aurora__content {
  position: relative;
  z-index: 1;
}

@keyframes fx-aurora-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ================= 03. Light Ray ================= */

.fx-ray {
  height: 1px;
  border: none;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(245, 240, 232, 0.9),
    transparent
  );
  position: relative;
  margin-block: 1rem;
}

.fx-ray::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 80%;
  height: 20px;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    ellipse at center,
    rgba(196, 105, 79, 0.4),
    transparent 70%
  );
  filter: blur(4px);
  pointer-events: none;
}

.fx-ray--subtle::before {
  opacity: 0.5;
}

/* ================= 04. Parallax Suave ================= */

.fx-parallax {
  position: relative;
  overflow: hidden;
}

.fx-parallax__layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  will-change: transform;
  transition: transform 50ms linear;
}

.fx-parallax__content {
  position: relative;
  z-index: 1;
}

/* ================= 05. Fade in on Scroll ================= */

.fx-fade {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fx-fade.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ================= 06. Text Reveal ================= */

.fx-text-reveal > span {
  display: inline-block;
  opacity: 0;
  transform: translateY(12px);
  animation: fx-text-rise 0.8s ease forwards;
  animation-delay: calc(var(--i, 0) * 120ms);
}

@keyframes fx-text-rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= 07. Magnetic Cursor ================= */

.fx-magnetic {
  position: relative;
  transition: transform 220ms cubic-bezier(0.25, 1, 0.3, 1);
  will-change: transform;
}

/* ================= 08. Noise Texture Overlay ================= */

.fx-noise {
  position: relative;
  isolation: isolate;
}

.fx-noise::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' /><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.18;
  pointer-events: none;
  mix-blend-mode: overlay;
  z-index: 0;
}

.fx-noise > * {
  position: relative;
  z-index: 1;
}

/* ================= 09. Cursor Spotlight ================= */

.fx-spotlight {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  --fx-mx: 50%;
  --fx-my: 50%;
}

.fx-spotlight::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle 240px at var(--fx-mx) var(--fx-my),
    rgba(196, 105, 79, 0.5),
    transparent 70%
  );
  pointer-events: none;
  transition: background 140ms linear;
  z-index: 0;
}

.fx-spotlight > * {
  position: relative;
  z-index: 1;
}

/* ================= 14. Chat Scroll Blur ================= */

.fx-chat-scroll {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-block: 2rem;
  position: relative;
}

.fx-chat-scroll__msg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  opacity: 0;
  filter: blur(10px);
  transform: translateY(16px);
  transition: opacity 0.5s ease, filter 0.5s ease, transform 0.45s ease;
  will-change: filter, opacity;
}

.fx-chat-scroll__msg--right {
  flex-direction: row-reverse;
}

.fx-chat-scroll__msg.is-revealed {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

@media (min-width: 768px) {
  .fx-chat-scroll::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 6px;
    transform: translateX(-50%);
    background: linear-gradient(to bottom, transparent, #d8d4cf 8%, #d8d4cf 92%, transparent);
    border-radius: 3px;
    pointer-events: none;
  }

  .fx-chat-scroll__msg {
    width: 46%;
    margin: 0;
  }

  .fx-chat-scroll__msg--left {
    align-self: flex-start;
  }

  .fx-chat-scroll__msg--right {
    align-self: flex-end;
  }
}

.fx-chat-scroll__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--c-sage, #7a9e7e);
  flex-shrink: 0;
}

.fx-chat-scroll__avatar--b { background: #6b8fa8; }
.fx-chat-scroll__avatar--c { background: #9e9590; }
.fx-chat-scroll__avatar--d { background: #b07c6a; }
.fx-chat-scroll__avatar--e { background: #8a9a5b; }

.fx-chat-scroll__bubble {
  padding: 0.7rem 1.1rem;
  background: #fff;
  border-radius: 18px 18px 18px 4px;
  font-style: italic;
  font-size: 0.9rem;
  line-height: 1.55;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.fx-chat-scroll__msg--right .fx-chat-scroll__bubble {
  border-radius: 18px 18px 4px 18px;
}

/* ================= Reduced motion fallback ================= */

@media (prefers-reduced-motion: reduce) {
  .fx-aurora__bg { animation: none; }
  .fx-parallax__layer { transform: none !important; transition: none; }
  .fx-fade { opacity: 1; transform: none; transition: none; }
  .fx-text-reveal > span { animation: none; opacity: 1; transform: none; }
  .fx-magnetic { transform: none !important; transition: none; }
  .fx-spotlight::before { transition: none; }
  .fx-chat-scroll__msg { opacity: 1 !important; filter: none !important; transform: none !important; transition: none !important; }
}
