/* css/ai-consultant.css */
.ai-trigger-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 99;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-float);
  transition: var(--transition-smooth);
}

.ai-trigger-btn:hover {
  transform: scale(1.05);
}

.ai-panel {
  position: fixed;
  bottom: 6rem;
  right: 2rem;
  z-index: 100;
  width: 380px;
  height: 600px;
  max-height: calc(100vh - 8rem);
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom right;
}

/* Visibility State */
.ai-panel.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9) translateY(20px);
}

.ai-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  flex-shrink: 0;
}

.ai-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-status-indicator {
  width: 8px;
  height: 8px;
  background-color: var(--color-accent);
  border-radius: 50%;
}

.ai-header h3 {
  font-size: var(--font-body);
  font-weight: 600;
}

.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* Custom Scrollbar for sleekness */
.ai-messages::-webkit-scrollbar {
  width: 6px;
}
.ai-messages::-webkit-scrollbar-thumb {
  background-color: var(--color-border);
  border-radius: 10px;
}

.message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: var(--font-small);
  line-height: 1.5;
}

.ai-message {
  align-self: flex-start;
  background-color: transparent;
  border: 1px solid var(--color-border);
  border-bottom-left-radius: 4px;
}

.user-message {
  align-self: flex-end;
  background-color: var(--color-primary);
  color: var(--color-surface);
  border-bottom-right-radius: 4px;
}

.ai-suggestions {
  display: flex;
  gap: 8px;
  padding: var(--space-xs) var(--space-sm);
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none; /* Firefox */
}
.ai-suggestions::-webkit-scrollbar {
  display: none; /* Chrome */
}

.suggestion-chip {
  white-space: nowrap;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 100px;
  font-size: 12px;
  background: var(--color-surface);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.suggestion-chip:hover {
  background: var(--color-bg);
  border-color: var(--color-primary);
}

.ai-input-area {
  display: flex;
  padding: var(--space-sm);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

#ai-input {
  flex: 1;
  font-size: var(--font-small);
  padding: 8px;
}

#ai-input:focus {
  outline: none;
}

.ai-input-area button {
  cursor: pointer;
  color: var(--color-primary);
  padding: 8px;
}
/* ----------------------------------------- */
/* CHAT BUBBLE ALIGNMENT (LEFT & RIGHT)      */
/* ----------------------------------------- */
.message-row {
  display: flex;
  width: 100%;
  margin-bottom: 12px;
}

.message-row.user {
  justify-content: flex-end; /* Pushes user to the right */
}

.message-row.ai {
  justify-content: flex-start; /* Pushes AI to the left */
}

.user-message {
  background-color: #000000; /* Black bubble for user */
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 15px 15px 0px 15px; /* Tail on the right */
  max-width: 80%;
  text-align: left;
}

.ai-message {
  background-color: #f5f5f5; /* Light grey for AI */
  color: #000000;
  padding: 12px 16px;
  border-radius: 15px 15px 15px 0px; /* Tail on the left */
  max-width: 80%;
  text-align: left;
}

/* ----------------------------------------- */
/* TYPING INDICATOR DOTS                     */
/* ----------------------------------------- */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 16px;
  background-color: #f5f5f5;
  border-radius: 15px 15px 15px 0px;
  width: fit-content;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: #999;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}