/* /home/ubuntu/main/static/app.css
   PARC Commons style tuned to match the GreenLathe look (Inter + cream + solarpunk greens)
*/

:root {
  /* Fonts */
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  /* Greens (tuned from reference) */
  --green-primary: #6B8E1E;   /* button green */
  --green-dark:    #4F6F12;   /* hover / accents */
  --green-muted:   #8FAE4A;   /* subtle accents */

  /* Backgrounds */
  --bg-cream:      #F9FBEF;   /* page background */
  --bg-white:      #FFFFFF;
  --bg-panel:      #FBFDF4;   /* subtle green tint */

  /* Text */
  --text-main:     #1A1A1A;
  --text-muted:    #5F6B4A;
  --text-invert:   #FFFFFF;

  /* Borders & effects */
  --border-soft:   #E3E8D5;
  --shadow-soft:   0 10px 30px rgba(0,0,0,0.06);

  /* Layout */
  --radius:        18px;
  --radius-sm:     12px;
  --pad:           14px;
  --gap:           14px;
}

/* Reset-ish */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--bg-cream);
  color: var(--text-main);
}

/* Page wrapper: allow vertical scrolling (no forced 100% height clipping) */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding: var(--gap);
}

/* ============ TOP CHAT ============ */
.chat-shell {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  overflow: hidden;

  /* Let the page grow; keep chat usable */
  min-height: 360px;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--pad);
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-white);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green-primary);
  box-shadow: 0 0 0 4px rgba(107,142,30,0.14);
}

.title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.status {
  font-size: 12px;
  color: var(--text-muted);
}

/* Scrollable chat log */
.chat-log {
  padding: var(--pad);
  overflow-y: auto;
  flex: 1;
  background: var(--bg-white);
}

/* Chat messages */
.msg {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.badge {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 12px;
  border: 1px solid var(--border-soft);
  background: var(--bg-panel);
  color: var(--text-muted);
}

.bubble {
  border: 1px solid var(--border-soft);
  background: var(--bg-panel);
  border-radius: 14px;
  padding: 10px 12px;
  max-width: 980px;
  width: fit-content;
}

.bubble .who {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.bubble .text {
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: 14px;
}

/* Chat input row */
.chat-input {
  display: flex;
  gap: 10px;
  padding: var(--pad);
  border-top: 1px solid var(--border-soft);
  background: var(--bg-white);
}

.chat-input input {
  flex: 1;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
  background: var(--bg-white);
  color: var(--text-main);
}

.chat-input input::placeholder {
  color: rgba(95,107,74,0.7);
}

.chat-input input:focus {
  border-color: rgba(107,142,30,0.6);
  box-shadow: 0 0 0 4px rgba(107,142,30,0.14);
}

/* Buttons: green pill style */
button {
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  background: var(--green-primary);
  color: var(--text-invert);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 16px rgba(79,111,18,0.18);
  transition: transform 0.05s ease, background 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  background: var(--green-dark);
  box-shadow: 0 8px 20px rgba(79,111,18,0.22);
}

button:active {
  transform: translateY(1px);
}

/* ============ BOTTOM 3 PANES ============ */
.panes{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  align-items:start;
}

/* Critical: allow grid items to shrink instead of forcing wrap */
.pane, .pane-body { min-width: 0; }


.pane {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;

  /* Keeps cards from becoming absurdly tall; each pane scrolls internally */
  max-height: 520px;
}

.pane-title {
  padding: var(--pad);
  border-bottom: 1px solid var(--border-soft);
  font-weight: 600;
  letter-spacing: -0.01em;
  background: var(--bg-white);
}

.pane-body {
  padding: var(--pad);
  overflow: auto;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* Make the People cards look clean inside pane-body */
#peoplePane > div {
  border: 1px solid var(--border-soft) !important;
  border-radius: 14px !important;
  background: var(--bg-white) !important;
  box-shadow: 0 6px 14px rgba(0,0,0,0.04);
}

/* Links */
a {
  color: var(--green-dark);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ============ RESPONSIVE ============ */
/* Only stack on small screens */
@media (max-width: 720px){
  .panes{ grid-template-columns:1fr; }
  .pane{ max-height:none; }
}

.resource-section {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: var(--bg-white);
  box-shadow: 0 6px 14px rgba(0,0,0,0.04);
  padding: 12px;
  margin-bottom: 12px;
}

.resource-section h3 {
  margin: 0 0 10px 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.carousel {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
}

.carousel::-webkit-scrollbar {
  height: 10px;
}
.carousel::-webkit-scrollbar-thumb {
  background: rgba(95,107,74,0.25);
  border-radius: 999px;
}
.carousel::-webkit-scrollbar-track {
  background: transparent;
}

.paper-card {
  flex: 0 0 auto;
  width: 120px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: var(--bg-panel);
  padding: 10px;
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform 0.06s ease, border-color 0.15s ease, background 0.15s ease;
}

.paper-card:hover {
  border-color: rgba(107,142,30,0.55);
  background: rgba(143,174,74,0.12);
}

.paper-thumb {
  height: 120px;
  border-radius: 10px;
  background: var(--bg-white);
  border: 1px solid rgba(227,232,213,0.9);
  display: grid;
  place-items: center;
  color: rgba(95,107,74,0.85);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.paper-title {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-main);
  line-height: 1.25;
  height: 32px;
  overflow: hidden;
}

.paper-meta {
  margin-top: 6px;
  font-size: 11px;
  color: rgba(95,107,74,0.85);
}
