/* =====================================================
   ANIMATIONS
===================================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutLeft {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-40px); }
}

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%           { transform: translateY(-6px); }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(98, 125, 112, 0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(98, 125, 112, 0); }
}

@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(98, 125, 112, 0.5); }
  50%       { box-shadow: 0 0 0 6px rgba(98, 125, 112, 0); }
}

@keyframes xpPop {
  0%   { opacity: 0; transform: scale(0.6) translateY(10px); }
  60%  { opacity: 1; transform: scale(1.2) translateY(-4px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes barFill {
  from { width: 0%; }
  to   { width: var(--target-width, 100%); }
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes floatMentor {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-4px); }
}

@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-5px); opacity: 1; }
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastSlideOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-10px) scale(0.97); }
}

@keyframes phaseEnter {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes phaseExit {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-16px); }
}

/* ─── XP Pop ──────────────────────────────────────── */
.xp-pop {
  animation: xpPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ─── Score Bar ───────────────────────────────────── */
[data-score-bar] {
  transition: width 0s; /* reset before animation */
}
[data-score-bar].animate {
  animation: barFill 0.7s ease-out both;
  width: var(--target-width, 100%) !important;
}

/* ─── Typing Indicator ───────────────────────────── */
.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: var(--cream, #F5F0E8);
  border-radius: 16px 16px 16px 4px;
  margin: 6px 0;
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sage, #627d70);
  animation: typingDot 1.2s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

/* ─── Phase Transitions ──────────────────────────── */
#phase-content.phase-enter {
  animation: phaseEnter 0.3s ease-out both;
}

#phase-content.phase-exit {
  animation: phaseExit 0.2s ease-in both;
  pointer-events: none;
}

/* ─── Mentor FAB Float ───────────────────────────── */
.mentor-float {
  animation: floatMentor 3s ease-in-out infinite;
}

/* ─── Toast Notifications ────────────────────────── */
#toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(360px, calc(100vw - 32px));
}

.toast {
  width: 100%;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
  pointer-events: auto;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  transform: translateY(-12px) scale(0.97);
}

.toast--visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast--out {
  opacity: 0;
  transform: translateY(-10px) scale(0.97);
}

.toast--info    { background: #4a7c6f; }
.toast--success { background: #3d7a5c; }
.toast--warning { background: #b5843a; }

/* ─── Approach Chip Toggle ───────────────────────── */
.approach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--sage, #627d70);
  font-size: 0.85rem;
  color: var(--sage, #627d70);
  background: transparent;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  user-select: none;
}

.approach-chip.selected,
.approach-chip[aria-pressed="true"] {
  background: var(--sage, #627d70);
  color: #fff;
  border-color: var(--sage, #627d70);
}

/* ─── Confidence Slider ──────────────────────────── */
.confidence-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(
    to right,
    var(--sage, #627d70) 0%,
    var(--sage, #627d70) var(--fill-pct, 50%),
    #ddd var(--fill-pct, 50%),
    #ddd 100%
  );
  outline: none;
  cursor: pointer;
}

.confidence-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--sage, #627d70);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform 0.15s;
}

.confidence-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.confidence-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--sage, #627d70);
  border: none;
  cursor: pointer;
}
