/* Filename: caitlin-bot.css */
/* Date: 2026-04-14 */
/* V1.0 — Extracted from caitlin-bot.html V1.7 */

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

/* Color scheme — rust/red for confrontational anti-establishment aesthetic */
:root {
  --void:        #090909;
  --deep:        #0f0e0e;
  --panel:       #161414;
  --surface:     #1c1919;
  --border:      #2a2424;
  --accent:      #c04545;
  --accent-dim:  #6b2020;
  --text:        #e4e0e0;
  --text-muted:  #5a5050;
  --text-dim:    #807070;
  --user-bubble: #121010;
}

html, body {
  height: 100%;
  background: var(--void);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
}

/* ── HEADER ── */
.header {
  position: relative;
  height: 160px;
  overflow: hidden;
  background: var(--void);
}
#particleCanvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}
.header-title {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  text-align: center;
  padding: 20px 24px 16px;
  background: linear-gradient(to top, rgba(9,9,9,0.96) 0%, rgba(9,9,9,0.4) 70%, transparent 100%);
}
.header-title h1 {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 24px;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.header-title p {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 400;
}

/* ── HEADER PORTRAIT ── */
.header-portrait {
  position: absolute;
  top: 12px;
  left: 20px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--accent-dim);
  box-shadow: 0 0 18px rgba(192,69,69,0.18);
  z-index: 2;
}
.header-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
@media (max-width: 600px) {
  .header-portrait { width: 52px; height: 52px; top: 8px; left: 12px; }
}

/* ── TOOLBAR ── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--deep);
  border-bottom: 1px solid var(--border);
}
.toolbar-left {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 400;
  font-family: 'Syne', sans-serif;
}
.toolbar-btns { display: flex; gap: 8px; }
.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 14px;
  border-radius: 3px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ── LAYOUT ── */
.app {
  display: flex;
  flex-direction: column;
  max-width: 760px;
  margin: 0 auto;
}
.messages {
  overflow-y: auto;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  scroll-behavior: smooth;
  max-height: calc(100vh - 330px);
}
.messages::-webkit-scrollbar { width: 4px; }
.messages::-webkit-scrollbar-track { background: transparent; }
.messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── MESSAGES ── */
.message {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  animation: fadeUp 0.4s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.message.user { flex-direction: row-reverse; }
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.avatar-bot {
  background: var(--void);
  color: var(--accent);
  border: 1.5px solid var(--accent-dim);
  overflow: hidden;
  padding: 0;
}
.avatar-bot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.avatar-user {
  background: var(--user-bubble);
  color: var(--text-dim);
  border: 1.5px solid var(--border);
}
.bubble {
  max-width: 80%;
  padding: 16px 20px;
  border-radius: 4px;
  line-height: 1.85;
  position: relative;
}
.message.bot .bubble {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent-dim);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 16px;
  color: var(--text);
  padding-bottom: 34px;
}
.message.user .bubble {
  background: var(--user-bubble);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 15px;
  font-weight: 300;
}

/* ── TYPING INDICATOR ── */
.typing-indicator { display: flex; gap: 14px; align-items: center; }
.dots {
  display: flex;
  gap: 6px;
  padding: 16px 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent-dim);
  border-radius: 4px;
}
.dot {
  width: 6px; height: 6px;
  background: var(--accent-dim);
  border-radius: 50%;
  animation: pulse 1.4s ease-in-out infinite;
}
.dot:nth-child(2) { animation-delay: 0.22s; }
.dot:nth-child(3) { animation-delay: 0.44s; }
@keyframes pulse {
  0%, 60%, 100% { opacity: 0.3; transform: scale(1); }
  30% { opacity: 1; transform: scale(1.4); }
}

/* ── COPY BUTTON ── */
.copy-btn {
  position: absolute;
  bottom: 8px; right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  transition: color 0.2s;
}
.copy-btn:hover { color: var(--accent); }

/* ── START OVER BUTTON ── */
.btn-start-over {
  width: 44px;
  height: 44px;
  border-radius: 3px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-shrink: 0;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
  text-align: center;
  padding: 4px;
}
.btn-start-over:hover { border-color: var(--accent-dim); color: var(--accent); }

