/* ================================================================
   VNRVJIET Admissions Chatbot – Widget Styles
   ================================================================ */

:root {
  --primary: #1a237e;
  --primary-light: #3949ab;
  --primary-dark: #0d1642;
  --accent: #ff6f00;
  --bg-light: #f5f7fb;
  --bg-white: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #555770;
  --text-muted: #8e8ea0;
  --border: #e3e5ed;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  --radius: 16px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: transparent;
  overflow: hidden;
}

/* ── Welcome Popup Bubble ───────────────────────────────────── */

.welcome-popup {
  position: fixed;
  bottom: 95px;
  right: 20px;
  background: var(--bg-white);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 0;
  z-index: 9998;
  opacity: 0;
  transform: translateY(15px) scale(0.9);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 280px;
  animation: slideIn 0.5s ease-out forwards;
}

.welcome-popup.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

@keyframes slideIn {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.85);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.welcome-popup .popup-content {
  position: relative;
  padding: 20px;
  pointer-events: auto;
}

.welcome-popup .popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
  line-height: 1;
  z-index: 100;
  font-weight: 300;
  pointer-events: auto;
}

.welcome-popup .popup-close:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
  transform: scale(1.1);
}

.welcome-popup .popup-close:active {
  transform: scale(0.95);
  background: rgba(0, 0, 0, 0.12);
}

.welcome-popup .popup-message {
  cursor: pointer;
  transition: transform 0.2s ease;
  pointer-events: auto;
  padding-top: 8px;
}

.welcome-popup .popup-message:hover {
  transform: scale(1.02);
}

.welcome-popup .popup-emoji {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

.welcome-popup .popup-message p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.welcome-popup .popup-message strong {
  color: var(--text-primary);
  font-size: 15px;
}

.welcome-popup .popup-arrow {
  position: absolute;
  bottom: -8px;
  right: 30px;
  width: 16px;
  height: 16px;
  background: var(--bg-white);
  transform: rotate(45deg);
  box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.1);
}

/* ── Chat Toggle Button ─────────────────────────────────────── */

.chat-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(26, 35, 126, 0.4);
  transition: var(--transition);
  z-index: 10000;
}

.chat-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(26, 35, 126, 0.5);
}

.chat-toggle svg {
  width: 28px;
  height: 28px;
  fill: #ffffff;
  transition: var(--transition);
}

.chat-toggle.open .icon-chat {
  display: none;
}

.chat-toggle.open .icon-close {
  display: block;
}

.chat-toggle:not(.open) .icon-close {
  display: none;
}

/* ── Notification Badge ─────────────────────────────────────── */

.chat-toggle .badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid #fff;
  display: none;
}

/* ── Chat Container ─────────────────────────────────────────── */

.chat-container {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 380px;
  height: 560px;
  max-height: calc(100vh - 120px);
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: var(--transition);
}

.chat-container.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ── Header ─────────────────────────────────────────────────── */

.chat-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.chat-header .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.chat-header .info {
  flex: 1;
}

.chat-header .info h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.chat-header .info p {
  font-size: 11px;
  opacity: 0.8;
}

.chat-header .close-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.chat-header .close-btn:hover {
  background: rgba(255,255,255,0.3);
}

.chat-header .home-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
  margin-right: 8px;
}

.chat-header .home-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: scale(1.05);
}

.chat-header .home-btn:active {
  transform: scale(0.92);
  background: rgba(255,255,255,0.4);
}

.chat-header .fullscreen-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
  margin-right: 8px;
}

.chat-header .fullscreen-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: scale(1.05);
}

.chat-header .fullscreen-btn:active {
  transform: scale(0.92);
  background: rgba(255,255,255,0.4);
}

/* Chat reset animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-messages.reset-animation {
  animation: fadeInUp 0.4s ease-out;
}

/* ── Disclaimer ─────────────────────────────────────────────── */

.disclaimer {
  background: #fff8e1;
  color: #6d5600;
  font-size: 11px;
  padding: 8px 16px;
  text-align: center;
  border-bottom: 1px solid #ffe082;
  flex-shrink: 0;
  line-height: 1.5;
}

/* ── Messages Area ──────────────────────────────────────────── */

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-light);
}

.chat-messages::-webkit-scrollbar {
  width: 5px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

/* ── Message Bubble ─────────────────────────────────────────── */

.message {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  animation: fadeIn 0.3s ease;
}

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

.message.user {
  flex-direction: row-reverse;
}

.message .bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  word-wrap: break-word;
  position: relative;
}

