/* ==========================================================================
   VARIANTE FOND HERO GEO (violet / indigo "IA")
   ========================================================================== */
.at-presta--geo .at-presta-hero-bg {
  background:
    radial-gradient(rgba(124, 58, 237, 0.14) 1px, transparent 1px) 0 0 / 26px 26px,
    radial-gradient(rgba(99, 102, 241, 0.08) 1px, transparent 1px) 13px 13px / 26px 26px,
    repeating-linear-gradient(
      110deg,
      transparent,
      transparent 110px,
      rgba(124, 58, 237, 0.05) 110px,
      rgba(124, 58, 237, 0.07) 111px
    ),
    linear-gradient(160deg, rgba(124,58,237,0.20) 0%, rgba(0,120,200,0.10) 42%, transparent 72%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

/* ==========================================================================
   ROOT
   ========================================================================== */
.at-presta-answer {
  --geo-accent: #7C3AED;
  --geo-accent-2: #6366F1;
  position: relative;
  width: 100%;
  max-width: 400px;
  perspective: 1000px;
}

.at-presta-answer-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 130%;
  height: 130%;
  background: radial-gradient(ellipse at center,
    rgba(124, 58, 237, 0.26) 0%,
    rgba(0, 120, 200, 0.10) 50%,
    transparent 70%
  );
  filter: blur(50px);
  animation: at-geo-glow-pulse 4s ease-in-out infinite;
  z-index: -1;
}

@keyframes at-geo-glow-pulse {
  0%, 100% { opacity: .55; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: .85; transform: translate(-50%, -50%) scale(1.05); }
}

/* ==========================================================================
   CONTAINER
   ========================================================================== */
.at-presta-answer-container {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(255,255,255,.95) 100%);
  border: 2px solid #1a1a1a;
  border-radius: 16px;
  box-shadow:
    0 4px 6px rgba(0,0,0,.02),
    0 12px 24px rgba(0,0,0,.06),
    0 24px 48px rgba(0,0,0,.08),
    inset 0 1px 0 rgba(255,255,255,.9);
  overflow: hidden;
  transform: rotateY(-5deg) rotateX(2deg);
  transform-style: preserve-3d;
  transition: transform .4s ease;
}

.at-presta-answer:hover .at-presta-answer-container {
  transform: rotateY(-2deg) rotateX(1deg);
}

/* ==========================================================================
   HEADER DARK
   ========================================================================== */
.at-presta-answer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%);
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.at-presta-answer-dots { display: flex; gap: 6px; }

.at-presta-answer-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.at-presta-answer-dots span:nth-child(1) { background: #f87171; }
.at-presta-answer-dots span:nth-child(2) { background: #fbbf24; }
.at-presta-answer-dots span:nth-child(3) { background: #34d399; }

.at-presta-answer-title {
  flex: 1;
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: rgba(255,255,255,.7);
}

.at-presta-answer-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #a78bfa;
}

.at-presta-answer-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a78bfa;
  animation: at-geo-status-pulse 1.5s ease-in-out infinite;
}

@keyframes at-geo-status-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(167,139,250,.45); }
  50%      { opacity: .8; box-shadow: 0 0 0 4px rgba(167,139,250,0); }
}

/* ==========================================================================
   BODY
   ========================================================================== */
.at-presta-answer-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ==========================================================================
   PROMPT (effet frappe)
   ========================================================================== */
.at-presta-answer-prompt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(124,58,237,.06) 0%, rgba(99,102,241,.03) 100%);
  border: 1px solid rgba(124,58,237,.18);
  border-radius: 10px;
}

.at-presta-answer-prompt-icon {
  font-size: 13px;
  color: var(--geo-accent);
  flex: 0 0 auto;
}

.at-presta-answer-prompt-text {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  width: 0;
  animation: at-geo-type 1.6s steps(34, end) .4s forwards;
}

.at-presta-answer-prompt-text span {
  display: inline-block;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  color: var(--trafic-dark);
}

@keyframes at-geo-type { to { width: 100%; } }

.at-presta-answer-caret {
  flex: 0 0 auto;
  width: 2px;
  height: 14px;
  background: var(--geo-accent);
  animation: at-geo-caret-blink 1s steps(2) infinite;
}

@keyframes at-geo-caret-blink { 50% { opacity: 0; } }

/* ==========================================================================
   RÉPONSE GÉNÉRÉE
   ========================================================================== */
