/* AI Chat Widget Styles */
.chat-widget-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.chat-toggle-button {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8500ff 0%, #6a00cc 100%);
  border: 3px solid #edff84;
  box-shadow: 0 4px 20px rgba(133, 0, 255, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: white;
  font-size: 28px;
  position: relative;
  animation: pulse 2s infinite;
}

.chat-toggle-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(133, 0, 255, 0.6);
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(133, 0, 255, 0.4); }
  50% { box-shadow: 0 4px 30px rgba(133, 0, 255, 0.7); }
}

.chat-window {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 500px;
  background: #0f3460;
  border-radius: 16px;
  border: 2px solid #8500ff;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.chat-window.open {
  display: flex;
  animation: slideUp 0.3s ease-out;
}

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

.chat-header {
  background: linear-gradient(90deg, #8500ff 0%, #6a00cc 100%);
  padding: 15px 20px;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #edff84;
}

.chat-header h3 {
  margin: 0;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-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.3s;
}

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

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: #1a1a2e;
}

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

.chat-messages::-webkit-scrollbar-track {
  background: #0f3460;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #8500ff;
  border-radius: 4px;
}

.chat-message {
  display: flex;
  gap: 10px;
  animation: fadeIn 0.3s ease-out;
}

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

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

.user-message .message-avatar {
  background: #41e114;
  order: 2;
}

.bot-message .message-avatar {
  background: linear-gradient(135deg, #8500ff 0%, #6a00cc 100%);
  border: 2px solid #edff84;
}

.message-content {
  flex: 1;
  background: #0f3460;
  padding: 12px 16px;
  border-radius: 12px;
  color: #e4e4e4;
  line-height: 1.6;
  font-size: 14px;
}

.user-message .message-content {
  background: #41e114;
  color: #1a1a2e;
  order: 1;
  margin-left: auto;
}

.bot-message .message-content {
  border: 1px solid rgba(133, 0, 255, 0.3);
}

.message-citations {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(237, 255, 132, 0.3);
}

.message-citations p {
  font-size: 12px;
  color: #edff84;
  margin-bottom: 6px;
  font-weight: 600;
}

.citation-link {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(133, 0, 255, 0.3);
  border-radius: 12px;
  color: #41e114;
  text-decoration: none;
  font-size: 12px;
  margin: 4px 4px 4px 0;
  transition: all 0.3s;
}

.citation-link:hover {
  background: rgba(133, 0, 255, 0.5);
  color: #edff84;
}

.typing-indicator {
  display: none;
  padding: 8px 12px;
  background: #0f3460;
  border-radius: 12px;
  width: fit-content;
}

.typing-indicator.active {
  display: block;
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: #8500ff;
  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); }
  30% { transform: translateY(-10px); }
}

.chat-input-container {
  padding: 15px 20px;
  background: #0f3460;
  border-top: 2px solid rgba(133, 0, 255, 0.3);
}

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

.chat-input {
  flex: 1;
  padding: 12px 16px;
  background: #1a1a2e;
  border: 2px solid #41e114;
  border-radius: 24px;
  color: white;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  max-height: 100px;
}

.chat-input:focus {
  outline: none;
  border-color: #8500ff;
  box-shadow: 0 0 10px rgba(133, 0, 255, 0.3);
}

.chat-input::placeholder {
  color: #888;
}

.chat-send-button {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #8500ff 0%, #6a00cc 100%);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-send-button:hover:not(:disabled) {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(133, 0, 255, 0.5);
}

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

.welcome-message {
  text-align: center;
  padding: 20px;
  color: #b8b8b8;
}

.welcome-message h4 {
  color: #edff84;
  margin-bottom: 10px;
}

.quick-questions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 15px;
}

.quick-question-btn {
  background: rgba(133, 0, 255, 0.2);
  border: 1px solid #8500ff;
  color: #41e114;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.3s;
  text-align: left;
}

.quick-question-btn:hover {
  background: rgba(133, 0, 255, 0.4);
  border-color: #edff84;
  color: white;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .chat-window {
    width: calc(100vw - 20px);
    right: 10px;
    bottom: 80px;
    height: calc(100vh - 100px);
    max-height: 600px;
  }
  
  .chat-toggle-button {
    width: 56px;
    height: 56px;
    bottom: 15px;
    right: 15px;
  }
}
