/* AI Chatbot Styles */

/* Chat Button */
.chat-button {
  position: fixed;
  bottom: 20px;
  right: 90px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1387c1 0%, #0f6a99 100%);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(19, 135, 193, 0.4);
  z-index: 100000;
  transition: all 0.3s ease;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.chat-button i {
  pointer-events: none;
}

.chat-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(19, 135, 193, 0.6);
}

.chat-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #25D366;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: bold;
}

/* Chat Window */
.chat-window {
  position: fixed;
  bottom: 90px;
  right: 30px;
  width: 380px;
  height: 550px;
  background: #1a1d29;
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s ease;
}

.chat-window.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Chat Header */
.chat-header {
  background: linear-gradient(135deg, #1387c1 0%, #0f6a99 100%);
  padding: 20px;
  border-radius: 15px 15px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 45px;
  height: 45px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
}

.chat-header h4 {
  margin: 0;
  color: white;
  font-size: 16px;
  font-weight: 600;
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #25D366;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.chat-close-btn {
  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: 5px;
  transition: background 0.3s;
}

.chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

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

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

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.message {
  display: flex;
  gap: 10px;
  animation: messageSlide 0.3s ease;
}

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

.bot-message {
  align-self: flex-start;
}

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

.message-avatar {
  width: 35px;
  height: 35px;
  background: linear-gradient(135deg, #1387c1 0%, #0f6a99 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  flex-shrink: 0;
}

.message-content {
  max-width: 70%;
}

.bot-message .message-content {
  background: #242936;
  padding: 12px 16px;
  border-radius: 12px 12px 12px 4px;
}

.user-message .message-content {
  background: linear-gradient(135deg, #1387c1 0%, #0f6a99 100%);
  padding: 12px 16px;
  border-radius: 12px 12px 4px 12px;
}

.message-content p {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Quick Questions */
.quick-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.quick-q {
  background: rgba(19, 135, 193, 0.2);
  border: 1px solid rgba(19, 135, 193, 0.4);
  color: #1387c1;
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.quick-q:hover {
  background: rgba(19, 135, 193, 0.3);
  border-color: #1387c1;
}

/* Typing Indicator */
.typing-dots {
  display: flex;
  gap: 4px;
  padding: 8px;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.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.5;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* Chat Input */
.chat-input-container {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 15px 20px;
}

.chat-input-wrapper {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

#chat-input {
  flex: 1;
  background: #242936;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  padding: 12px 16px;
  border-radius: 25px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
}

#chat-input:focus {
  border-color: #1387c1;
}

#chat-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.chat-send-btn {
  width: 45px;
  height: 45px;
  background: linear-gradient(135deg, #1387c1 0%, #0f6a99 100%);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(19, 135, 193, 0.4);
}

.chat-footer {
  text-align: center;
}

.chat-footer small {
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .chat-window {
    width: calc(100% - 20px);
    height: calc(100% - 120px);
    right: 10px;
    bottom: 90px;
    border-radius: 15px;
  }

  .chat-button {
    bottom: 80px;
    right: 20px;
    width: 55px;
    height: 55px;
  }

  .message-content {
    max-width: 80%;
  }
}