.at-presta-answer-reply {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.at-presta-answer-avatar {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--geo-accent), var(--geo-accent-2));
  box-shadow: 0 4px 12px rgba(124,58,237,.35);
  opacity: 0;
  animation: at-geo-fade-in .3s ease forwards 2s;
}

.at-presta-answer-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 2px;
}

.at-presta-answer-line {
  display: block;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--trafic-dark);
  clip-path: inset(0 100% 0 0);
  animation: at-geo-line-reveal .55s ease forwards;
}

.at-presta-answer-line:nth-child(1) { animation-delay: 2.2s; }
.at-presta-answer-line:nth-child(2) { animation-delay: 2.75s; }
.at-presta-answer-line:nth-child(3) { animation-delay: 3.3s; }

@keyframes at-geo-line-reveal { to { clip-path: inset(0 0 0 0); } }

/* Mention de marque surlignée */
.at-presta-answer-brand {
  background: linear-gradient(135deg, rgba(124,58,237,.14), rgba(0,120,200,.10));
  color: var(--geo-accent);
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 5px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  animation: at-geo-brand-pulse 5s ease-in-out infinite 4.2s;
}

.at-presta-answer-brand sup {
  font-size: 8px;
  font-weight: 700;
  margin-left: 1px;
  color: var(--trafic-primary);
}

@keyframes at-geo-brand-pulse {
  0%, 14%, 100% { box-shadow: 0 0 0 0 rgba(124,58,237,0); }
  4%, 10%       { box-shadow: 0 0 16px 0 rgba(124,58,237,.45); }
}

/* ==========================================================================
   SOURCES
   ========================================================================== */
.at-presta-answer-sources {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: rgba(0,0,0,.02);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 10px;
}

.at-presta-answer-sources-label {
  font-family: 'Oswald', sans-serif;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--trafic-dark);
  opacity: .5;
  margin-bottom: 2px;
  animation: at-geo-fade-in .3s ease forwards 3.6s;
  opacity: 0;
}

.at-presta-answer-source {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 8px;
  opacity: 0;
  transform: translateX(-6px);
  animation: at-geo-source-in .4s ease forwards;
}

.at-presta-answer-source:nth-of-type(1) { animation-delay: 3.8s; }
.at-presta-answer-source:nth-of-type(2) { animation-delay: 4.1s; }

@keyframes at-geo-source-in {
  to { opacity: 1; transform: translateX(0); }
}

.at-presta-answer-source--cited {
  border-color: rgba(124,58,237,.35);
  background: linear-gradient(135deg, rgba(124,58,237,.05) 0%, #fff 100%);
}

.at-presta-answer-source-favicon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  font-family: 'Oswald', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: var(--trafic-dark);
  background: rgba(0,0,0,.05);
}

.at-presta-answer-source--cited .at-presta-answer-source-favicon {
  color: #fff;
  background: linear-gradient(135deg, var(--trafic-primary), var(--geo-accent));
}

.at-presta-answer-source-name {
  flex: 1;
  font-size: 11px;
  font-weight: 600;
  color: var(--trafic-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.at-presta-answer-source:not(.at-presta-answer-source--cited) .at-presta-answer-source-name {
  font-weight: 500;
  opacity: .55;
}

.at-presta-answer-source-badge {
  flex: 0 0 auto;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 2px 7px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--geo-accent), var(--geo-accent-2));
  opacity: 0;
  transform: scale(.7);
  animation:
    at-geo-badge-pop .35s cubic-bezier(.34,1.56,.64,1) forwards 4.5s,
    at-geo-badge-glow 5s ease-in-out infinite 5.5s;
}

@keyframes at-geo-badge-pop {
  to { opacity: 1; transform: scale(1); }
}

@keyframes at-geo-badge-glow {
  0%, 16%, 100% { box-shadow: 0 0 0 0 rgba(124,58,237,0); }
  6%, 12%       { box-shadow: 0 0 0 4px rgba(124,58,237,.18); }
}

/* ==========================================================================
   MOTEURS COUVERTS
   ========================================================================== */
