/* ai-assistant.css */
/* Enhanced AI Assistant styling for WealthWise */

/* Container for the entire assistant */
.ai-assistant-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  transition: none;
  width: auto;
  height: auto;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border: none;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.ai-assistant-container.minimized {
  width: auto;
  height: auto;
}

/* Chat Circle Button */
.chat-circle {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #2563eb, #10b981);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s, box-shadow 0.3s;
}

.chat-circle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.25);
}

.chat-circle.hidden {
  display: none;
}

.chat-icon {
  font-size: 1.75rem;
  color: white;
}

/* Chat Content */
.chat-content {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 350px;
  height: 500px;
  background: #1f2937;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(75, 85, 99, 0.5);
  animation: slideUp 0.3s ease-out;
}

.chat-content.hidden {
  display: none;
}

body:not(.theme-light) .chat-content {
  background: #1f2937;
  border-color: rgba(75, 85, 99, 0.5);
}

/* Chat Header */
.chat-header {
  padding: 1rem;
  background: linear-gradient(90deg, #2563eb, #10b981);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h4 {
  margin: 0;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.powered-by {
  font-size: 0.75rem;
  opacity: 0.8;
  font-weight: normal;
  margin-left: 0.5rem;
}

.chat-close {
  font-size: 1.25rem;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.chat-close:hover {
  transform: scale(1.2);
}

/* Message Container */
.chat-message-container {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  /* Hide scrollbar but allow scrolling */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.chat-message-container::-webkit-scrollbar {
  display: none;
}

/* Message Styles */
.bot-message, .user-message {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  max-width: 90%;
}

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

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #2563eb;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.user-message .message-avatar {
  background-color: #10b981;
}

.message-bubble {
  background: rgba(75, 85, 99, 0.3);
  padding: 0.75rem 1rem;
  border-radius: 18px;
  border-top-left-radius: 4px;
  color: #f9fafb;
  font-size: 0.95rem;
  max-width: calc(100% - 42px);
  line-height: 1.4;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

body:not(.theme-light) .message-bubble {
  background: rgba(75, 85, 99, 0.3);
  color: #f9fafb;
}

.user-message .message-bubble {
  background: rgba(37, 99, 235, 0.1);
  border-top-left-radius: 18px;
  border-top-right-radius: 4px;
}

body:not(.theme-light) .user-message .message-bubble {
  background: rgba(37, 99, 235, 0.2);
}

/* Typing Indicator */
.typing-indicator .message-bubble {
  padding: 1rem 1.5rem;
}

.typing-dots {
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background-color: #2563eb;
  border-radius: 50%;
  opacity: 0.6;
  animation: typingAnimation 1.4s infinite;
}

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

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

/* Input Container */
.chat-input-container {
  padding: 0.75rem;
  display: flex;
  gap: 0.5rem;
  border-top: 1px solid rgba(209, 213, 219, 0.5);
}

body:not(.theme-light) .chat-input-container {
  border-top-color: rgba(75, 85, 99, 0.5);
}

.chat-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(209, 213, 219, 0.5);
  border-radius: 24px;
  background: #111827;
  color: #f9fafb;
  transition: border-color 0.2s;
}

body:not(.theme-light) .chat-input {
  background: #1f2937;
  color: #f9fafb;
  border-color: rgba(75, 85, 99, 0.5);
}

.chat-input:focus {
  outline: none;
  border-color: #2563eb;
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #10b981);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.chat-send-btn:hover {
  transform: scale(1.1);
}

.chat-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* AI Notification */
.ai-notification {
  position: absolute;
  bottom: 70px;
  right: 0;
  background: white;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  padding: 1rem;
  width: 250px;
  transition: all 0.3s;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: auto;
  z-index: 100;
  border-left: 4px solid #f59e0b;
  animation: bounce 1s;
}

body:not(.theme-light) .ai-notification {
  background: #1f2937;
  color: #f9fafb;
}

.ai-notification.show {
  opacity: 1;
  transform: translateY(0);
}

.ai-notification p {
  margin-bottom: 0.75rem;
}

.ai-notification .btn {
  display: block;
  width: 100%;
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
  .chat-content {
    width: 300px;
  }
}

@media (max-width: 480px) {
  .chat-content {
    width: calc(100vw - 20px);
    right: 10px;
    left: 10px;
  }
}

/* Clean rebuild light-mode compatibility */
body.theme-light .chat-content { background: #ffffff; border-color: rgba(209,213,219,0.5); }
body.theme-light .message-bubble { background: rgba(209,213,219,0.3); color: #1f2937; }
body.theme-light .user-message .message-bubble { background: rgba(37,99,235,0.1); }
body.theme-light .chat-input-container { border-top-color: rgba(209,213,219,0.5); }
body.theme-light .chat-input { background: #fff; color: #1f2937; border-color: rgba(209,213,219,0.5); }
body.theme-light .ai-notification { background: #fff; color: #1f2937; }
