/* ============================================================
   aura-decide.css  |  AURA Decide Widget — Bright Purple Theme
   TerraLeap · UpLeap Technologies
   v3 — Added: .ad-options/.ad-option-btn, .ad-links/.ad-link-btn,
        media (image/video/audio), responsive fixes
   ============================================================ */

/* ── FAB Launcher (circular icon button) ── */
.ad-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10000;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #9333EA 0%, #2D0A6B 100%);
  box-shadow:
    0 6px 22px rgba(109,40,217,.65),
    0 2px 8px rgba(0,0,0,.3),
    inset 0 1px 0 rgba(255,255,255,.22);
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease, box-shadow .2s ease;
  animation: ad-fab-in .55s cubic-bezier(.22,1,.36,1) .4s both;
  outline: none;
}
.ad-launcher:hover {
  transform: translateY(-3px) scale(1.07);
  box-shadow:
    0 12px 32px rgba(147,51,234,.7),
    0 4px 12px rgba(0,0,0,.32),
    inset 0 1px 0 rgba(255,255,255,.28);
}
.ad-launcher:active { transform: scale(.95); }

@keyframes ad-fab-in {
  from { opacity: 0; transform: scale(.6) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.ad-launcher::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 54%;
  height: 30%;
  border-radius: 50%;
  background: rgba(255,255,255,.28);
  pointer-events: none;
}
.ad-launcher::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(167,90,255,.6);
  opacity: 0;
  animation: ad-fab-ping 2.8s ease-out infinite 1.2s;
  pointer-events: none;
}
@keyframes ad-fab-ping {
  0%   { opacity: .7; transform: scale(.9); }
  100% { opacity: 0;  transform: scale(1.35); }
}

.ad-launcher svg {
  width: 30px;
  height: 30px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

/* ── Tooltip ── */
.ad-launcher-tip {
  position: fixed;
  right: 84px;
  bottom: 36px;
  z-index: 10000;
  background: rgba(45,10,107,.96);
  color: #e9d5ff;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 8px;
  white-space: nowrap;
  border: 1px solid rgba(192,132,252,.35);
  box-shadow: 0 4px 14px rgba(45,10,107,.4);
  pointer-events: none;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity .18s ease, transform .18s ease;
}
.ad-launcher-tip::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 5px 0 5px 5px;
  border-style: solid;
  border-color: transparent transparent transparent rgba(45,10,107,.96);
}
.ad-launcher:hover + .ad-launcher-tip {
  opacity: 1;
  transform: translateX(0);
}

/* ── Teaser bubble ── */
.ad-teaser {
  position: fixed;
  right: 24px;
  bottom: 86px;
  z-index: 9999;
  max-width: 230px;
  background: #fff;
  color: #2D0A6B;
  padding: 13px 28px 13px 15px;
  border-radius: 14px 14px 4px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 16px 42px rgba(45,10,107,.2), 0 2px 8px rgba(0,0,0,.07);
  border: 1px solid #E5E7EB;
  animation: ad-teaser-in .5s cubic-bezier(.22,1,.36,1) 1.6s both;
  cursor: pointer;
}
.ad-teaser-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 13.5px;
  color: #2D0A6B;
  margin-bottom: 4px;
}
.ad-teaser-body { color: #4B5563; font-size: 12px; }
.ad-teaser-close {
  position: absolute;
  top: 5px;
  right: 7px;
  background: none;
  border: none;
  cursor: pointer;
  color: #9CA3AF;
  font-size: 13px;
  padding: 2px 5px;
  border-radius: 4px;
  line-height: 1;
}
.ad-teaser-close:hover { background: #F3F4F6; color: #2D0A6B; }
.ad-teaser.ad-teaser-out { animation: ad-teaser-out .3s ease forwards; }
@keyframes ad-teaser-in {
  from { opacity: 0; transform: translateY(8px) scale(.93); transform-origin: bottom right; }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ad-teaser-out {
  to { opacity: 0; transform: translateY(6px) scale(.93); }
}

/* ── Panel ── */
.ad-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(380px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 80px));
  z-index: 10001;
  background: linear-gradient(180deg, #1E0550 0%, #3B0F9E 50%, #6D28D9 100%);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(109,40,217,.6), 0 4px 18px rgba(0,0,0,.28);
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  border: 1px solid rgba(216,180,254,.22);
}
.ad-panel.ad-open {
  display: flex;
  animation: ad-panel-in .4s cubic-bezier(.22,1,.36,1);
}
@keyframes ad-panel-in {
  from { opacity: 0; transform: translateY(16px) scale(.96); transform-origin: bottom right; }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.ad-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(216,180,254,.16);
  flex-shrink: 0;
}
.ad-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #9333EA 0%, #2D0A6B 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 12px rgba(147,51,234,.55);
}
.ad-avatar-mark {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 16px;
  font-weight: 500;
  color: #fff;
}
.ad-says {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 15.5px;
  font-weight: 500;
  color: #fff;
  line-height: 1.15;
}
.ad-says em { font-style: normal; color: #e9d5ff; font-weight: 400; }
.ad-meta {
  font-size: 9.5px;
  color: rgba(233,213,255,.7);
  letter-spacing: .8px;
  text-transform: uppercase;
  margin-top: 2px;
}
.ad-min-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 10px;
  line-height: 1;
  border-radius: 6px;
}
.ad-min-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

/* Body */
.ad-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(216,180,254,.28) transparent;
}
.ad-body::-webkit-scrollbar { width: 5px; }
.ad-body::-webkit-scrollbar-thumb { background: rgba(216,180,254,.28); border-radius: 3px; }

