/* ===== CHAT WIDGET STYLES ===== */
.chat-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient-secondary);
  color: var(--lighter);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-xl);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.chat-toggle:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-xxl);
}

.chat-widget {
  position: fixed;
  bottom: 6rem;
  right: 2rem;
  width: 380px;
  max-width: 95vw;
  background: var(--chat-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-xxl);
  transition: var(--transition);
  opacity: 0;
  transform: translateY(20px);
  visibility: hidden;
  z-index: 999;
}

.chat-widget.active {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.chat-header {
  padding: 1.25rem;
  background: var(--primary);
  color: var(--lighter);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-close {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0.5rem;
  transition: var(--transition-fast);
}

.chat-close:hover {
  opacity: 0.8;
}

.chat-body {
  height: 400px;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--chat-bg);
}
/* Chat Animations */
@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typingPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.typing-indicator {
  display: flex;
  gap: 8px;
  padding: 12px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: typingPulse 1.4s infinite;
}

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.quick-reply {
  background: var(--primary-light);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 0.9em;
  cursor: pointer;
  transition: var(--transition-fast);
}

.quick-reply:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}
.chat-message {
  max-width: 85%;
  padding: 12px 16px;
  margin: 8px 0;
  border-radius: var(--border-radius);
  line-height: 1.6;
  animation: messageIn 0.3s ease-out;
}

@keyframes messageAppear {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.user-message {
  background: var(--gradient-secondary);
  color: white;
  margin-left: auto;
  border-radius: 16px 16px 4px 16px;
}

.bot-message {
  background: var(--chat-bg);
  border: 1px solid var(--glass-border);
  margin-right: auto;
  border-radius: 16px 16px 16px 4px;
  box-shadow: var(--shadow-sm);
}


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

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

.quick-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1.25rem 1.25rem;
  background: var(--chat-bg);
}

.quick-question {
  background: var(--glass);
  color: var(--text-color);
  border: 1px solid var(--glass-border);
  border-radius: 2rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.quick-question:hover {
  background: var(--primary-light);
  color: var(--lighter);
  border-color: transparent;
}

.chat-input-container {
  display: flex;
  gap: 0.5rem;
  padding: 1.25rem;
  background: var(--chat-bg);
  border-top: 1px solid var(--glass-border);
}

.chat-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  background: var(--bg-color);
  color: var(--text-color);
  transition: var(--transition-fast);
}

.chat-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(28, 77, 143, 0.2);
}

.chat-voice {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 1.3rem;
  margin-right: 0.5rem;
  cursor: pointer;
  transition: color 0.2s;
}
.chat-voice.active {
  color: #e53935;
}
.chat-voice:focus {
  outline: none;
}

.read-aloud {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 1.1rem;
  margin-left: 0.5rem;
  cursor: pointer;
  transition: color 0.2s;
}
.read-aloud.active {
  color: #e53935;
}

.chat-send {
  padding: 0.75rem 1.25rem;
  background: var(--gradient-primary);
  color: var(--lighter);
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
}

.chat-send:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Mobile responsiveness */
@media (max-width: 480px) {
  .chat-widget {
    right: 1rem;
    bottom: 1rem;
    width: calc(100vw - 2rem);
  }
  
  .chat-toggle {
    bottom: 1rem;
    right: 1rem;
  }
}