#studio25-chat-root { position:relative; z-index: 99999; }

/* --- Toggle Button --- */
#studio25-chat-toggle {
  position: fixed;
  right: 20px;
  bottom: 22px;
  background:linear-gradient(135deg, #C9F6E1 0%, #C9F6E1 50%, #FFE585 100%);
  background-size:100% 90%;
  border: none;
  border-radius: 50%;
  width: 62px;
  height: 62px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(201, 246, 225, 0.75);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: s25GradientPulse 8s ease-in-out infinite;
  overflow: visible;
  z-index: 100000;
}

#studio25-chat-close {
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  padding: 4px;
  transition: transform 0.2s ease, color 0.2s ease;
}

#studio25-chat-close:hover {
  color: #000;
  transform: rotate(90deg);
}

/* Buddy PNG inside toggle */
#studio25-chat-toggle img {
  width: 74px;
  height: 74px;
  pointer-events: none;
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease;
}

/* Idle subtle glowing pulse (2 colours) */
@keyframes s25GradientPulse {
  0%   { background-position: 48% 50%; }
  50%  { background-position: 52% 50%; }
  100% { background-position: 48% 50%; }
}

/* Idle subtle glowing pulse (50% stronger) */
@keyframes buddyGlow {
  0%   { box-shadow: 0 0 8px rgba(201, 246, 225, 0.6); }
  50%  { box-shadow: 0 0 18px rgba(201, 246, 225, 0.95); }
  100% { box-shadow: 0 0 8px rgba(201, 246, 225, 0.6); }
}

/* Hover: grow + stronger faster glow */
#studio25-chat-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 0 26px rgba(201, 246, 225, 1);
  animation: buddyGlowFast 1.5s ease-in-out infinite;
}

#studio25-chat-toggle:hover img {
  transform: scale(1.08);
}

@keyframes buddyGlowFast {
  0%   { box-shadow: 0 0 10px rgba(201, 246, 225, 0.75); }
  50%  { box-shadow: 0 0 26px rgba(201, 246, 225, 1); }
  100% { box-shadow: 0 0 10px rgba(201, 246, 225, 0.75); }
}

/* hidden state */
#studio25-chat-toggle.hidden {
  opacity: 0;
  pointer-events: none;
  animation-play-state: paused;
}

/* --- Chat Window --- */
#studio25-chat-container {
  position: fixed; right: 20px; bottom: 10px;
  width: 320px; max-height: 520px; display: flex; flex-direction: column;
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  font-family: 'Inter', sans-serif; font-size: 14px;
}

/* --- Header --- */
#studio25-chat-header {
  padding: 12px;
  background: linear-gradient(135deg, #C9F6E1, #FFE585);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #222;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 1px solid #eee;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* Header layout with Buddy avatar */
#studio25-chat-header { position: relative; }
.s25-header-left { display: flex; align-items: center; gap: 10px; }
.s25-buddy-avatar {
  width: 53px; height: 53px;
  object-fit: contain; flex: 0 0 42px;
}
.s25-header-text { display: flex; flex-direction: column; line-height: 1.1; }
.s25-header-text strong { font-size: 14px; color: #222; }
.s25-sub { font-size: 11px; color: #695d00; }

/* Trainer Buddy state (thank-you page) */
#studio25-chat-root.trainer-buddy .s25-buddy-avatar {
  transform: scale(1.25);
}
#studio25-chat-root.trainer-buddy #studio25-chat-header {
  background: linear-gradient(135deg, #E6FFFB, #FFE585);
}
#studio25-chat-root.trainer-buddy #studio25-chat-toggle {
  display: none;
}

/* --- Messages --- */
#studio25-chat-messages {
  flex: 1; overflow-y: auto; padding: 12px;
  background: #fafafa; display: flex; flex-direction: column; gap: 8px;
}

.chat-bubble {
  white-space: normal; /* collapse extra spaces/newlines */
  padding: 10px 14px; border-radius: 16px; max-width: 85%;
  white-space: pre-wrap; line-height: 1.5;
}

.chat-bubble.user {
  margin-left: auto; background: #efefef; text-align: right; color: #333;
  border-radius: 16px 16px 0 16px;
}

.chat-bubble.bot {
  position: relative;
  padding-left: 46px; /* space for avatar */
  display: flex; flex-direction: column;
  margin-right: auto; background: #fff; color: #444; border: 1px solid #eee;
  border-radius: 16px 16px 16px 0;
}

.chat-bubble.bot .s25-bot-avatar {
  position: absolute; left: 12px; top: 12px;
  width: 35px; height: 35px; border-radius: 50%;
  object-fit: contain; border: 1px solid rgba(0,0,0,0.05);
  background: #fff;
}

.chat-bubble.typing {
  font-style: italic; color: #777; background: #fffbe6; border: none;
  padding-left: 14px;
}

/* --- CTA Cards (clean vertical layout) --- */
.studio25-cta-card {
  display: flex; flex-direction: column; flex-wrap: wrap;
  padding: 10px 12px; margin: 6px 0;
  border: 1px solid #e1e1e1; border-radius: 10px;
  background: #fafafa; box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  text-align: center;
}