/* Messages */
.ad-msg {
  margin-bottom: 12px;
  max-width: 88%;
  animation: ad-msg-in .32s cubic-bezier(.22,1,.36,1);
}
@keyframes ad-msg-in {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ad-msg.ad-bot {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(216,180,254,.2);
  color: #F3E8FF;
  border-radius: 14px 14px 14px 4px;
  padding: 10px 13px;
  font-size: 13px;
  line-height: 1.5;
}
.ad-msg.ad-bot strong { color: #fff; font-weight: 600; }
.ad-msg.ad-bot a {
  color: #d8b4fe;
  text-decoration: none;
  border-bottom: 1px dotted rgba(216,180,254,.45);
}
.ad-msg.ad-user {
  background: linear-gradient(135deg, #6D28D9, #9333EA);
  color: #fff;
  border-radius: 14px 14px 4px 14px;
  padding: 9px 13px;
  font-size: 13px;
  margin-left: auto;
  box-shadow: 0 2px 10px rgba(109,40,217,.45);
}

/* ── Option buttons (from API — stay inside panel) ── */
.ad-options {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 4px 0 14px;
  max-width: 92%;
  animation: ad-msg-in .4s cubic-bezier(.22,1,.36,1);
}
.ad-option-btn {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(192,132,252,.45);
  color: #e9d5ff;
  padding: 9px 13px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
  line-height: 1.4;
  width: 100%;
}
.ad-option-btn:hover {
  background: rgba(192,132,252,.22);
  border-color: #c084fc;
  color: #fff;
  transform: translateX(3px);
}
.ad-option-btn:active {
  background: rgba(192,132,252,.35);
  transform: translateX(1px);
}

/* ── Course / action links (open in new tab) ── */
.ad-links {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 4px 0 14px;
  max-width: 92%;
  animation: ad-msg-in .4s cubic-bezier(.22,1,.36,1);
}
.ad-link-btn {
  display: block;
  background: linear-gradient(135deg, #6D28D9, #9333EA);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  transition: all .15s ease;
  line-height: 1.4;
}
.ad-link-btn:hover {
  background: linear-gradient(135deg, #4C1D95, #6D28D9);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(109,40,217,.5);
  color: #fff;
  text-decoration: none;
}
.ad-link-btn:active { transform: translateY(0); }

/* ── Media: image / video / audio ── */
.ad-media {
  margin-bottom: 12px;
  max-width: 92%;
  border-radius: 12px;
  overflow: hidden;
  animation: ad-msg-in .35s cubic-bezier(.22,1,.36,1);
  border: 1px solid rgba(216,180,254,.2);
  background: rgba(255,255,255,.04);
}
.ad-media-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px 12px 0 0;
  object-fit: cover;
  max-height: 200px;
}
.ad-media-video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px 12px 0 0;
  max-height: 200px;
  background: #000;
}
.ad-media-audio {
  display: block;
  width: 100%;
  padding: 10px 12px;
  background: rgba(255,255,255,.05);
  border-radius: 12px;
  /* Style the native audio player to fit the dark theme */
  filter: invert(1) hue-rotate(180deg);
}
.ad-media-caption {
  font-size: 11.5px;
  color: rgba(233,213,255,.7);
  padding: 7px 12px 9px;
  line-height: 1.4;
  font-style: italic;
}

/* ── Legacy choice buttons (local flow, kept for compatibility) ── */
.ad-choices {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 6px 0 14px;
  max-width: 88%;
  animation: ad-msg-in .4s cubic-bezier(.22,1,.36,1);
}
.ad-choice {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(192,132,252,.42);
  color: #e9d5ff;
  padding: 9px 13px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  font-family: 'DM Sans', sans-serif;
  transition: all .15s ease;
  line-height: 1.35;
}
.ad-choice:hover {
  background: rgba(192,132,252,.18);
  color: #fff;
  border-color: #c084fc;
  transform: translateX(2px);
}
.ad-choice .ad-choice-icon { margin-right: 8px; opacity: .9; }

/* ── Recommendation card ── */
.ad-rec {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(192,132,252,.35);
  border-radius: 14px;
  padding: 14px;
  margin: 8px 0 14px;
}
.ad-rec-label {
  font-size: 9.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #c084fc;
  font-weight: 700;
  margin-bottom: 6px;
}
.ad-rec-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 18px;
  font-weight: 500;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 4px;
}
.ad-rec-title em { font-style: normal; color: #e9d5ff; font-weight: 400; }
.ad-rec-sub {
  font-size: 12px;
  color: rgba(243,232,255,.78);
  line-height: 1.5;
  margin-bottom: 12px;
}
.ad-rec-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.ad-rec-btn {
  flex: 1;
  min-width: 0;
  background: linear-gradient(135deg, #6D28D9, #9333EA);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  transition: all .15s;
  white-space: nowrap;
}
.ad-rec-btn:hover {
  background: linear-gradient(135deg, #4C1D95, #6D28D9);
  transform: translateY(-1px);
  color: #fff;
  text-decoration: none;
}
.ad-rec-btn-ghost {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.2);
}
.ad-rec-btn-ghost:hover { background: rgba(255,255,255,.13); }

/* ── Typing dots ── */
.ad-typing {
  display: inline-flex;
  gap: 4px;
  padding: 10px 14px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(216,180,254,.2);
  border-radius: 14px 14px 14px 4px;
  margin-bottom: 12px;
}
.ad-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c084fc;
  animation: ad-typing-bob 1.2s ease-in-out infinite;
}
.ad-typing span:nth-child(2) { animation-delay: .15s; background: #e9d5ff; }
.ad-typing span:nth-child(3) { animation-delay: .3s;  background: #f3e8ff; }
@keyframes ad-typing-bob {
  0%,80%,100% { opacity: .25; transform: translateY(0); }
  40%         { opacity: 1;   transform: translateY(-3px); }
}

/* ── Input row ── */
.ad-input-row {
  display: flex;
  padding: 10px 12px;
  border-top: 1px solid rgba(216,180,254,.16);
  background: rgba(30,5,80,.6);
  flex-shrink: 0;
  gap: 6px;
}
.ad-input-row input {
  flex: 1;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(216,180,254,.25);
  color: #fff;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 18px;
  outline: none;
  font-family: 'DM Sans', sans-serif;
}
.ad-input-row input::placeholder { color: rgba(233,213,255,.5); }
.ad-input-row input:focus {
  border-color: #c084fc;
  background: rgba(255,255,255,.13);
}
.ad-input-row button {
  background: linear-gradient(135deg, #6D28D9, #9333EA);
  color: #fff;
  border: none;
  border-radius: 18px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
}
.ad-input-row button:hover { background: linear-gradient(135deg, #4C1D95, #6D28D9); }

/* ── Restart row ── */
.ad-restart-row {
  text-align: center;
  padding: 8px 14px 12px;
  font-size: 11px;
  color: rgba(216,180,254,.55);
  flex-shrink: 0;
}
.ad-restart-row a {
  color: rgba(216,180,254,.8);
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1px dotted rgba(216,180,254,.4);
}
.ad-restart-row a:hover { color: #fff; }

/* ── Hide launcher + teaser when panel open ── */
body.ad-panel-open .ad-launcher,
body.ad-panel-open .ad-launcher-tip,
body.ad-panel-open .ad-teaser { display: none; }

/* ── Desktop ── */
@media (min-width: 768px) {
  .ad-launcher {
    width: 56px;
    height: 56px;
    right: 28px;
    bottom: 28px;
  }
  .ad-launcher svg { width: 32px; height: 32px; }
  .ad-launcher-tip { right: 94px; bottom: 42px; }
  .ad-teaser { right: 28px; bottom: 96px; }
  .ad-panel  { right: 28px; bottom: 28px; }
}

/* ── Mobile ── */
@media (max-width: 480px) {
  .ad-launcher {
    width: 48px;
    height: 48px;
    right: 16px;
    bottom: 80px;
  }
  .ad-launcher svg { width: 26px; height: 26px; }
  .ad-launcher-tip { display: none; }
  .ad-teaser {
    right: 16px;
    bottom: 140px;
    max-width: 200px;
  }
  .ad-panel {
    right: 0;
    bottom: 0;
    width: 100vw;
    border-radius: 16px 16px 0 0;
    height: min(92dvh, 640px);
  }
  .ad-media-img,
  .ad-media-video { max-height: 160px; }
}
