/* =========================
   Reset & Variables
========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --primary: #3b3a63;      /* deep indigo */
  --accent: #f0c27b;       /* warm sand */
  --accent-soft: #f5e6c8;
  --highlight: #e7a18c;    /* soft coral */
  --border: #e2e2e2;

  --text-primary: #1f2933;
  --text-secondary: #6b7280;

  --radius: 14px;
}

/* =========================
   Page
========================= */
body {
  margin: 0;
  padding: 32px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text-primary);
}

/* =========================
   Header
========================= */
h1 {
  text-align: center;
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

/* =========================
   Update Button
========================= */
#update-messages {
  display: block;
  margin: 0 auto 18px auto;
  padding: 8px 18px;
  font-size: 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background-color: var(--surface);
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

#update-messages:hover {
  background-color: #f7f7f7;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* =========================
   Chat Section
========================= */
#chat-section {
  max-width: 900px;
  margin: 0 auto;
  background-color: var(--primary);
  border-radius: var(--radius);
  padding: 16px;
}

/* =========================
   Chat Container (TALLER)
========================= */
#chat-container {
  height: 520px; /* higher */
  background-color: var(--surface);
  border-radius: 12px;
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* =========================
   Message Box (LESS HEIGHT)
========================= */
.message-box {
  max-width: 72%;
  padding: 8px 12px; /* reduced vertical padding */
  border-radius: 10px;
  background-color: var(--accent-soft);
  border: 1px solid var(--border);
  line-height: 1.3;
}

/* Sender */
.sender {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

/* Message */
.message {
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}

/* =========================
   Form Section
========================= */
#section-form {
  max-width: 900px;
  margin: 20px auto 0 auto;
  background-color: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px;
}

/* =========================
   Form Layout
========================= */
#message-form {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: end;
}

/* =========================
   Labels
========================= */
label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}

/* =========================
   Inputs
========================= */
input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 58, 99, 0.2);
}

/* =========================
   Send Button
========================= */
button[type="submit"] {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  border: none;
  background-color: var(--primary);
  color: white;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

button[type="submit"]:hover {
  background-color: #2f2e52;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}

/* =========================
   Feedback
========================= */
#message-feedback {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* =========================
   Scrollbar (Subtle)
========================= */
#chat-container::-webkit-scrollbar {
  width: 8px;
}

#chat-container::-webkit-scrollbar-thumb {
  background-color: #c7c7d1;
  border-radius: 999px;
}

#chat-container::-webkit-scrollbar-track {
  background: transparent;
}
