/* MAINERMEDIA AI Chatbot - Premium Text-Only Edition */

/* CSS Variables */
.mm-chatbot {
  --mm-primary: #059669;
  --mm-primary-light: #10b981;
  --mm-primary-dark: #047857;
  --mm-accent: #34d399;
  --mm-bg-dark: #0a0c10;
  --mm-bg-card: #12161d;
  --mm-bg-elevated: #1a1f2a;
  --mm-text-white: #ffffff;
  --mm-text-primary: #e5e7eb;
  --mm-text-secondary: #9ca3af;
  --mm-text-muted: #6b7280;
  --mm-border: rgba(255, 255, 255, 0.1);
  --mm-border-bright: rgba(255, 255, 255, 0.15);
  --mm-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  --mm-radius: 20px;
  --mm-radius-sm: 12px;
  --mm-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --mm-transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --mm-glow: 0 0 40px rgba(16, 185, 129, 0.15);

  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
}

/* ===== TOGGLE BUTTON - Premium Floating Action with Sonar ===== */
.mm-chat-toggle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mm-primary) 0%, var(--mm-primary-dark) 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 4px 24px rgba(5, 150, 105, 0.4), 
    0 0 40px rgba(16, 185, 129, 0.2);
  transition: var(--mm-transition);
  position: relative;
}

/* Sonar pulse effect - ring 1 */
.mm-chat-toggle::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  border: 2px solid var(--mm-primary-light);
  animation: mm-sonar-pulse 2s ease-out infinite;
  pointer-events: none;
}

/* Sonar pulse effect - ring 2 (delayed) */
.mm-chat-toggle::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  border: 2px solid var(--mm-primary-light);
  animation: mm-sonar-pulse 2s ease-out infinite 1s;
  pointer-events: none;
}

@keyframes mm-sonar-pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

.mm-chat-toggle:hover {
  transform: scale(1.08);
  box-shadow: 
    0 8px 32px rgba(5, 150, 105, 0.5), 
    0 0 60px rgba(16, 185, 129, 0.3);
}

.mm-chat-toggle:active {
  transform: scale(0.95);
}

.mm-chat-toggle.mm-toggle-active {
  background: var(--mm-bg-elevated);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Stop sonar when chat is open */
.mm-chat-toggle.mm-toggle-active::before,
.mm-chat-toggle.mm-toggle-active::after {
  animation: none;
  opacity: 0;
}

.mm-chat-toggle svg {
  width: 28px;
  height: 28px;
  color: white;
  transition: var(--mm-transition);
  position: relative;
  z-index: 2;
}

/* Badge notification - FIXED position, completely independent */
.mm-chat-badge {
  position: fixed;
  bottom: 74px;
  right: 20px;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  background: #ef4444;
  color: white;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 12px;
  font-weight: 700;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  border: 2px solid #0a0c10;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.6);
  pointer-events: none;
  /* Start hidden, will be shown with animation after delay */
  opacity: 0;
  transform: scale(0);
  visibility: hidden;
}

/* Badge pop-in animation */
.mm-chat-badge.mm-badge-visible {
  visibility: visible;
  animation: mm-badge-pop-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes mm-badge-pop-in {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  50% {
    transform: scale(1.3);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===== CHAT WINDOW - Premium Glass Card ===== */
.mm-chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 400px;
  max-width: calc(100vw - 48px);
  height: 560px;
  max-height: calc(100vh - 140px);
  background: linear-gradient(180deg, rgba(18, 22, 29, 0.98) 0%, rgba(10, 12, 16, 0.99) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--mm-border-bright);
  border-radius: var(--mm-radius);
  box-shadow: 
    var(--mm-shadow),
    var(--mm-glow),
    inset 0 1px 1px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.9);
  transition: var(--mm-transition);
  transform-origin: bottom right;
}

.mm-chat-window.mm-chat-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* ===== CHAT HEADER - Elegant with Gradient ===== */
.mm-chat-header {
  background: linear-gradient(180deg, rgba(26, 31, 42, 0.9) 0%, rgba(18, 22, 29, 0.8) 100%);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--mm-border);
  position: relative;
}

/* Subtle header glow */
.mm-chat-header::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--mm-primary), transparent);
  opacity: 0.5;
}

.mm-chat-header-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mm-chat-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--mm-primary);
  box-shadow: 
    0 0 20px rgba(16, 185, 129, 0.3),
    inset 0 0 10px rgba(16, 185, 129, 0.1);
  position: relative;
}

/* Animated avatar ring */
.mm-chat-avatar::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--mm-accent);
  animation: mm-avatar-spin 2s linear infinite;
  opacity: 0.6;
}

