/* SimplyFire AI Chatbot - CSS Component for Oxygen Builder */

.chat-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 9999;
  box-sizing: border-box;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.chat-header {
  background: linear-gradient(135deg, #3B82F6 0%, #1E40AF 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.chat-header::before {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(135deg, #3B82F6 0%, #1E40AF 100%);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  z-index: 2;
  justify-content: space-between;
}

.ai-title {
  display: flex;
  align-items: center;
  color: white;
  font-size: 18px;
  font-weight: 500;
}

.sparkle-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(-215deg, #3B82F6 0%, #1E40AF 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  font-size: 14px;
}



.chat-box {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
  height: auto;
  max-height: 50vh;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
}

.welcome-section {
  text-align: center;
  margin-bottom: 24px;
}

.welcome-message {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  color: #1F2937;
  margin-bottom: 20px;
}

.welcome-sparkle {
  font-size: 20px;
  margin-left: 8px;
}

.quick-questions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.quick-question-button {
  padding: 14px 20px;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  background-color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #6B7280;
  transition: all 0.3s ease;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  font-family: inherit;
}

.quick-question-button:hover {
  background-color: #f8fafc;
  border-color: #3B82F6;
  color: #3B82F6;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.chat-message {
  display: flex;
  margin-bottom: 16px;
  align-items: flex-end;
  animation: fadeInUp 0.3s ease;
}

.chat-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  max-width: 75%;
  line-height: 1.5;
  font-size: 14px;
  position: relative;
  word-wrap: break-word;
  text-align: left;
}

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

.chat-message.user .chat-bubble {
  background: linear-gradient(135deg, #3B82F6 0%, #1E40AF 100%);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.chat-message.system {
  justify-content: flex-start;
}

.chat-message.system .chat-bubble {
  background: #f1f5f9;
  color: #1F2937;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
}

.ai-avatar {
  width: 24px;
  height: 24px;
  background: #3B82F6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  flex-shrink: 0;
  font-size: 10px;
  color: white;
}

#user-input {
  font-size: 14px;
  padding: 12px 16px;
}

.input-container {
  display: flex;
  padding: 16px 20px;
  background: white;
  border-top: 1px solid #e5e7eb;
  align-items: center;
  gap: 12px;
}

.input-container input {
  flex: 1;
  padding: 14px 20px;
  font-size: 14px;
  border: 2px solid #e5e7eb;
  border-radius: 20px;
  outline: none;
  background: #f8fafc;
  transition: all 0.3s ease;
  font-family: inherit;
}

.input-container input:focus {
  border-color: #3B82F6;
  background: white;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-container input::placeholder {
  color: #9ca3af;
}

.send-button {
  background: linear-gradient(135deg, #00FF7F 0%, #00D964 100%);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 255, 127, 0.3);
}

.send-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 255, 127, 0.4);
}

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

#reset-chatbot {
  min-width: 32px;
  min-height: 32px;
}

.powered-by {
  text-align: center;
  padding: 12px;
  font-size: 12px;
  color: #6B7280;
  background: #f8fafc;
  border-top: 1px solid #e5e7eb;
  justify-content: center;
}

.powered-by a {
  color: #3B82F6;
  text-decoration: none;
  font-weight: 500;
}

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

/* Scrollbar styling */
.chat-box::-webkit-scrollbar {
  width: 4px;
}

.chat-box::-webkit-scrollbar-track {
  background: transparent;
}

.chat-box::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}

.chat-box::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Animation for new messages */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Typing indicator animation */
.typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background: #6B7280;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { 
  animation-delay: 0s; 
}

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

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

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

/* 📱 Small Screens */
@media (max-width: 768px) {
  .chat-container {
    bottom: 16px;
    right: 16px;
    width: calc(100% - 32px);
    max-width: 100%;
    border-radius: 16px;
  }

  .chat-header {
    padding: 16px;
  }

  .chat-box {
    padding: 16px;
    max-height: 45vh;
  }

  .quick-questions {
    gap: 8px;
  }

  .quick-question-button {
    padding: 12px 14px;
    font-size: 13px;
  }

  .input-container {
    padding: 12px 16px;
  }

  #user-input {
    padding: 10px 14px;
    font-size: 13px;
  }

  .send-button {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  #reset-chatbot {
    font-size: 16px;
    width: 28px;
    height: 28px;
  }
}



/*Super narrow screens (phones < 400px) */
@media (max-width: 400px) {
  .chat-box {
    max-height: 40vh;
  }

  .welcome-message {
    font-size: 18px;
  }

  .chat-bubble {
    font-size: 14px;
    line-height: 1.5;
  }

  .quick-question-button {
    font-size: 12px;
  }
}