/* Cheapz ShadeBot — lightning reveal + answer box (no floating shades) */

.shadebot-root {
  position: fixed;
  inset: 0;
  z-index: 130;
  pointer-events: none;
  font-family: var(--font-body, Outfit, system-ui, sans-serif);
}

.shadebot-root * {
  box-sizing: border-box;
}

.shadebot-root.is-open {
  pointer-events: auto;
}

.shadebot-launcher {
  display: none !important;
}

.shadebot-cta-card {
  border-color: rgba(255, 99, 71, 0.45);
  background: linear-gradient(135deg, rgba(240, 193, 75, 0.14), rgba(255, 99, 71, 0.16));
}

/* Full-screen stage — ask on top, answer below (tight stack) */
.shadebot-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.55rem;
  padding:
    max(0.75rem, env(safe-area-inset-top, 0px))
    max(0.75rem, env(safe-area-inset-right, 0px))
    calc(0.85rem + env(safe-area-inset-bottom, 0px))
    max(0.75rem, env(safe-area-inset-left, 0px));
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

.shadebot-stage[hidden] {
  display: none !important;
}

.shadebot-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(40, 20, 70, 0.5), rgba(5, 6, 16, 0.9) 70%);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.shadebot-root.is-open .shadebot-backdrop {
  opacity: 1;
}

.shadebot-swirls {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.shadebot-swirl {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(240, 193, 75, 0.22);
  opacity: 0;
  mix-blend-mode: screen;
}

.shadebot-root.is-answering .shadebot-swirl {
  animation: shadebot-swirl-in 0.9s ease-out forwards;
}

.shadebot-swirl:nth-child(1) {
  width: 120vmax;
  height: 120vmax;
  left: 50%;
  top: 45%;
  margin: -60vmax;
}
.shadebot-swirl:nth-child(2) {
  width: 85vmax;
  height: 85vmax;
  left: 50%;
  top: 45%;
  margin: -42.5vmax;
  border-color: rgba(255, 99, 71, 0.25);
  animation-delay: 0.08s;
}
.shadebot-swirl:nth-child(3) {
  width: 55vmax;
  height: 55vmax;
  left: 50%;
  top: 45%;
  margin: -27.5vmax;
  border-color: rgba(255, 255, 255, 0.16);
  animation-delay: 0.16s;
}

@keyframes shadebot-swirl-in {
  0% {
    opacity: 0;
    transform: scale(0.25) rotate(0deg);
  }
  45% {
    opacity: 0.8;
  }
  100% {
    opacity: 0.15;
    transform: scale(1.1) rotate(120deg);
  }
}

.shadebot-lightning {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.9) 50%, transparent 58%),
    radial-gradient(circle at 50% 40%, rgba(240, 193, 75, 0.75), transparent 42%);
  mix-blend-mode: screen;
}

.shadebot-root.is-strike .shadebot-lightning {
  animation: shadebot-strike 0.5s ease-out;
}

@keyframes shadebot-strike {
  0% {
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  28% {
    opacity: 0.12;
  }
  42% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
  }
}

/* Hide old hero shades if present */
.shadebot-hero {
  display: none !important;
}

/* Answer box — sits tight under the ask dock */
.shadebot-answer {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  max-height: min(50vh, 380px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  border: 1px solid rgba(240, 193, 75, 0.45);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(18, 22, 48, 0.94) 38%, rgba(10, 12, 28, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 16px 40px rgba(0, 0, 0, 0.45);
  color: #fff;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.shadebot-root.is-revealed .shadebot-answer,
.shadebot-root.is-answering .shadebot-answer {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.shadebot-answer-label {
  margin: 0 0 0.45rem;
  font-family: var(--font-display, Fredoka, sans-serif);
  font-size: 0.8rem;
  color: #ffe08a;
}

.shadebot-answer-text {
  margin: 0;
  font-size: clamp(1rem, 3.9vw, 1.12rem);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.shadebot-answer-text.typing {
  opacity: 0.75;
  font-style: italic;
}

.shadebot-dock {
  position: relative;
  z-index: 4;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.shadebot-dock-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.shadebot-brand {
  font-family: var(--font-display, Fredoka, sans-serif);
  color: #ffe08a;
  font-size: 0.95rem;
}

.shadebot-close {
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.2rem;
}

.shadebot-form {
  display: flex;
  gap: 0.4rem;
  width: 100%;
  max-width: 100%;
}

.shadebot-input {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font: inherit;
  font-size: 16px; /* stops iOS zoom + keeps layout stable */
  padding: 0.8rem 0.9rem;
  min-height: 48px;
}

.shadebot-input:focus {
  outline: 2px solid rgba(240, 193, 75, 0.5);
  outline-offset: 1px;
}

.shadebot-send {
  flex: 0 0 auto;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff6347, #f0c14b);
  color: #1a1040;
  font: inherit;
  font-weight: 800;
  padding: 0 0.85rem;
  min-height: 48px;
  cursor: pointer;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .shadebot-stage {
    gap: 0.45rem;
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }

  .shadebot-answer {
    max-height: min(48vh, 320px);
    padding: 0.9rem 0.95rem;
  }

  .shadebot-send {
    padding: 0 0.7rem;
  }
}

.shadebot-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  .shadebot-answer,
  .shadebot-swirl,
  .shadebot-lightning {
    animation: none !important;
    transition: none !important;
  }
}