.studio25-cta-title {

  font-weight: 600; color: #222; font-size: 13px; margin-bottom: 6px;
}

.studio25-cta-card a {
  display: inline-block; padding: 6px 10px; background: #000; color: #fff;
  border-radius: 6px; text-decoration: none; font-size: 12px;
  transition: background 0.2s ease;
}
.studio25-cta-card a:hover { background: #444; }

/* Follow-up mini-CTA row (uses the same quick button look) */
.studio25-cta-follow {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px;
}

/* --- Input --- */
#studio25-chat-controls {
  display: flex; padding: 10px; gap: 8px; background: #fff;
  border-top: 1px solid #eee;
}
#studio25-chat-input {
  flex: 1; padding: 8px 10px; border-radius: 8px; border: 1px solid #ddd;
}
#studio25-chat-send {
  padding: 8px 14px; background: #000; color: #fff; border: none; border-radius: 8px; cursor: pointer;
}

/* --- Quick Buttons --- */
#studio25-chat-quick {
  text-align: center;
  margin-top: 8px;
}

#studio25-chat-quick .chat-quick-btn {
  display: inline-block;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 6px 12px;
  margin: 4px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
}

#studio25-chat-quick .chat-quick-btn:hover {
  background: #eee;
}

/* Buddy Askbacks */
.buddy-askback {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  opacity: 0;
  transform: translateY(4px);
  animation: buddyAskFade 0.5s ease forwards;
}

.buddy-askback:nth-child(1) {
  animation-delay: 0.1s;
}
.buddy-askback:nth-child(2) {
  animation-delay: 0.3s;
}
.buddy-askback:nth-child(3) {
  animation-delay: 0.5s;
}

@keyframes buddyAskFade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.buddy-askback-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

.buddy-askback-btn {
  background: #f4f4f4;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  color: #555;
  font-size: 13px;
  font-style: italic;
  text-align: left;
  cursor: pointer;
  padding: 6px 10px;
  transition: background 0.2s, color 0.2s, transform 0.15s ease;
  line-height: 1.4;
}

.buddy-askback-btn:hover {
  background: #eaeaea;
  color: #333;
}
/* Bounce animation when clicked */
.buddy-askback-btn:active {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}

/* Subtle link-outs in bot replies (Mindbody / Buy Online) */
.s25-linkout {
  display: inline-block;
  font-style: italic;
  color: #444;
  text-decoration: none;
  border-bottom: 1px dashed #bbb;
  padding-bottom: 1px;
}
.s25-linkout:hover { color: #111; border-bottom-color: #888; }

/* Notification badge on chat toggle */
#studio25-chat-toggle .chat-notification {
  position:absolute;
  top:-3px;
  right:-6px;
  background:#ff3b30; /* iOS red style */
  color:#fff;
  font-size:13px;
  font-weight:600;
  width:20px;
  height:20px;
  border-radius:50%;
  display:flex;
  justify-content:center;
  align-items:center;
  padding-top:3px;
  box-shadow:0 0 6px rgba(0,0,0,0.2);
  display:none; /* hidden by default */
}

.typing .dots span {
  display:inline-block;
  animation: blink 1s infinite;
}
.typing .dots span:nth-child(2){ animation-delay:0.2s; }
.typing .dots span:nth-child(3){ animation-delay:0.4s; }
@keyframes blink { 0%,80%,100%{opacity:0;} 40%{opacity:1;} }

/***  TIME TABLE STUFF  ***/

.s25-timetable {
  font-size: 13px;
  line-height: 1.5;
  margin: 8px 0;
  padding: 8px;
  background: #f9f9f9;
  border-radius: 8px;
  border: 1px solid #eee;
}
.s25-timetable strong {
  color: #333;
}

/* Timetable Day as Card */
.s25-timetable-day {
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid #eee;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* Timetable Titles */
.s25-timetable-day h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: #333;
  padding: 4px 8px;
  border-radius: 6px;
  background: linear-gradient(90deg, #E8F8F3 0%, #FDF6E3 100%);
  display: inline-block;
}

/* Optional alternating background for better scanning */
.s25-timetable-day:nth-child(even) {
  background: #fafafa;
}

.s25-timetable-day .s25-desc {
  margin: 0 0 4px;
  font-size: 13px;
  color: #555;
}
.s25-timetable-day ul {
  margin: 0;
  padding-left: 16px;
  font-size: 13px;
}

.s25-toggle {
  display: inline-block;
  font-size: 12px;
  color: #777;
  text-decoration: underline;
  cursor: pointer;
  margin-bottom: 6px;
}

/* Confetti 🎉 */
.trainer-confetti {
  position: fixed;
  top: -10px;
  width: 8px;
  height: 14px;
  opacity: 0.9;
  border-radius: 2px;
  animation: fall linear forwards;
  z-index: 999999;
}
@keyframes fall {
  to { transform: translateY(100vh) rotate(360deg); }
}

/* Bigger avatar when Trainer Buddy is active */
.trainer-buddy-active .s25-buddy-avatar {
  transform: scale(1.25);
  transition: transform 0.6s ease;
}

/* Slide-up animation for Buddy opening */
@keyframes slideUp {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

#studio25-chat-container.slide-up {
  animation: slideUp 0.6s ease-out;
}

