/* Base Chatbot Styles - WordPress High Priority */
.ai-chatbot-container {
  position: fixed;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
}

.ai-chatbot-bottom-left {
  bottom: 20px;
  left: 20px;
}

.ai-chatbot-bottom-right {
  bottom: 20px;
  right: 20px;
}

/* Chat Icon Styles - Mobile Optimized */
.ai-chatbot-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #0073aa;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
}

.ai-chatbot-icon:hover {
  transform: scale(1.05);
}

.ai-chatbot-icon img {
  width: 30px;
  height: 30px;
  filter: brightness(0) invert(1);
}

.ai-chatbot-icon svg {
  fill: white;
}

/* Chat Window Styles - Mobile First */
.ai-chatbot-window {
  position: fixed;
  width: 90vw;
  max-width: 380px;
  height: 70vh;
  max-height: 600px;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  bottom: 80px;
  z-index: 999999;
}

.ai-chatbot-window.show {
  display: flex;
}

.ai-chatbot-bottom-right .ai-chatbot-window {
  right: 10px;
}

.ai-chatbot-bottom-left .ai-chatbot-window {
  left: 10px;
}

/* Chat Header */
.ai-chatbot-header {
  background-color: #0073aa;
  color: white;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.ai-chatbot-title {
  font-weight: 600;
  font-size: 16px;
  margin: 0;
}

.ai-chatbot-close {
  background: none;
  border: none;
  color: white;
  font-size: 22px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
  padding: 0;
}

.ai-chatbot-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Chat Messages */
.ai-chatbot-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background-color: #f9f9f9;
}

.ai-chatbot-message {
  margin-bottom: 16px;
  display: flex;
}

.ai-chatbot-user {
  justify-content: flex-end;
}

.ai-chatbot-bot {
  justify-content: flex-start;
}

.ai-chatbot-message-content {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 18px;
  line-height: 1.4;
  word-wrap: break-word;
}

.ai-chatbot-user .ai-chatbot-message-content {
  background-color: #0073aa;
  color: white;
  border-bottom-right-radius: 6px;
}

.ai-chatbot-bot .ai-chatbot-message-content {
  background-color: white;
  color: #333;
  border-bottom-left-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Typing Indicator */
.ai-chatbot-typing {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background-color: white;
  border-radius: 18px;
  border-bottom-left-radius: 6px;
  max-width: 80%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.ai-chatbot-typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #999;
  margin: 0 2px;
  animation: typing 1.4s infinite;
}

.ai-chatbot-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.ai-chatbot-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-10px);
  }
}

/* Welcome Screen */
.ai-chatbot-welcome {
  position: fixed;
  width: 90vw;
  max-width: 320px;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  padding: 24px;
  text-align: center;
  animation: slideUp 0.5s ease-out;
  bottom: 80px;
  z-index: 999999;
  display: none;
}

.ai-chatbot-bottom-right .ai-chatbot-welcome {
  right: 10px;
}

.ai-chatbot-bottom-left .ai-chatbot-welcome {
  left: 10px;
}

.ai-chatbot-welcome-content h3 {
  margin: 16px 0 8px;
  color: #333;
  font-size: 18px;
}

.ai-chatbot-welcome-content p {
  margin: 0 0 20px;
  color: #666;
  font-size: 14px;
  line-height: 1.5;
}

.ai-chatbot-welcome-button {
  background-color: #0073aa;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 24px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  width: 100%;
}

.ai-chatbot-welcome-button:hover {
  background-color: #005a87;
  transform: translateY(-2px);
}

/* Lead Capture Form */
.ai-chatbot-lead-form {
  padding: 20px;
  border-top: 1px solid #eee;
  flex-shrink: 0;
}

.ai-chatbot-lead-header {
  text-align: center;
  margin-bottom: 20px;
}

.ai-chatbot-lead-icon {
  width: 50px;
  height: 50px;
  background-color: #e8f5e8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
}

.ai-chatbot-lead-icon svg {
  fill: #4caf50;
}

.ai-chatbot-lead-header h4 {
  margin: 0 0 5px;
  color: #333;
  font-size: 18px;
}

.ai-chatbot-lead-header p {
  margin: 0;
  color: #666;
  font-size: 14px;
}

.ai-chatbot-form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.ai-chatbot-form-group {
  margin-bottom: 15px;
  flex: 1;
}

.ai-chatbot-form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.ai-chatbot-form-group input {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s;
  box-sizing: border-box;
}

.ai-chatbot-form-group input:focus {
  outline: none;
  border-color: #0073aa;
}

.ai-chatbot-form-group input.error {
  border-color: #f44336;
}

.ai-chatbot-button {
  background-color: #0073aa;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  width: 100%;
  transition: background-color 0.3s;
}

.ai-chatbot-button:hover {
  background-color: #005a87;
}

