/* Fresh Dental Solutions - Chatbot Styles */
/* GCP Dialogflow Chatbot UI */

/* Prevent horizontal scroll */
body.chatbot-open-mobile {
  overflow-x: hidden;
  position: fixed;
  width: 100%;
}

/* Chatbot Container */
.chatbot-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Chatbot Toggle Button */
.chatbot-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00cc99 0%, #00a67d 100%);
  border: none;
  box-shadow: 0 4px 12px rgba(0, 204, 153, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.chatbot-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 204, 153, 0.5);
}

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

.chatbot-toggle::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.6s, height 0.6s;
}

.chatbot-toggle:hover::before {
  width: 100%;
  height: 100%;
}

/* Notification Badge */
.chatbot-notification {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 20px;
  height: 20px;
  background: #e74c3c;
  border-radius: 50%;
  border: 2px solid white;
  display: none;
  animation: pulse 2s infinite;
}

.chatbot-notification.show {
  display: block;
}

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

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

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

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

/* Chatbot Header */
.chatbot-header {
  background: linear-gradient(135deg, #00cc99 0%, #00a67d 100%);
  color: white;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-avatar {
  width: 40px;
  height: 40px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

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

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

.chatbot-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.chatbot-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

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

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

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

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

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

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

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

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.message.bot .message-avatar {
  background: linear-gradient(135deg, #00cc99 0%, #00a67d 100%);
  color: white;
}

.message.user .message-avatar {
  background: #e9ecef;
}

.message-content {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 16px;
  overflow-wrap: break-word;
  word-break: normal;
  line-height: 1.5;
  white-space: pre-wrap;
}

.message.bot .message-content {
  background: white;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message.user .message-content {
  background: #00cc99;
  color: white;
  border-bottom-right-radius: 4px;
}

.message-time {
  font-size: 11px;
  color: #6c757d;
  margin-top: 4px;
  opacity: 0.7;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: white;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: #00cc99;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

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

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

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

/* Quick Replies */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.quick-reply-btn {
  background: white;
  border: 1px solid #00cc99;
  color: #00cc99;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-reply-btn:hover {
  background: #00cc99;
  color: white;
}

/* Chatbot Input */
.chatbot-input-container {
  padding: 16px;
  background: white;
  border-top: 1px solid #e9ecef;
  display: flex;
  gap: 8px;
}

.chatbot-input {
  flex: 1;
  border: 1px solid #dee2e6;
  border-radius: 24px;
  padding: 12px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.chatbot-input:focus {
  border-color: #00cc99;
}

.chatbot-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #00cc99;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.chatbot-send:hover:not(:disabled) {
  background: #00a67d;
  transform: scale(1.05);
}

.chatbot-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Welcome Message */
.welcome-message {
  background: linear-gradient(135deg, #00cc99 0%, #00a67d 100%);
  color: white;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.welcome-message h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
}

.welcome-message p {
  margin: 0;
  font-size: 13px;
  opacity: 0.95;
}

/* Error Message */
.error-message {
  background: #fee;
  color: #c33;
  padding: 12px 16px;
  border-radius: 12px;
  border-left: 4px solid #c33;
  font-size: 13px;
}

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

  .chatbot-window {
    position: fixed;
    width: 100%;
    max-width: 100%;
    height: calc(100vh - 100px);
    max-height: calc(100vh - 100px);
    bottom: 70px;
    right: 0;
    left: 0;
    margin: 0 10px;
    box-sizing: border-box;
  }

  .chatbot-toggle {
    width: 56px;
    height: 56px;
    font-size: 26px;
  }

  .message-content {
    max-width: 85%;
    min-width: 60px;
  }
}

/* Accessibility */
.chatbot-toggle:focus,
.chatbot-send:focus,
.chatbot-input:focus,
.chatbot-close:focus {
  outline: 2px solid #00cc99;
  outline-offset: 2px;
}

/* Print - hide chatbot */
@media print {
  .chatbot-container {
    display: none !important;
  }
}
