/* Chat UI Styles — ClearOS Finance Chat */
/* Matches landing page design language: warm cream, Syne + DM Sans */

.nav-links {
  margin-left: auto;
  display: flex;
  gap: 24px;
  align-items: center;
}
.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--text); }
.nav-link--active { color: var(--accent); }
.nav-logo--link { text-decoration: none; }

/* Layout */
.chat-layout {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  min-height: calc(100vh - 65px);
  gap: 0;
}

/* Sidebar */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  padding: 32px 24px;
  border-right: 1px solid rgba(26, 26, 46, 0.08);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sidebar-card {
  background: var(--card-bg);
  border: 1px solid rgba(26, 26, 46, 0.06);
  border-radius: 12px;
  padding: 20px;
}
.sidebar-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.sidebar-balance {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}
.sidebar-bank {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}
.sidebar-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}
.sidebar-stat + .sidebar-stat {
  border-top: 1px solid rgba(26, 26, 46, 0.06);
}
.sidebar-stat-label {
  font-size: 14px;
  color: var(--text-muted);
}
.sidebar-stat-value {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
}
.sidebar-stat-value--income { color: #059669; }
.sidebar-stat-value--spending { color: #DC2626; }

.top-categories {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.top-cat {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.top-cat-name {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}
.top-cat-amount {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.top-cat-empty {
  font-size: 13px;
  color: var(--text-muted);
}
.top-cat-loading {
  font-size: 13px;
  color: var(--text-muted);
}

/* Chat Main */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  position: relative;
}
.chat-header {
  padding: 40px 40px 24px;
  border-bottom: 1px solid rgba(26, 26, 46, 0.06);
}
.chat-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 6px;
}
.chat-subtitle {
  font-size: 15px;
  color: var(--text-muted);
}

/* Messages */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  scroll-behavior: smooth;
}
.message {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid rgba(26, 26, 46, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.message-avatar--user {
  background: var(--text);
  color: #67E8F9;
}
.message-content {
  background: var(--card-bg);
  border: 1px solid rgba(26, 26, 46, 0.06);
  border-radius: 12px;
  padding: 16px 20px;
  max-width: 520px;
}
.message--user {
  flex-direction: row-reverse;
}
.message--user .message-content {
  background: var(--surface);
  margin-left: 0;
}
.message--user .message-avatar {
  margin-left: 0;
}
.message-content p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 10px;
}
.message-content p:last-child { margin-bottom: 0; }
.message-content ul {
  margin: 8px 0;
  padding-left: 20px;
}
.message-content li {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* Loading */
.message--loading .message-content {
  background: var(--surface);
}
.loading-dots span {
  animation: blink 1.4s infinite both;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink {
  0%, 80%, 100% { opacity: 0; }
  40% { opacity: 1; }
}

/* Suggested Chips */
.suggested-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 40px 16px;
}
.chip {
  background: var(--card-bg);
  border: 1px solid rgba(26, 26, 46, 0.1);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}
.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(8, 145, 178, 0.04);
}

/* Input Area */
.input-area {
  display: flex;
  gap: 12px;
  padding: 24px 40px 32px;
  border-top: 1px solid rgba(26, 26, 46, 0.06);
  align-items: center;
}
.input-area input {
  flex: 1;
  background: var(--card-bg);
  border: 1px solid rgba(26, 26, 46, 0.12);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 15px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
.input-area input::placeholder { color: var(--text-muted); }
.input-area input:focus { border-color: var(--accent); }
.send-btn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.1s;
}
.send-btn:hover { background: #077590; }
.send-btn:active { transform: scale(0.96); }
.send-btn:disabled { background: var(--surface); color: var(--text-muted); cursor: not-allowed; }

/* Responsive */
@media (max-width: 768px) {
  .chat-layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
    border-right: none;
    border-bottom: 1px solid rgba(26, 26, 46, 0.08);
  }
  .sidebar-card { flex: 1; min-width: 140px; }
  .chat-header { padding: 24px 20px 16px; }
  .messages { padding: 20px; }
  .suggested-chips { padding: 0 20px 12px; }
  .input-area { padding: 16px 20px 24px; }
}