/* Source Area Solutions - Chatbot Widget Styles */

/* Radiant Color Variables */
:root {
  --chatbot-primary: #00D4FF;
  --chatbot-secondary: #FF006E;
  --chatbot-accent: #00F5FF;
  --chatbot-glow: rgba(0, 212, 255, 0.5);
  --meta-blue: #0084FF;
  --meta-purple: #A855F7;
  --meta-pink: #EC4899;
}

/* Chatbot Toggle Button */
.chatbot-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: auto;
  min-width: 90px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0084FF 0%, #00A8E8 100%);
  color: white;
  border: 1.5px solid rgba(0, 168, 232, 0.4);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  box-shadow: 0 4px 16px rgba(0, 132, 255, 0.2);
}

.chatbot-agent-text {
  white-space: nowrap;
}

.chatbot-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 132, 255, 0.3);
  border-color: rgba(0, 168, 232, 0.6);
}

.chatbot-toggle:active {
  transform: translateY(0);
}

.chatbot-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: linear-gradient(135deg, #FF006E 0%, #FF4081 100%);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: bold;
  border: 1.5px solid white;
}

/* Chatbot Widget Container */
.chatbot-widget {
  position: fixed;
  bottom: 66px;
  right: 20px;
  width: 290px;
  height: 390px;
  background: linear-gradient(135deg, #0f1419 0%, #131820 100%);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 132, 255, 0.15), 0 0 1px rgba(0, 132, 255, 0.1);
  display: none;
  flex-direction: column;
  z-index: 998;
  animation: slideUpRadiant 0.4s ease;
  overflow: hidden;
  border: 1px solid rgba(0, 132, 255, 0.2);
  backdrop-filter: blur(10px);
}

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

/* Chatbot Header */
.chatbot-header {
  background: linear-gradient(135deg, #0084FF 0%, #00A8E8 100%);
  color: white;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 168, 232, 0.3);
}

.chatbot-header-content h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.3px;
}

.chatbot-header-content p {
  margin: 2px 0 0 0;
  font-size: 9px;
  opacity: 0.9;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.chatbot-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

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

/* Messages Area */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(15, 20, 25, 0.95) 0%, rgba(19, 24, 32, 0.9) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  scroll-behavior: smooth;
}

.chatbot-initial {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  animation: fadeInSmooth 0.6s ease;
}

@keyframes fadeInSmooth {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

.chatbot-messages::-webkit-scrollbar-track {
  background: rgba(19, 24, 32, 0.5);
  border-radius: 10px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: #0084FF;
  border-radius: 10px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: #00A8E8;
}

/* Individual Messages */
.chatbot-message {
  margin-bottom: 6px;
  display: flex;
  animation: messageInSmooth 0.3s ease;
}

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

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

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

.message-bubble {
  max-width: 85%;
  padding: 6px 9px;
  border-radius: 8px;
  word-wrap: break-word;
  white-space: pre-wrap;
  font-size: 11px;
  line-height: 1.3;
  transition: all 0.3s ease;
}

.chatbot-message-user .message-bubble {
  background: linear-gradient(135deg, #0084FF 0%, #00A8E8 100%);
  color: white;
  border-bottom-right-radius: 2px;
  box-shadow: 0 2px 8px rgba(0, 132, 255, 0.15);
  font-weight: 500;
}

.chatbot-message-user .message-bubble:hover {
  box-shadow: 0 4px 12px rgba(0, 132, 255, 0.25);
}

.chatbot-message-bot .message-bubble {
  background: linear-gradient(135deg, rgba(25, 35, 60, 0.9) 0%, rgba(30, 40, 70, 0.9) 100%);
  color: #d0d8e8;
  border: 1px solid rgba(0, 132, 255, 0.2);
  border-bottom-left-radius: 2px;
  box-shadow: 0 2px 8px rgba(0, 132, 255, 0.08);
}

.chatbot-message-bot .message-bubble:hover {
  border-color: rgba(0, 132, 255, 0.3);
  box-shadow: 0 2px 8px rgba(0, 132, 255, 0.15);
}

/* Typing Indicator Animation */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px !important;
  padding: 8px 12px !important;
}

.typing-indicator span {
  width: 5px;
  height: 5px;
  background: rgba(200, 150, 255, 0.7);
  border-radius: 50%;
  display: inline-block;
  animation: typingBounce 1.4s infinite;
}

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

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

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

/* Quick Questions */
.quick-questions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px 0;
}