/* Styling for all links inside message bubbles */
.message .bubble a {
  color: #0066cc;
  text-decoration: underline;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.message .bubble a:hover {
  color: #0052a3;
  opacity: 0.85;
}

.message .bubble a:active {
  color: #003d7a;
}

/* Ensure links are visible in user bubbles (white text on blue bg) */
.message.user .bubble a {
  color: #ffffff;
  text-decoration: underline;
  font-weight: 600;
}

.message.user .bubble a:hover {
  opacity: 0.9;
  text-decoration: underline;
}

/* Ensure block divs inside bot bubbles always display as block */
.message.bot .bubble div[style] {
  display: block !important;
}

/* Enhanced formatting for cutoff data fields */
.message.bot .bubble div[style*="display:block"] {
  display: block !important;
  margin: 3px 0 !important;
  clear: both;
  width: 100%;
}

/* Specific styling for cutoff fields */
.message.bot .bubble .cutoff-field {
  display: block !important;
  margin: 4px 0 !important;
  padding: 2px 0;
  clear: both;
  width: 100%;
  line-height: 1.4;
}

/* Ensure cutoff field labels are properly formatted */
.message.bot .bubble div[style*="display:block"] strong,
.message.bot .bubble .cutoff-field strong {
  display: inline-block;
  min-width: 140px;
  color: var(--primary);
  font-weight: 600;
  margin-right: 8px;
}

/* Force line breaks after cutoff field containers */
.message.bot .bubble div[style*="display:block"]:after,
.message.bot .bubble .cutoff-field:after {
  content: "";
  display: block;
  clear: both;
}

.message.bot .bubble {
  background: var(--bg-white);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.message.user .bubble {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border-bottom-right-radius: 4px;
}

.message .timestamp {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.message.user .timestamp {
  text-align: right;
}

/* ── Typing Indicator ───────────────────────────────────────── */

.typing-indicator {
  display: none;
  gap: 8px;
  align-items: flex-end;
  padding: 0;
}

.typing-indicator.active {
  display: flex;
}

.typing-indicator .bubble {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  padding: 12px 18px;
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing-indicator .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.4s infinite ease-in-out;
}

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

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}
/* ── Web Search Loading Animation ───────────────────────────── */

.typing-indicator.web-search .bubble {
  background: linear-gradient(135deg, #f0f4ff, #e8f0fe);
  border: 1px solid #d0e1ff;
  padding: 12px 18px;
  min-width: 180px;
}

.web-search-spinner {
  width: 16px;
  height: 16px;
  border: 2.5px solid var(--primary-light);
  border-top-color: transparent;
  border-radius: 50%;
  animation: webSearchSpin 0.8s linear infinite;
  flex-shrink: 0;
}

.search-text {
  font-size: 12.5px;
  color: var(--primary);
  font-weight: 500;
  margin-left: 8px;
  animation: searchPulse 1.5s ease-in-out infinite;
}

@keyframes webSearchSpin {
  to { transform: rotate(360deg); }
}

@keyframes searchPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ── Web Search Permission Buttons ──────────────────────────── */

.web-search-buttons {
  display: flex;
  gap: 8px;
  padding: 4px;
  margin-top: 8px;
}

.ws-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  border: none;
  position: relative;
  overflow: hidden;
}

.ws-btn svg {
  flex-shrink: 0;
}

.ws-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.ws-btn:hover::before {
  width: 300px;
  height: 300px;
}

.ws-yes {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #ffffff;
}

.ws-yes:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(26, 35, 126, 0.3);
}

.ws-yes:active {
  transform: translateY(0);
}

.ws-no {
  background: var(--bg-light);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}

.ws-no:hover {
  background: #e8ebf0;
  border-color: var(--text-muted);
}

.ws-no:active {
  background: #dee2e8;
}
/* ── Input Area ─────────────────────────────────────────────── */

.chat-input-area {
  padding: 12px 16px;
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.chat-input-area .mic-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--bg-light);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  font-size: 18px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chat-input-area .mic-btn:hover:not(:disabled) {
  background: var(--primary-light);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.chat-input-area .mic-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Listening state styles for input area */
.chat-input-area.listening {
  position: relative;
}

.chat-input-area.listening::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 26px;
  background: linear-gradient(45deg, #f44336, #ff9800, #4caf50, #2196f3);
  background-size: 400% 400%;
  animation: listeningGlow 2s ease-in-out infinite;
  z-index: -1;
}

/* Listening state for input field */
.chat-input-area input.listening {
  border-color: #f44336;
  box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.2);
  animation: inputPulse 2s ease-in-out infinite;
}

/* Listening status text */
.listening-status {
  position: absolute;
  top: -25px;
  left: 50px;
  background: #f44336;
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  display: none;
  z-index: 10;
  animation: statusFadeIn 0.3s ease-out;
}

.listening-status::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 15px;
  border: 4px solid transparent;
  border-top-color: #f44336;
}

/* Animations */
@keyframes listeningGlow {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes inputPulse {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.2);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(244, 67, 54, 0.4);
  }
}

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

.chat-input-area input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 13.5px;
  outline: none;
  transition: var(--transition);
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-light);
}

.chat-input-area input::placeholder {
  color: var(--text-muted);
}

.chat-input-area input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.08);
}

.chat-input-area button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.chat-input-area button:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 2px 12px rgba(26, 35, 126, 0.3);
}

.chat-input-area button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-input-area button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ── Markdown inside bubbles ────────────────────────────────── */