/* Chat Input */
.ai-chatbot-input-container {
  padding: 16px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-shrink: 0;
}

.ai-chatbot-input {
  flex: 1;
  border: 2px solid #e0e0e0;
  border-radius: 20px;
  padding: 10px 16px;
  resize: none;
  font-size: 14px;
  min-height: 40px;
  max-height: 120px;
  line-height: 1.4;
  box-sizing: border-box;
}

.ai-chatbot-input:focus {
  outline: none;
  border-color: #0073aa;
}

.ai-chatbot-send {
  background-color: #0073aa;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
  flex-shrink: 0;
  padding: 0;
}

.ai-chatbot-send:hover {
  background-color: #005a87;
}

/* Rating Form */
.ai-chatbot-rating {
  padding: 20px;
  border-top: 1px solid #eee;
  flex-shrink: 0;
}

.ai-chatbot-rating-header {
  text-align: center;
  margin-bottom: 16px;
}

.ai-chatbot-rating-icon {
  width: 50px;
  height: 50px;
  background-color: #fff3cd;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
}

.ai-chatbot-rating-icon svg {
  fill: #ffc107;
}

.ai-chatbot-rating-header h4 {
  margin: 0 0 5px;
  color: #333;
  font-size: 18px;
}

.ai-chatbot-rating-header p {
  margin: 0;
  color: #666;
  font-size: 14px;
}

.ai-chatbot-rating-buttons {
  display: flex;
  justify-content: space-around;
  gap: 10px;
}

.ai-chatbot-rating-button {
  background-color: #f5f5f5;
  border: 2px solid #e0e0e0;
  padding: 12px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 80px;
}

.ai-chatbot-rating-button:hover {
  background-color: #0073aa;
  border-color: #0073aa;
  color: white;
  transform: translateY(-2px);
}

.rating-emoji {
  font-size: 24px;
}

/* Bounce Animation */
@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

.ai-chatbot-bounce {
  animation: bounce 2s infinite;
  animation-name: bounce;
  animation-duration: 2s;
  animation-iteration-count: infinite;
}

/* Slide Up Animation */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Message content styling */
.ai-chatbot-message-content {
  word-wrap: break-word;
  line-height: 1.5;
}

.ai-chatbot-message-content strong {
  font-weight: 600;
  color: #333;
}

.ai-chatbot-message-content em {
  font-style: italic;
}

.ai-chatbot-message-content a {
  color: #0073aa;
  text-decoration: none;
  font-weight: 500;
}

.ai-chatbot-message-content a:hover {
  text-decoration: underline;
}

/* Better paragraph spacing */
.ai-chatbot-message-content p {
  margin: 0 0 10px 0;
}

.ai-chatbot-message-content p:last-child {
  margin-bottom: 0;
}

/* Desktop Styles */
@media (min-width: 768px) {
  .ai-chatbot-window {
    width: 380px;
    height: 600px;
    bottom: 80px;
  }

  .ai-chatbot-bottom-right .ai-chatbot-window {
    right: 0;
  }

  .ai-chatbot-bottom-left .ai-chatbot-window {
    left: 0;
  }

  .ai-chatbot-welcome {
    width: 320px;
    bottom: 80px;
  }

  .ai-chatbot-bottom-right .ai-chatbot-welcome {
    right: 0;
  }

  .ai-chatbot-bottom-left .ai-chatbot-welcome {
    left: 0;
  }

  .ai-chatbot-form-row {
    flex-direction: row;
  }

  .ai-chatbot-rating-buttons {
    flex-direction: row;
  }

  .ai-chatbot-rating-button {
    flex-direction: column;
    min-width: 80px;
  }
}

/* Small Mobile Styles */
@media (max-width: 380px) {
  .ai-chatbot-window {
    width: 95vw;
    height: 80vh;
    max-height: none;
    bottom: 70px;
  }

  .ai-chatbot-bottom-right .ai-chatbot-window {
    right: 2.5vw;
  }

  .ai-chatbot-bottom-left .ai-chatbot-window {
    left: 2.5vw;
  }

  .ai-chatbot-welcome {
    width: 90vw;
    max-width: none;
  }

  .ai-chatbot-bottom-right .ai-chatbot-welcome {
    right: 5vw;
  }

  .ai-chatbot-bottom-left .ai-chatbot-welcome {
    left: 5vw;
  }

  .ai-chatbot-icon {
    width: 50px;
    height: 50px;
  }

  .ai-chatbot-icon img {
    width: 25px;
    height: 25px;
  }

  .ai-chatbot-form-row {
    flex-direction: column;
    gap: 0;
  }

  .ai-chatbot-rating-buttons {
    flex-direction: column;
    gap: 10px;
  }

  .ai-chatbot-rating-button {
    flex-direction: row;
    justify-content: center;
    min-width: auto;
  }
}
