/* app.css — Chat interface styles */

/* === BODY === */
.app-body {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === HEADER === */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px 0;
  background: rgba(22, 24, 31, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.app-header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}
.app-header-center {
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-header-label {
  font-size: 0.85rem;
  color: var(--cream-dim);
}
.app-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse 2s ease-in-out infinite;
}
.session-badge {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: monospace;
  background: var(--surface);
  padding: 3px 8px;
  border-radius: 4px;
}

/* === CONTAINER === */
.app-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
}

.chat-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 40px 0;
}

/* === WELCOME SCREEN === */
.welcome-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
}
.welcome-icon {
  margin-bottom: 24px;
}
.welcome-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 300;
  color: var(--cream);
  margin-bottom: 16px;
}
.welcome-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 420px;
  line-height: 1.65;
  margin-bottom: 40px;
}
.btn-start-intake {
  display: inline-block;
  padding: 14px 36px;
  background: var(--gold);
  color: #16181F;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: opacity 0.2s;
  margin-bottom: 20px;
}
.btn-start-intake:hover { opacity: 0.85; }
.welcome-privacy {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* === CHAT AREA === */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 300px;
  max-height: 55vh;
}

/* === MESSAGES === */
.message {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 80%;
}
.message-client {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.message-assistant {
  align-self: flex-start;
}
.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(212, 168, 67, 0.2);
  border: 1px solid rgba(212, 168, 67, 0.3);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.msg-avatar::after {
  content: '';
  width: 14px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 28 28' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 4h20v2.5H4V4zm0 5h14v2.5H4V9zm0 5h18v2.5H4v-2.5z' fill='%23D4A843'/%3E%3C/svg%3E") center/contain no-repeat;
}
.message-content {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.55;
  word-wrap: break-word;
}
.message-client .message-content {
  background: rgba(212, 168, 67, 0.15);
  color: var(--cream);
  border-bottom-right-radius: 4px;
}
.message-assistant .message-content {
  background: var(--surface);
  color: var(--cream-dim);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}

/* === TYPING INDICATOR === */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 0 8px 44px;
}
.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: bounce 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* === INPUT AREA === */
.chat-input-area {
  padding: 16px 0 0;
  border-top: 1px solid var(--border);
}
.chat-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.chat-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s;
}
.chat-input:focus { border-color: rgba(212, 168, 67, 0.4); }
.chat-input::placeholder { color: var(--text-muted); }
.btn-send {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--gold);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.btn-send:hover { opacity: 0.85; }

/* === BRIEF DISPLAY === */
.brief-display {
  padding: 20px 0;
}
.brief-display .brief-card {
  max-width: 100%;
}

/* === BRIEF CARD EXTRAS (beyond theme.css) === */
.brief-party {
  margin-bottom: 4px;
  color: var(--cream-dim);
}
.brief-timeline-item {
  margin-bottom: 6px;
  padding-left: 12px;
  border-left: 1px solid rgba(212,168,67,0.2);
  margin-left: 2px;
}
.brief-timeline-date {
  font-size: 0.75rem;
  color: var(--gold-dim);
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}
.urgency-low { background: rgba(138, 132, 120, 0.2); color: var(--cream-dim); }
.urgency-standard { background: rgba(212, 168, 67, 0.15); color: var(--gold); }

/* === MOBILE === */
@media (max-width: 600px) {
  .app-header-label { display: none; }
  .message { max-width: 90%; }
  .chat-wrapper { padding: 20px 0; }
  .messages-container { max-height: 50vh; }
}