@keyframes mm-avatar-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.mm-chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mm-chat-header-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mm-chat-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--mm-text-white);
  letter-spacing: 0.5px;
}

.mm-chat-subtitle {
  font-size: 11px;
  color: var(--mm-text-muted);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.mm-chat-status {
  font-size: 12px;
  color: var(--mm-accent);
  display: flex;
  align-items: center;
  gap: 6px;
}

.mm-status-dot {
  width: 8px;
  height: 8px;
  background: var(--mm-accent);
  border-radius: 50%;
  animation: mm-status-pulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 8px var(--mm-accent);
}

@keyframes mm-status-pulse {
  0%, 100% { 
    opacity: 1; 
    transform: scale(1);
  }
  50% { 
    opacity: 0.5; 
    transform: scale(0.9);
  }
}

.mm-chat-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--mm-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--mm-transition);
}

.mm-chat-close:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

.mm-chat-close:hover svg {
  color: #ef4444;
}

.mm-chat-close svg {
  width: 18px;
  height: 18px;
  color: var(--mm-text-secondary);
  transition: var(--mm-transition-fast);
}

/* ===== MESSAGES CONTAINER ===== */
.mm-chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--mm-border) transparent;
  scroll-behavior: smooth;
}

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

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

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

.mm-chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ===== MESSAGES - Enhanced Bubbles ===== */
.mm-message {
  display: flex;
  animation: mm-message-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes mm-message-in {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.mm-message-user {
  justify-content: flex-end;
}

.mm-message-bot {
  justify-content: flex-start;
}

.mm-message-bubble {
  max-width: 85%;
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.6;
  position: relative;
}

.mm-message-user .mm-message-bubble {
  background: linear-gradient(135deg, var(--mm-primary) 0%, var(--mm-primary-dark) 100%);
  color: white;
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 15px rgba(5, 150, 105, 0.25);
}

.mm-message-bot .mm-message-bubble {
  background: linear-gradient(135deg, var(--mm-bg-card) 0%, rgba(26, 31, 42, 0.8) 100%);
  color: var(--mm-text-primary);
  border: 1px solid var(--mm-border);
  border-bottom-left-radius: 6px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.mm-message-bubble strong {
  color: var(--mm-accent);
  font-weight: 600;
}

.mm-message-user .mm-message-bubble strong {
  color: white;
}

/* Message timestamp */
.mm-message-time {
  font-size: 10px;
  color: var(--mm-text-muted);
  margin-top: 6px;
  opacity: 0.7;
}

.mm-message-user .mm-message-time {
  text-align: right;
}

/* ===== TYPING INDICATOR - Smoother Animation ===== */
.mm-typing-bubble {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 18px 22px;
  min-width: 70px;
}

.mm-typing-dot {
  width: 8px;
  height: 8px;
  background: var(--mm-primary-light);
  border-radius: 50%;
  animation: mm-typing-bounce 1.4s ease-in-out infinite;
}

.mm-typing-dot:nth-child(1) {
  animation-delay: 0s;
}

.mm-typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.mm-typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes mm-typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* ===== QUICK REPLIES - Pill Buttons ===== */
.mm-quick-replies {
  padding: 0 20px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mm-quick-reply {
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(26, 31, 42, 0.8) 0%, var(--mm-bg-card) 100%);
  border: 1px solid var(--mm-border);
  border-radius: 20px;
  color: var(--mm-text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--mm-transition);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.mm-quick-reply::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--mm-primary) 0%, var(--mm-primary-dark) 100%);
  opacity: 0;
  transition: var(--mm-transition);
}

.mm-quick-reply:hover {
  border-color: var(--mm-primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}

.mm-quick-reply:hover::before {
  opacity: 1;
}

.mm-quick-reply span {
  position: relative;
  z-index: 1;
}

.mm-quick-reply:active {
  transform: translateY(0);
}

/* ===== INPUT AREA - Premium Input Field ===== */
.mm-chat-input-area {
  padding: 16px 20px;
  background: linear-gradient(180deg, var(--mm-bg-card) 0%, rgba(18, 22, 29, 0.95) 100%);
  border-top: 1px solid var(--mm-border);
  display: flex;
  gap: 12px;
  align-items: center;
}

.mm-chat-input-wrapper {
  flex: 1;
  position: relative;
}

.mm-chat-input {
  width: 100%;
  padding: 14px 18px;
  background: var(--mm-bg-dark);
  border: 1px solid var(--mm-border);
  border-radius: 24px;
  color: var(--mm-text-white);
  font-size: 14px;
  outline: none;
  transition: var(--mm-transition);
}

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

.mm-chat-input:focus {
  border-color: var(--mm-primary);
  box-shadow: 
    0 0 0 3px rgba(5, 150, 105, 0.1),
    0 0 20px rgba(5, 150, 105, 0.1);
}

/* Character counter */
.mm-char-counter {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--mm-text-muted);
  opacity: 0;
  transition: var(--mm-transition-fast);
}

.mm-chat-input:focus + .mm-char-counter {
  opacity: 1;
}

.mm-chat-send {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mm-primary) 0%, var(--mm-primary-dark) 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--mm-transition);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.mm-chat-send::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--mm-primary-light) 0%, var(--mm-primary) 100%);
  opacity: 0;
  transition: var(--mm-transition);
}