.quick-question-btn {
  background: transparent;
  border: 1px solid rgba(0, 132, 255, 0.3);
  color: #8ab4d9;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.3s ease;
  text-align: left;
  line-height: 1.3;
}

.quick-question-btn:hover {
  background: rgba(0, 132, 255, 0.08);
  color: #a8c5e3;
  transform: translateX(3px);
  border-color: rgba(0, 132, 255, 0.5);
}

.quick-question-btn:active {
  transform: translateX(1px);
}

/* Input Area */
.chatbot-input-container {
  display: flex;
  gap: 6px;
  padding: 9px 10px;
  background: linear-gradient(135deg, rgba(15, 20, 25, 0.98) 0%, rgba(19, 24, 32, 0.98) 100%);
  border-top: 1px solid rgba(0, 132, 255, 0.15);
}

.chatbot-input {
  flex: 1;
  border: 1px solid rgba(0, 132, 255, 0.2);
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 11px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, rgba(25, 35, 60, 0.6) 0%, rgba(20, 30, 55, 0.6) 100%);
  color: #d0d8e8;
  transition: all 0.3s ease;
}

.chatbot-input::placeholder {
  color: rgba(120, 140, 180, 0.5);
  font-size: 10px;
}

.chatbot-input:focus {
  outline: none;
  border-color: #0084FF;
  box-shadow: 0 0 0 2px rgba(0, 132, 255, 0.1);
  background: linear-gradient(135deg, rgba(30, 45, 75, 0.8) 0%, rgba(25, 35, 65, 0.8) 100%);
}

.chatbot-send {
  width: 32px;
  height: 32px;
  border: none;
  background: linear-gradient(135deg, #0084FF 0%, #00A8E8 100%);
  color: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 132, 255, 0.2);
}

.chatbot-send:hover {
  background: linear-gradient(135deg, #00A8E8 0%, #0084FF 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 132, 255, 0.3);
}

.chatbot-send:active {
  transform: translateY(0);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .chatbot-widget {
    position: fixed;
    bottom: 60px;
    right: 8px;
    left: 8px;
    width: auto;
    height: 360px;
    border-radius: 14px;
  }

  .chatbot-toggle {
    bottom: 15px;
    right: 15px;
    width: 80px;
    height: 38px;
    font-size: 9px;
    min-width: 80px;
    padding: 0 10px;
  }

  .chatbot-message-bot .message-bubble {
    max-width: 90%;
  }

  .chatbot-message-user .message-bubble {
    max-width: 90%;
  }
}

@media (max-width: 480px) {
  .chatbot-widget {
    bottom: 54px;
    right: 5px;
    left: 5px;
    height: 340px;
    width: auto;
  }

  .chatbot-messages {
    padding: 9px 10px;
  }

  .chatbot-header {
    padding: 10px 12px;
  }

  .chatbot-toggle {
    width: 75px;
    height: 36px;
    font-size: 8px;
    bottom: 12px;
    right: 12px;
    min-width: 75px;
    padding: 0 8px;
  }

  .message-bubble {
    max-width: 95%;
    font-size: 11px;
  }
}

/* Smooth transitions */
* {
  box-sizing: border-box;
}

/* Additional smooth animation for interactions */
@keyframes smoothPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

/* Smooth fade-in for messages */
@keyframes smoothFadeIn {
  from {
    opacity: 0;
    filter: blur(4px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}
