/* Chatbot Widget Styles */

.chatbot-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: var(--font-body);
}

/* Chatbot Trigger Button */
.chatbot-trigger {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan) 0%, var(--navy) 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 135, 90, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
}

.chatbot-trigger:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 135, 90, 0.4);
}

.chatbot-trigger svg {
  width: 28px;
  height: 28px;
  fill: white;
}

.chatbot-trigger.active svg.icon-chat {
  display: none;
}

.chatbot-trigger svg.icon-close {
  display: none;
}

.chatbot-trigger.active svg.icon-close {
  display: block;
}

/* Notification Badge */
.chatbot-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--coral);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.9;
  }
}

/* Chatbot Window */
.chatbot-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 600px;
  max-height: calc(100vh - 120px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

.chatbot-window.active {
  display: flex;
}

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

/* Chatbot Header */
.chatbot-header {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--navy) 100%);
  color: white;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--cyan);
  font-size: 18px;
}

.chatbot-header-info h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.chatbot-header-info p {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: 0.9;
}

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

.chatbot-reset-button {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.chatbot-reset-button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(180deg);
}

.chatbot-reset-button:active {
  transform: rotate(180deg) scale(0.95);
}

/* Chatbot Messages Area */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

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

.chatbot-messages::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 3px;
}

/* Message Bubbles */
.chatbot-message {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  animation: fadeIn 0.3s ease;
}

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

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

.chatbot-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.chatbot-message.user .chatbot-message-avatar {
  background: var(--navy);
}

.chatbot-message-bubble {
  background: white;
  padding: 12px 16px;
  border-radius: 16px;
  max-width: 75%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  color: #2d3748; /* Dark gray text for readability */
}

.chatbot-message.user .chatbot-message-bubble {
  background: var(--navy);
  color: white;
}

.chatbot-message-bubble p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: inherit;
}

.chatbot-message-bubble p + p {
  margin-top: 8px;
}

.chatbot-message-bubble ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.chatbot-message-bubble li {
  font-size: 14px;
  line-height: 1.5;
  margin: 4px 0;
  color: inherit;
}

.chatbot-message-bubble a {
  color: var(--cyan);
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.2s ease;
}

.chatbot-message-bubble a:hover {
  color: var(--navy);
  text-decoration: underline;
}

.chatbot-message.user .chatbot-message-bubble a {
  color: white;
  text-decoration: underline;
}

.chatbot-message.user .chatbot-message-bubble a:hover {
  opacity: 0.8;
}

.chatbot-message-time {
  font-size: 11px;
  color: #718096;
  margin-top: 4px;
  padding: 0 8px;
}

/* Typing Indicator */
.chatbot-typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
}

.chatbot-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e0;
  animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

/* Quick Actions */
.chatbot-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.chatbot-quick-action {
  background: rgba(0, 135, 90, 0.1);
  border: 1px solid var(--cyan);
  color: var(--cyan);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chatbot-quick-action:hover {
  background: var(--cyan);
  color: white;
}

/* Chatbot Input Area */
.chatbot-input-area {
  padding: 16px;
  background: white;
  border-top: 1px solid #e2e8f0;
}

.chatbot-input-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chatbot-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  font-size: 14px;
  font-family: var(--font-body);
  resize: none;
  max-height: 120px;
  transition: border-color 0.2s ease;
}

.chatbot-input:focus {
  outline: none;
  border-color: var(--cyan);
}

.chatbot-send-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--cyan);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.chatbot-send-button:hover {
  background: var(--navy);
  transform: scale(1.05);
}

.chatbot-send-button:disabled {
  background: #cbd5e0;
  cursor: not-allowed;
  transform: none;
}

.chatbot-send-button svg {
  width: 18px;
  height: 18px;
  fill: white;
}

/* Powered By */
.chatbot-powered-by {
  text-align: center;
  padding: 8px;
  font-size: 11px;
  color: #718096;
}

.chatbot-powered-by a {
  color: var(--cyan);
  text-decoration: none;
  font-weight: 600;
}

.chatbot-powered-by a:hover {
  text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .chatbot-container {
    bottom: 16px;
    right: 16px;
  }

  .chatbot-window {
    width: calc(100vw - 32px);
    height: calc(100vh - 100px);
    bottom: 76px;
    right: 0;
  }

  .chatbot-trigger {
    width: 56px;
    height: 56px;
  }
}

/* Calendly Link Button */
.chatbot-calendly-button {
  display: inline-block;
  background: var(--coral);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  margin-top: 8px;
  transition: all 0.2s ease;
}

.chatbot-calendly-button:hover {
  background: #e85d4d;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(232, 93, 77, 0.3);
}