/* ── EXCHANGE LIMIT NUDGE ── */
.limit-nudge {
  text-align: center;
  font-size: 12px;
  color: var(--accent-dim);
  font-family: 'DM Sans', sans-serif;
  font-style: italic;
  padding: 8px 20px 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.limit-nudge.visible { opacity: 1; }

/* ── INPUT AREA ── */
.input-area {
  border-top: 1px solid var(--border);
  background: var(--deep);
  padding: 14px 16px;
}
.input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  max-width: 760px;
  margin: 0 auto;
}
textarea {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 300;
  color: var(--text);
  background: var(--panel);
  resize: none;
  min-height: 44px;
  max-height: 120px;
  outline: none;
  transition: border-color 0.2s;
  line-height: 1.5;
}
textarea:focus { border-color: var(--accent-dim); }
textarea::placeholder { color: var(--text-muted); font-style: italic; font-size: 13px; }
button.send {
  width: 44px; height: 44px;
  border-radius: 3px;
  background: var(--accent-dim);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  color: var(--void);
}
button.send:hover { background: var(--accent); }
button.send:disabled { opacity: 0.35; cursor: default; }

/* ── MODAL ── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(9,9,9,0.88);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal.open { display: flex; }
.modal-box {
  background: var(--deep);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent-dim);
  max-width: 440px;
  width: 90%;
  padding: 32px;
  border-radius: 4px;
}
.modal-box h2 {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  color: var(--accent);
  margin-bottom: 16px;
  font-weight: 600;
}
.modal-box p {
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.8;
  margin-bottom: 12px;
}
.modal-box em { font-style: italic; color: var(--text); }
.modal-box .close-btn {
  margin-top: 20px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.2s;
}
.modal-box .close-btn:hover { border-color: var(--accent-dim); color: var(--accent); }

/* ── TEST MODE ── */
.test-badge {
  display: none;
  font-size: 10px;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 400;
  animation: testPulse 2s ease-in-out infinite;
}
.test-badge.active { display: inline-block; }
@keyframes testPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.test-block {
  background: #0a0f1e;
  border: 1px solid #2a3a20;
  border-left: 2px solid #4a7a30;
  border-radius: 4px;
  padding: 12px 16px;
  font-family: monospace;
  font-size: 11px;
  color: #7aaa60;
  line-height: 1.6;
  position: relative;
}
.test-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4a7a30;
  margin-bottom: 8px;
}
.test-copy {
  position: absolute;
  top: 10px; right: 10px;
  background: none;
  border: 1px solid #2a3a20;
  color: #4a7a30;
  font-family: monospace;
  font-size: 10px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 2px;
  transition: all 0.2s;
}
.test-copy:hover { border-color: #4a7a30; color: #7aaa60; }
.test-block pre { white-space: pre-wrap; word-break: break-word; }

/* ── DONATE BUTTON ── */
.btn-donate {
  display: none;
  background: none;
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  padding: 5px 14px;
  border-radius: 3px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s;
}
.btn-donate:hover { background: var(--accent-dim); color: var(--void); }

/* ── FOOTER ── */
.footer-note {
  text-align: center;
  font-size: 10px;
  color: var(--text-dim);
  padding: 7px;
  background: var(--void);
  letter-spacing: 0.04em;
  border-top: 1px solid var(--border);
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .header { height: 110px; }
  .header-title h1 { font-size: 17px; letter-spacing: 0.08em; }
  .header-title p { font-size: 10px; letter-spacing: 0.06em; }
  .toolbar { padding: 8px 12px; flex-wrap: wrap; gap: 6px; }
  .toolbar-left { font-size: 10px; }
  .toolbar-btns { gap: 6px; }
  .btn-ghost { padding: 5px 10px; font-size: 10px; }
  .btn-donate { padding: 5px 10px; font-size: 10px; }
  .messages { padding: 16px 12px; gap: 16px; max-height: calc(100dvh - 260px); }
  .bubble { max-width: 92%; padding: 12px 14px; }
  .message.bot .bubble { font-size: 15px; padding-bottom: 30px; }
  .message.user .bubble { font-size: 14px; }
  .avatar { width: 30px; height: 30px; font-size: 10px; }
  .input-area { padding: 10px 12px; }
  .limit-nudge { font-size: 11px; }
}
