/* Vassar brand colors — https://www.vassar.edu/style-guidelines */
:root {
  --vassar-burgundy: #951829;
  --vassar-burgundy-dark: #641A2B;
  --vassar-red: #ED1C24;
  --vassar-gold: #C6AA76;
  --vassar-cream: #FFF8EF;
  --vassar-dark-gray: #63666A;
  --vassar-rose: #F2D4D7;
  --vassar-light-gray: #D0D0CE;

  /* Aliases used throughout */
  --vassar-maroon: #951829;
  --vassar-maroon-dark: #641A2B;
  --vassar-maroon-light: #ED1C24;

  --bg: #F7F3EE;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #63666A;
  --border: #D0D0CE;
  --bot-bubble: #ffffff;
  --user-bubble: #951829;
  --user-bubble-text: #ffffff;
  --source-bg: #FFF8EF;
  --source-border: #F2D4D7;
  --font: 'Source Sans 3', 'Source Sans Pro', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
header {
  background: linear-gradient(135deg, var(--vassar-burgundy-dark) 0%, var(--vassar-burgundy) 100%);
  color: #fff;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 800px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.logo-sub {
  font-size: 0.75rem;
  opacity: 0.8;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 300;
}

.header-gold-bar {
  height: 3px;
  background: var(--vassar-gold);
  position: sticky;
  top: calc(3rem + 1.5rem);
  z-index: 99;
}

/* Main */
main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 1.5rem 1rem 0;
}

#chat-container {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Messages */
#messages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 1rem;
}

.message {
  display: flex;
}

.message.user {
  justify-content: flex-end;
}

.message.bot {
  justify-content: flex-start;
}

.bubble {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: 1.2rem;
  line-height: 1.55;
  font-size: 0.95rem;
}

.message.bot .bubble {
  background: var(--bot-bubble);
  border: 1px solid var(--border);
  border-bottom-left-radius: 0.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.message.user .bubble {
  background: var(--user-bubble);
  color: var(--user-bubble-text);
  border-bottom-right-radius: 0.25rem;
}

.bubble p + p { margin-top: 0.5rem; }
.bubble ul, .bubble ol { margin: 0.4rem 0 0.4rem 1.2rem; }
.bubble li + li { margin-top: 0.25rem; }
.bubble strong { font-weight: 600; }

/* Sources */
.sources {
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--source-border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sources-label {
  font-weight: 600;
  color: var(--vassar-maroon);
  margin-bottom: 0.35rem;
}

.source-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.2rem;
}

.source-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.source-badge.policy {
  background: #e8f0fe;
  color: #1a56b0;
}

.source-badge.solution {
  background: #e6f4ea;
  color: #1b7236;
}

.source-link {
  color: var(--vassar-maroon);
  text-decoration: none;
}

.source-link:hover { text-decoration: underline; }

/* Feedback widget */
.feedback {
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
}

.feedback-label { color: var(--text-muted); }

.feedback-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s;
}

.feedback-btn:hover { border-color: var(--vassar-maroon); color: var(--vassar-maroon); }
.feedback-thanks { color: var(--text-muted); font-style: italic; }

/* Thinking indicator */
.thinking .bubble {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 0.9rem 1rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  animation: bounce 1.2s infinite;
}

.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); background: var(--border); }
  30% { transform: translateY(-6px); background: var(--vassar-maroon-light); }
}

/* Input area */
#input-area {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  padding: 0.75rem 0 1rem;
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

#question-input {
  flex: 1;
  resize: none;
  border: 1.5px solid var(--border);
  border-radius: 1.2rem;
  padding: 0.65rem 1rem;
  font-family: var(--font);
  font-size: 0.95rem;
  line-height: 1.5;
  max-height: 150px;
  outline: none;
  transition: border-color 0.15s;
  overflow-y: auto;
}

#question-input:focus {
  border-color: var(--vassar-maroon);
}

#send-btn {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: none;
  background: var(--vassar-maroon);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

#send-btn:hover { background: var(--vassar-maroon-dark); }
#send-btn:disabled { background: var(--border); cursor: not-allowed; }

#send-btn svg { width: 1.1rem; height: 1.1rem; }

/* Footer */
footer {
  text-align: center;
  padding: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

footer a { color: var(--vassar-maroon); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 600px) {
  .bubble { max-width: 92%; }
}
