/* ── CLS Yearbook Chatbot — Stylesheet ──────────────────────────────────── */
/* Colors: Navy #003764 | Orange #F5A92A | Light Blue #9BDDFF | Text #525250 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

html, body {
  height: 100%;
  font-family: 'Inter', 'Proxima Nova', sans-serif;
  background: #f5f5f5;
  color: #525250;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #003764;
  padding: 10px 22px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.logo {
  height: 42px;
  filter: brightness(0) invert(1); /* Make logo white on navy */
}

.header-title {
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* ── Main container ──────────────────────────────────────────────────────── */
.container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: #003764;
  padding: 99px 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.sidebar-heading {
  color: #9BDDFF;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.suggestion-btn {
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  padding: 9px 13px;
  margin-bottom: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  line-height: 1.4;
  transition: background 0.15s, border-color 0.15s;
}

.suggestion-btn:hover {
  background: #F5A92A;
  border-color: #F5A92A;
  color: #003764;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
  color: rgba(255,255,255,0.4);
  font-size: 11px;
  line-height: 1.6;
}

/* ── Chat main area ──────────────────────────────────────────────────────── */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-top: 99px;
  background: #f8f8f8;
}

.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

/* ── Message bubbles ─────────────────────────────────────────────────────── */
.message-row {
  display: flex;
  flex-direction: column;
  max-width: 78%;
}

.message-row.user {
  align-self: flex-end;
  align-items: flex-end;
}

.message-row.bot {
  align-self: flex-start;
  align-items: flex-start;
}

.bubble {
  padding: 11px 16px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.55;
  word-break: break-word;
}

.message-row.user .bubble {
  background: #003764;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.message-row.bot .bubble {
  background: #ffffff;
  color: #525250;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}

/* Bot message — markdown-style formatting */
.message-row.bot .bubble strong { font-weight: 700; }
.message-row.bot .bubble em { font-style: italic; }

/* ── SQL toggle ──────────────────────────────────────────────────────────── */
.sql-toggle {
  font-size: 11px;
  color: #9BDDFF;
  cursor: pointer;
  margin-top: 5px;
  user-select: none;
  font-weight: 500;
  padding-left: 4px;
}

.sql-toggle:hover { color: #F5A92A; }

.sql-block {
  display: none;
  margin-top: 6px;
  background: #f0f2f5;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 12px;
  color: #444;
  white-space: pre-wrap;
  word-break: break-all;
  max-width: 520px;
  border-left: 3px solid #003764;
}

/* ── Typing indicator ────────────────────────────────────────────────────── */
.typing-wrap {
  padding: 4px 20px 8px;
  display: none;
}

.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ffffff;
  border-radius: 18px;
  padding: 10px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  background: #9BDDFF;
  border-radius: 50%;
  display: inline-block;
  animation: bounce 1.2s infinite ease-in-out;
}

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

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.6; }
  40%           { transform: translateY(-6px); opacity: 1; }
}

/* ── Input bar ───────────────────────────────────────────────────────────── */
.input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: #ffffff;
  border-top: 1px solid #e0e0e0;
  flex-shrink: 0;
}

#message-input {
  flex: 1;
  padding: 11px 16px;
  border-radius: 24px;
  border: 1.5px solid #C3C5CC;
  font-family: inherit;
  font-size: 15px;
  color: #525250;
  outline: none;
  transition: border-color 0.15s;
  background: #fafafa;
}

#message-input:focus {
  border-color: #003764;
  background: #fff;
}

#message-input::placeholder { color: #aaa; }

#send-btn {
  background: #F5A92A;
  color: #003764;
  border: none;
  border-radius: 24px;
  padding: 11px 20px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
  line-height: 1;
}

#send-btn:hover  { background: #e09820; }
#send-btn:active { transform: scale(0.95); }

/* ── Scrollbar styling ───────────────────────────────────────────────────── */
.chat-area::-webkit-scrollbar { width: 6px; }
.chat-area::-webkit-scrollbar-track { background: transparent; }
.chat-area::-webkit-scrollbar-thumb { background: #C3C5CC; border-radius: 3px; }
.chat-area::-webkit-scrollbar-thumb:hover { background: #003764; }

/* ── Responsive (narrow screens) ─────────────────────────────────────────── */
@media (max-width: 680px) {
  .sidebar { width: 0; padding: 0; overflow: hidden; }
  .header-title { font-size: 15px; }
}

/* ── Senior photo strip in bot answers ──────────────────────────────── */
.photo-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.photo-card {
  display: block;
  text-decoration: none;
  color: inherit;
  text-align: center;
}
.photo-card img {
  height: 150px;
  border-radius: 6px;
  display: block;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.photo-cap {
  font-size: 0.78em;
  color: #555;
  margin-top: 4px;
  max-width: 130px;
}
