/* Gita Myanmar Chat Agent UI — theme-aware */

.ca-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg);
}

.ca-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ca-msg {
  display: flex;
  max-width: 85%;
}
.ca-msg-ai { align-self: flex-start; }
.ca-msg-user { align-self: flex-end; }

.ca-bubble {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  line-height: 1.5;
  font-size: 0.92rem;
}
.ca-msg-ai .ca-bubble {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-top-left-radius: var(--radius-xs);
  box-shadow: var(--shadow-sm);
}
.ca-msg-user .ca-bubble {
  background: var(--gradient-primary);
  color: #fff;
  border-top-right-radius: var(--radius-xs);
}
.ca-bubble a { color: var(--primary); text-decoration: underline; }
.ca-bubble strong { color: var(--text); }

.ca-meta {
  margin-top: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: right;
  letter-spacing: 0.02em;
}

.ca-input-area {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* Loading dots rendered inside the AI bubble while waiting/streaming */
.ca-bubble.ca-bubble--loading {
  min-width: 3.5rem;
  min-height: 1.5rem;
}
.ca-dots {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
}
.ca-dots span {
  width: 6px; height: 6px;
  background: var(--text-faint);
  border-radius: 50%;
  animation: ca-bounce 1.2s infinite ease-in-out;
}
.ca-dots span:nth-child(2) { animation-delay: 0.15s; }
.ca-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ca-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-5px); }
}

.ca-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.ca-input {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.65rem 1rem;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.ca-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(220,38,38,0.12); }
.ca-input::placeholder { color: var(--text-faint); }
.ca-send {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition-fast), transform var(--transition-fast);
  box-shadow: var(--shadow-sm);
}
.ca-send:disabled { background: var(--text-faint); cursor: not-allowed; }
.ca-send:hover:not(:disabled) { background: var(--secondary); transform: translateY(-1px); }

/* Right profile panel */
.ca-profile {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  height: 100%;
  overflow-y: auto;
}

.ca-user-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.ca-user-card.guest { flex-wrap: wrap; justify-content: space-between; }
.ca-user-card.guest .ca-user-info { flex: 1; }

.ca-user-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.ca-user-info { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.ca-user-name { font-weight: 700; color: var(--text); font-size: 0.95rem; }
.ca-user-email { font-size: 0.8rem; color: var(--text-muted); }
.ca-user-role {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 0.25rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(220,38,38,0.1);
  color: var(--primary);
}

.ca-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0;
  display: flex; align-items: center; gap: 0.4rem;
}

.ca-cart {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: var(--shadow-sm);
}

.ca-cart-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.86rem;
  gap: 0.75rem;
}
.ca-cart-row span:first-child { color: var(--text-muted); }
.ca-cart-row span:last-child { color: var(--text); font-weight: 600; text-align: right; }

.ca-empty {
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
  padding: 1.5rem 1rem;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.ca-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.ca-btn:hover { background: var(--card-hover); border-color: var(--border-glow); }
.ca-btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.ca-btn-primary:hover { background: var(--secondary); }
.ca-btn-primary:disabled { background: var(--text-faint); border-color: var(--text-faint); cursor: not-allowed; }
.ca-btn-block { width: 100%; }
.ca-btn-sm { padding: 0.45rem 0.75rem; font-size: 0.78rem; }

.ca-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ca-mode-hint {
  margin-top: 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  min-height: 1.1rem;
  transition: color 0.2s ease;
}

/* Mobile adjustments */
@media (max-width: 1023px) {
  .ca-msg { max-width: 92%; }
  .ca-profile { padding: 1rem; }
  .ca-user-card { padding: 0.875rem; }
}