.mm-chat-send:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.4);
}

.mm-chat-send:hover::before {
  opacity: 1;
}

.mm-chat-send:active {
  transform: scale(0.95);
}

.mm-chat-send svg {
  width: 20px;
  height: 20px;
  color: white;
  position: relative;
  z-index: 1;
  transition: var(--mm-transition-fast);
}

.mm-chat-send:hover svg {
  transform: translateX(2px);
}

/* Send button disabled state */
.mm-chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.mm-chat-send:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* ===== PROACTIVE TEASER - Attention Grabbing ===== */
.mm-chat-teaser {
  position: absolute;
  bottom: 80px;
  right: 0;
  background: linear-gradient(135deg, var(--mm-bg-card) 0%, var(--mm-bg-elevated) 100%);
  border: 1px solid var(--mm-border-bright);
  border-radius: var(--mm-radius-sm);
  padding: 14px 18px;
  box-shadow: 
    0 15px 40px rgba(0, 0, 0, 0.4),
    var(--mm-glow);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.9);
  transition: var(--mm-transition);
  cursor: pointer;
  max-width: 280px;
}

.mm-chat-teaser.mm-teaser-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  animation: mm-teaser-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes mm-teaser-bounce {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
  }
  60% {
    transform: translateY(-5px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.mm-chat-teaser:hover {
  border-color: var(--mm-primary);
  background: var(--mm-bg-elevated);
  transform: translateY(-2px);
}

.mm-teaser-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--mm-primary);
  flex-shrink: 0;
}

.mm-teaser-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mm-teaser-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mm-teaser-text {
  color: var(--mm-text-primary);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.mm-teaser-subtext {
  color: var(--mm-text-muted);
  font-size: 11px;
}

.mm-teaser-close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--mm-bg-elevated);
  border: 1px solid var(--mm-border);
  color: var(--mm-text-muted);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--mm-transition);
  line-height: 1;
}

.mm-teaser-close:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
  transform: scale(1.1);
}

/* ===== LEAD CAPTURE - Premium Card ===== */
.mm-lead-capture-container .mm-lead-capture {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
  border: 1px solid var(--mm-primary);
  border-radius: var(--mm-radius-sm);
  padding: 18px;
  text-align: center;
}

.mm-lead-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--mm-accent);
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 10px;
}

.mm-lead-icon {
  font-size: 20px;
}

.mm-lead-text {
  color: var(--mm-text-secondary);
  font-size: 13px;
  margin-bottom: 14px;
  line-height: 1.5;
}

.mm-lead-form {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.mm-lead-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--mm-bg-dark);
  border: 1px solid var(--mm-border);
  border-radius: 10px;
  color: var(--mm-text-white);
  font-size: 14px;
  outline: none;
  transition: var(--mm-transition);
}

.mm-lead-input:focus {
  border-color: var(--mm-primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.mm-lead-input::placeholder {
  color: var(--mm-text-muted);
}

.mm-lead-btn {
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--mm-primary) 0%, var(--mm-primary-dark) 100%);
  border: none;
  border-radius: 10px;
  color: white;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--mm-transition);
  white-space: nowrap;
}

.mm-lead-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 15px rgba(5, 150, 105, 0.3);
}

.mm-lead-btn:active {
  transform: scale(0.98);
}

.mm-lead-skip {
  background: none;
  border: none;
  color: var(--mm-text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: var(--mm-transition);
  padding: 4px 8px;
}

.mm-lead-skip:hover {
  color: var(--mm-text-secondary);
}

.mm-lead-success {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--mm-accent);
  font-weight: 500;
  font-size: 14px;
  padding: 8px;
}

/* ===== POWERED BY FOOTER ===== */
.mm-chat-powered {
  padding: 10px 20px;
  background: rgba(10, 12, 16, 0.8);
  border-top: 1px solid var(--mm-border);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.mm-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--mm-text-muted);
  letter-spacing: 0.5px;
}

