/* tellstew-box.css — THE ONE TellStew interaction component
   Shared across Landing, App, Companion (CAL).
   Uses the shared stew-design-tokens.css :root vars.
   PHD: 100% Ethical-Legal-Care, 0% Greed-Hate-Harm */

.tellstew-box {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
  width: min(92vw, 520px);

  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;

  /* Cloaked-gel: transparent + backdrop-blur + hairline + glow */
  background: rgba(10, 14, 20, 0.55);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(212, 169, 52, 0.18);
  border-radius: 14px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(212, 169, 52, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);

  font-family: Georgia, 'Times New Roman', serif;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.tellstew-box:focus-within {
  border-color: rgba(212, 169, 52, 0.42);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 18px rgba(212, 169, 52, 0.12);
}

/* The comet indicator (left side) */
.tellstew-box .ts-comet {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, rgba(120,180,255,0.9) 45%, rgba(180,140,255,0.85) 80%);
  box-shadow: 0 0 12px 3px rgba(130, 160, 255, 0.35);
  flex-shrink: 0;
  animation: ts-idle-bob 3s ease-in-out infinite;
}
@keyframes ts-idle-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
/* Talking state */
.tellstew-box.ts-talking .ts-comet {
  animation: ts-talk-jiggle 0.3s ease-in-out infinite;
}
@keyframes ts-talk-jiggle {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(1px, -1px); }
  75% { transform: translate(-1px, 1px); }
}
/* Acting state */
.tellstew-box.ts-acting .ts-comet {
  animation: ts-act-beam 1.5s ease-in-out infinite;
  box-shadow: 0 0 20px 6px rgba(212, 169, 52, 0.4);
}
@keyframes ts-act-beam {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* Input field */
.tellstew-box .ts-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink, #e4e8ed);
  font-size: 0.88rem;
  font-family: inherit;
  line-height: 1.4;
}
.tellstew-box .ts-input::placeholder {
  color: var(--muted, #7a8694);
  font-style: italic;
}

/* Send button */
.tellstew-box .ts-send {
  background: var(--gold, #d4a934);
  color: var(--bg, #0a0e14);
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-family: Georgia, serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.tellstew-box .ts-send:hover {
  background: #e0b93f;
}
.tellstew-box .ts-send:active {
  transform: scale(0.97);
}

/* Response area (below the input, slides open) */
.tellstew-box .ts-response-area {
  display: none;
  width: 100%;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(212, 169, 52, 0.12);
  font-size: 0.82rem;
  color: var(--ink, #e4e8ed);
  line-height: 1.5;
  max-height: 200px;
  overflow-y: auto;
}
.tellstew-box.ts-has-response .ts-response-area {
  display: block;
}
.tellstew-box .ts-response-area .ts-answer {
  color: var(--gold, #d4a934);
  font-weight: 600;
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .tellstew-box {
    bottom: 16px;
    width: calc(100vw - 24px);
    padding: 10px 12px;
    border-radius: 12px;
  }
  .tellstew-box .ts-comet {
    width: 26px;
    height: 26px;
  }
}