.at-presta-answer-engines {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.at-presta-answer-engine {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(124,58,237,.20);
  background: rgba(124,58,237,.05);
  font-size: 10px;
  font-weight: 600;
  color: var(--trafic-dark);
  opacity: 0;
  transform: translateY(4px);
  animation: at-geo-engine-in .35s ease forwards;
}

.at-presta-answer-engine::before {
  content: "✓";
  font-size: 9px;
  font-weight: 700;
  color: var(--trafic-cta);
}

.at-presta-answer-engine:nth-child(1) { animation-delay: 4.8s; }
.at-presta-answer-engine:nth-child(2) { animation-delay: 5s; }
.at-presta-answer-engine:nth-child(3) { animation-delay: 5.2s; }

@keyframes at-geo-engine-in {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes at-geo-fade-in { to { opacity: 1; } }

/* ==========================================================================
   BALAYAGE LUMINEUX
   ========================================================================== */
.at-presta-answer-scan {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(100deg,
    transparent 0%,
    rgba(255,255,255,0) 40%,
    rgba(255,255,255,.55) 50%,
    rgba(255,255,255,0) 60%,
    transparent 100%
  );
  transform: skewX(-20deg);
  animation: at-geo-scan 6s ease-in-out infinite 5.5s;
  pointer-events: none;
  z-index: 3;
}

@keyframes at-geo-scan {
  0%        { left: -100%; }
  45%, 100% { left: 160%; }
}

/* ==========================================================================
   REFLET
   ========================================================================== */
.at-presta-answer-reflection {
  position: absolute;
  bottom: -50%;
  left: 5%;
  right: 5%;
  height: 50%;
  background: linear-gradient(180deg, rgba(124,58,237,.10) 0%, transparent 100%);
  transform: rotateX(180deg) rotateY(-5deg);
  opacity: .3;
  filter: blur(3px);
  mask-image: linear-gradient(180deg, rgba(0,0,0,.3) 0%, transparent 50%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.3) 0%, transparent 50%);
  pointer-events: none;
}

/* ==========================================================================
   ÉLÉMENTS ORBITANTS
   ========================================================================== */
.at-presta-answer-orbit {
  position: absolute;
  inset: -30px;
  pointer-events: none;
}

.at-presta-answer-orbit-item {
  position: absolute;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(255,255,255,.85));
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  font-size: 20px;
  animation: at-geo-orbit-float 4s ease-in-out infinite;
}

.at-presta-answer-orbit-item--tr { top: 5%;    right: -12%; animation-delay: 0s; }
.at-presta-answer-orbit-item--ml { top: 40%;   left: -12%;  animation-delay: 1s; }
.at-presta-answer-orbit-item--bl { bottom: 8%; left: -14%;  animation-delay: 2s; }
.at-presta-answer-orbit-item--br { bottom: 5%; right: -10%; animation-delay: 2.5s; }

@keyframes at-geo-orbit-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25%      { transform: translateY(-8px) rotate(3deg); }
  75%      { transform: translateY(4px) rotate(-2deg); }
}

.at-presta-answer-orbit-item--tag {
  width: auto;
  padding: 0 14px;
  min-width: 44px;
}

.at-presta-answer-orbit-item--tag span {
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--geo-accent);
}

.at-presta-answer-orbit-item--img {
  width: 52px;
  height: 52px;
  padding: 6px;
  background: #fff;
}

.at-presta-answer-orbit-item--img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ==========================================================================
   NOTIFICATIONS FLOTTANTES
   ========================================================================== */
.at-presta-answer-notif {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(255,255,255,.92));
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  font-size: 12px;
  font-weight: 600;
  color: var(--trafic-dark);
  opacity: 0;
  animation: at-geo-notif-appear .5s ease forwards, at-geo-notif-float 3s ease-in-out infinite;
}

.at-presta-answer-notif--tl { top: 8%;  left: -22%;  animation-delay: 1.5s, 2s; }
.at-presta-answer-notif--mr { top: 45%; right: -24%; animation-delay: 2.2s, 2.7s; }

@keyframes at-geo-notif-appear { to { opacity: 1; } }

@keyframes at-geo-notif-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.at-presta-answer-notif-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 11px;
  color: #fff;
  background: linear-gradient(135deg, var(--geo-accent), var(--geo-accent-2));
}

.at-presta-answer-notif-text { white-space: nowrap; }

/* ==========================================================================
   A11Y : REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .at-presta-answer-glow,
  .at-presta-answer-status-dot,
  .at-presta-answer-caret,
  .at-presta-answer-brand,
  .at-presta-answer-scan,
  .at-presta-answer-orbit-item,
  .at-presta-answer-notif {
    animation: none;
  }

  .at-presta-answer-prompt-text { width: 100%; animation: none; }

  .at-presta-answer-avatar,
  .at-presta-answer-sources-label,
  .at-presta-answer-source,
  .at-presta-answer-source-badge,
  .at-presta-answer-engine,
  .at-presta-answer-notif {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .at-presta-answer-line { clip-path: none; animation: none; }
}