.bubble p { margin: 0 0 8px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble ul, .bubble ol { margin: 4px 0 8px 18px; }
.bubble li { margin-bottom: 3px; }
.bubble strong { font-weight: 600; }
.bubble code {
  background: rgba(0,0,0,0.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

/* ── Mobile Responsive ──────────────────────────────────────── */

@media (max-width: 480px) {
  .chat-container {
    width: calc(100vw - 16px);
    height: calc(100vh - 100px);
    bottom: 80px;
    right: 8px;
    border-radius: 12px;
  }

  .chat-toggle {
    bottom: 14px;
    right: 14px;
    width: 54px;
    height: 54px;
  }

  .welcome-popup {
    bottom: 80px;
    right: 14px;
    max-width: calc(100vw - 100px);
  }

  .welcome-popup .popup-arrow {
    right: 24px;
  }
}

/* ── Quick Reply Chips ──────────────────────────────────────── */

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 4px;
  margin-top: 4px;
}

.quick-replies button {
  background: var(--bg-white);
  border: 1px solid var(--primary-light);
  color: var(--primary);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.quick-replies button:hover {
  background: var(--primary);
  color: #fff;
}

/* ── Clickable Options (Guided Flows) ───────────────────────── */

.clickable-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  width: 100%;
  max-height: 230px;
  overflow-y: auto;
  padding-right: 2px;
}

.option-button {
  background: var(--bg-white);
  border: 1.5px solid var(--primary);
  color: var(--primary);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  width: 100%;
  box-shadow: 0 1px 3px rgba(26, 35, 126, 0.08);
}

.option-button:hover {
  background: var(--primary);
  color: var(--bg-white);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(26, 35, 126, 0.2);
  transform: translateY(-1px);
}

.option-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(26, 35, 126, 0.15);
}

/* Mobile optimizations for clickable options */
@media (max-width: 480px) {
  .option-button {
    padding: 11px 14px;
    font-size: 13px;
  }
}

/* ── Category Buttons (Welcome Menu) ────────────────────────── */

.category-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px;
  margin-top: 4px;
  width: 100%;
}

.category-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 8px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  min-height: 80px;
}

.category-btn:hover {
  border-color: var(--primary-light);
  background: linear-gradient(135deg, rgba(26, 35, 126, 0.04), rgba(57, 73, 171, 0.08));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(26, 35, 126, 0.12);
}

.category-btn .cat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(26, 35, 126, 0.08), rgba(57, 73, 171, 0.15));
  color: var(--primary);
}

.category-btn .cat-icon svg {
  width: 20px;
  height: 20px;
}

.category-btn:hover .cat-icon {
  background: linear-gradient(135deg, rgba(26, 35, 126, 0.14), rgba(57, 73, 171, 0.22));
}

.category-btn .cat-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.3;
}

.category-btn.others-btn {
  grid-column: 1 / -1;
  flex-direction: row;
  gap: 8px;
  min-height: auto;
  padding: 12px 16px;
  background: var(--bg-light);
  border-style: dashed;
}

.category-btn.others-btn .cat-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.category-btn.others-btn .cat-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 111, 0, 0.08), rgba(255, 111, 0, 0.15));
  color: var(--accent);
}

.category-btn.others-btn .cat-icon svg {
  width: 16px;
  height: 16px;
}

.category-btn.others-btn:hover {
  border-color: var(--accent);
  background: rgba(255, 111, 0, 0.06);
}

.category-btn.others-btn:hover .cat-icon {
  background: linear-gradient(135deg, rgba(255, 111, 0, 0.14), rgba(255, 111, 0, 0.22));
}

/* ── Follow-up Question Buttons ─────────────────────────────── */

.followup-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 4px;
  margin-top: 4px;
  width: 100%;
}

.followup-buttons button {
  background: var(--bg-white);
  border: 1px solid var(--primary-light);
  color: var(--primary);
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  text-align: left;
  line-height: 1.4;
}

.followup-buttons button:hover {
  background: var(--primary);
  color: #fff;
  transform: translateX(2px);
}

.followup-buttons button.custom-btn {
  background: transparent;
  border: 1px dashed var(--text-muted);
  color: var(--text-secondary);
  text-align: center;
  margin-top: 2px;
}

.followup-buttons button.custom-btn:hover {
  border-color: var(--primary-light);
  background: rgba(26, 35, 126, 0.04);
  color: var(--primary);
}

/* ── Streaming Text Effect ──────────────────────────────────── */

/* Add subtle typing cursor effect while streaming */
.message.bot .content.streaming::after {
  content: '▋';
  animation: blink 1s step-end infinite;
  margin-left: 2px;
  color: var(--primary-light);
  opacity: 0.7;
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

/* Smooth text appearance during streaming */
.message.bot .content {
  animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ── Text-to-Speech (TTS) Button ────────────────────────────── */

.tts-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 35, 126, 0.08);
  border: none;
  color: var(--primary);
  padding: 6px 10px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  gap: 4px;
  margin-top: 8px;
  margin-left: 2px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}

.tts-button:hover {
  background: rgba(26, 35, 126, 0.15);
  transform: scale(1.05);
}

.tts-button:active {
  transform: scale(0.95);
}

.tts-button.playing {
  background: var(--primary);
  color: white;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

.tts-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tts-icon {
  font-size: 14px;
}

