@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,800&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  --ink: #0f1b1c;
  --accent: #bfe3ff; /* light blue for user bubbles */
  --accent-dark: #6fb7f0;
  --paper: #f5f9ff;
  --panel: #ffffff;
  --shadow: rgba(15, 27, 28, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  /* Light blue background */
  background: radial-gradient(circle at 20% 20%, #e9f5ff, #d6ecff 45%, #c2e0ff);
  color: var(--ink);
  font-family: "Fraunces", Georgia, serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(120deg, rgba(255, 255, 255, 0.25), transparent 60%),
    repeating-linear-gradient(0deg, rgba(15, 27, 28, 0.03), rgba(15, 27, 28, 0.03) 1px, transparent 1px, transparent 6px);
  pointer-events: none;
}

.frame {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 20px 64px;
  display: grid;
  gap: 32px;
}

.hero {
  background: var(--paper);
  padding: 16px 20px;
  border-radius: 16px;
  box-shadow: 0 20px 50px var(--shadow);
  border: 1px solid rgba(15, 27, 28, 0.08);
  animation: rise 0.6s ease-out;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo styling */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  display: block;
  height: 44px;
  width: auto;
}

.title {
  font-size: 1.25rem;
  font-weight: 600;
}

.version {
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.85rem;
  color: rgba(15, 27, 28, 0.7);
}

.header-right {
  display: inline-flex;
  align-items: flex-end;
  gap: 8px 12px;
  flex-wrap: wrap;
  flex-direction: column;
}

.model-toggle {
  display: inline-flex;
  border: 1px solid rgba(15, 27, 28, 0.12);
  border-radius: 10px;
  overflow: hidden;
  background: #eaf4ff;
}

.model-toggle button {
  appearance: none;
  border: none;
  background: transparent;
  padding: 6px 10px;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.85rem;
  color: #174a6f;
  cursor: pointer;
}

.model-toggle button[aria-pressed="true"] {
  background: #d9ecff;
}

.selector-label {
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.85rem;
  color: rgba(15, 27, 28, 0.7);
}

.header-usage {
  margin-top: 2px;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.8rem;
  color: rgba(15, 27, 28, 0.7);
}

/* Optional: richer formatting for code blocks */
pre, code {
  font-family: "IBM Plex Mono", "Courier New", monospace;
}
pre {
  background: #f6fbff;
  border: 1px solid rgba(15,27,28,0.08);
  padding: 12px;
  border-radius: 10px;
  overflow-x: auto;
}
code {
  background: #f1f7ff;
  padding: 1px 4px;
  border-radius: 6px;
}

.eyebrow {
  font-family: "IBM Plex Mono", "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  margin: 0 0 12px;
  color: var(--accent-dark);
}

/* Removed large hero heading for compact header */

.subhead {
  margin: 0;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.95rem;
}

.panel {
  background: var(--panel);
  border-radius: 28px;
  padding: 24px;
  border: 1px solid rgba(15, 27, 28, 0.08);
  box-shadow: 0 18px 40px var(--shadow);
}

.chat {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 280px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 8px;
}

.message {
  display: inline-flex;
  max-width: 80%;
  padding: 14px 18px;
  border-radius: 20px;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.95rem;
  line-height: 1.5;
  animation: fadeIn 0.4s ease-out;
}

.message.user {
  margin-left: auto;
  background: var(--accent);
  color: #0d2335;
}

.message.bot {
  background: #ffffff;
  border: 1px solid rgba(15, 27, 28, 0.1);
}

/* Thinking/typing indicator bubble */
.message.loading {
  position: relative;
  color: transparent; /* hide placeholder text */
}

.message.loading::after {
  content: "";
  display: inline-block;
  width: 32px;
  height: 10px;
  background: radial-gradient(circle, rgba(15,27,28,0.35) 60%, transparent 61%) 0 50%/8px 8px repeat-x;
  animation: typing 1s infinite linear;
}

.attachment {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 8px;
  padding: 6px 10px;
  border-radius: 12px;
  background: #eef7ff;
  border: 1px solid rgba(15, 27, 28, 0.08);
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.85rem;
}

.attachment button {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.composer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  margin-top: 12px;
}

textarea {
  resize: vertical;
  border-radius: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 27, 28, 0.2);
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.95rem;
  background: #fffdf7;
}

button {
  border: none;
  border-radius: 18px;
  padding: 0 22px;
  background: var(--ink);
  color: #fef6ea;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

button:hover {
  transform: translateY(-2px);
  background: #1c2f31;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typing {
  0% { transform: translateX(0); opacity: 0.6; }
  50% { transform: translateX(8px); opacity: 1; }
  100% { transform: translateX(16px); opacity: 0.6; }
}

@media (max-width: 720px) {
  .frame {
    padding: 32px 16px 48px;
  }

  .composer {
    grid-template-columns: auto 1fr;
  }

  button {
    padding: 12px 18px;
  }
}

.attach-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #e6f3ff;
  border: 1px solid rgba(15, 27, 28, 0.12);
  color: #174a6f;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.attach-btn:hover {
  transform: translateY(-2px);
  background: #d9ecff;
}