.mm-ai-badge-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mm-ai-badge-icon svg {
  width: 14px;
  height: 14px;
  color: var(--mm-primary-light);
}

/* ===== SYSTEM MESSAGE ===== */
.mm-message-system .mm-message-bubble {
  background: rgba(5, 150, 105, 0.1);
  border: 1px dashed var(--mm-primary);
  color: var(--mm-text-secondary);
  font-size: 13px;
  text-align: center;
  max-width: 100%;
}

/* ===== WELCOME ANIMATION ===== */
.mm-welcome-container {
  text-align: center;
  padding: 20px;
  animation: mm-fade-in 0.5s ease-out;
}

@keyframes mm-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mm-welcome-emoji {
  font-size: 40px;
  margin-bottom: 12px;
  animation: mm-wave 1.5s ease-in-out infinite;
}

@keyframes mm-wave {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(20deg); }
  50% { transform: rotate(-10deg); }
  75% { transform: rotate(20deg); }
}

.mm-welcome-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--mm-text-white);
  margin-bottom: 6px;
}

.mm-welcome-subtitle {
  font-size: 14px;
  color: var(--mm-text-secondary);
}

/* ===== ACTION BUTTONS IN MESSAGES ===== */
.mm-message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.mm-action-btn {
  padding: 8px 14px;
  background: rgba(5, 150, 105, 0.1);
  border: 1px solid var(--mm-primary);
  border-radius: 8px;
  color: var(--mm-accent);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--mm-transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mm-action-btn:hover {
  background: var(--mm-primary);
  color: white;
}

.mm-action-btn svg {
  width: 14px;
  height: 14px;
}

/* ===== LINK STYLING IN MESSAGES ===== */
.mm-message-bubble a {
  color: var(--mm-accent);
  text-decoration: none;
  border-bottom: 1px dashed var(--mm-accent);
  transition: var(--mm-transition-fast);
}

.mm-message-bubble a:hover {
  color: var(--mm-primary-light);
  border-bottom-style: solid;
}

.mm-message-user .mm-message-bubble a {
  color: white;
  border-bottom-color: white;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 480px) {
  .mm-chatbot {
    bottom: 16px;
    right: 16px;
  }

  .mm-chat-toggle {
    width: 58px;
    height: 58px;
  }

  .mm-chat-toggle svg {
    width: 26px;
    height: 26px;
  }

  .mm-chat-badge {
    bottom: 62px;
    right: 12px;
  }

  .mm-chat-window {
    bottom: 72px;
    width: calc(100vw - 32px);
    height: calc(100vh - 100px);
    max-height: 520px;
    right: -8px;
    border-radius: 16px;
  }

  .mm-chat-header {
    padding: 14px 16px;
  }

  .mm-chat-avatar {
    width: 40px;
    height: 40px;
  }

  .mm-chat-title {
    font-size: 15px;
  }

  .mm-chat-messages {
    padding: 16px;
    gap: 14px;
  }

  .mm-message-bubble {
    padding: 12px 14px;
    font-size: 14px;
  }

  .mm-quick-replies {
    padding: 0 16px 14px;
  }

  .mm-quick-reply {
    font-size: 12px;
    padding: 8px 14px;
  }

  .mm-chat-input-area {
    padding: 14px 16px;
  }

  .mm-chat-input {
    padding: 12px 16px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .mm-chat-send {
    width: 44px;
    height: 44px;
  }

  .mm-chat-teaser {
    right: -8px;
    bottom: 70px;
    max-width: calc(100vw - 100px);
  }

  .mm-lead-form {
    flex-direction: column;
  }

  .mm-lead-btn {
    width: 100%;
  }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .mm-chatbot *,
  .mm-chatbot *::before,
  .mm-chatbot *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== HIDE ON PRINT ===== */
@media print {
  .mm-chatbot {
    display: none !important;
  }
}

/* ===== FOCUS VISIBLE STATES ===== */
.mm-chat-toggle:focus-visible,
.mm-quick-reply:focus-visible,
.mm-chat-input:focus-visible,
.mm-chat-send:focus-visible,
.mm-chat-close:focus-visible,
.mm-action-btn:focus-visible {
  outline: 2px solid var(--mm-accent);
  outline-offset: 2px;
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
  .mm-chatbot {
    --mm-border: rgba(255, 255, 255, 0.3);
    --mm-text-muted: #a1a1aa;
  }
  
  .mm-message-bot .mm-message-bubble {
    border-width: 2px;
  }
}
