/* =========================================================
   Africa Climate Negotiation Assistant — New Visual Identity
   Clean, professional, “briefing-room” look (not Clima-Verdict)
   ========================================================= */

:root{
  /* Surfaces (white UI) */
  --page:#ffffff;         /* page background */
  --surface:#ffffff;      /* cards/chat/table surfaces */
  --surface2:#f5f7fb;     /* subtle alternate */
  --stroke:rgba(15,23,42,.12);   /* soft border on white */

  /* Text (dark on white) */
  --ink:#0f172a;          /* slate-900 */
  --muted:rgba(15,23,42,.72);
  --muted2:rgba(15,23,42,.55);

  /* Brand accents */
  --accent:#1d4ed8;       /* AGNES blue */
  --accent2:#16a34a;      /* climate green (keep) */
  --accent3:#15803d;      /* darker green for links */
  --danger:#ef4444;

  /* Shadows / radius */
  --shadow: 0 10px 26px rgba(2,6,23,.10);
  --shadow2: 0 8px 18px rgba(2,6,23,.08);
  --r12: 12px;
  --r16: 16px;
  --r20: 20px;

  /* Sizing */
  --max: 980px;
}



*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  color:var(--ink);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: var(--page);
}


/* Layout */
.app{
  max-width: var(--max);
  margin: 22px auto;
  padding: 0 16px;
}
.full-width{
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0 10px;
}

/* Top nav */
.topnav{
  display:flex;
  gap:14px;
  align-items:center;
  padding: 10px 12px;
  border-radius: var(--r16);
  background: var(--accent);              /* solid AGNES blue */
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: var(--shadow2);
  margin-bottom: 14px;
}

.topnav a{
  color: #ffffff;
  text-decoration:none;
  font-weight:700;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background .15s ease, transform .15s ease, opacity .15s ease;
}
.topnav a:hover{
  background: rgba(255,255,255,.14);
  transform: translateY(-1px);
}
.topnav a:active{
  transform: translateY(0);
  opacity: .95;
}

/* Banner */
.banner{
  position: relative;
  overflow: hidden;
  padding: 16px 18px;
  border-radius: var(--r20);
  background: linear-gradient(135deg, rgba(22,163,74,.14), rgba(29,78,216,.10));
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.banner::before{
  content:"";
  position:absolute;
  inset:-60px;
  background: radial-gradient(closest-side, rgba(20,184,166,.25), transparent 70%);
  transform: translate(-10%, -20%);
  pointer-events:none;
}
.banner .brand{
  position: relative;
  font-weight: 800;
  letter-spacing: .2px;
  font-size: 18px;
}
.banner .tag{
  position: relative;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}


/* Intro / headers */
header.intro,
header.doc-header,
header{
  background: var(--surface);
  border: 1px solid var(--stroke);
  padding: 14px 16px;
  border-radius: var(--r20);
  box-shadow: var(--shadow2);
  margin-bottom: 14px;
}

h1{
  margin:0 0 6px 0;
  font-size: 20px;
  letter-spacing: .1px;
}
header p{
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.hint{
  margin-top: 8px;
  color: var(--muted2);
}

/* Chat area */
#chat{
  height: 60vh;
  overflow:auto;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--r20);
  box-shadow: var(--shadow2);
  padding: 14px;
  scroll-behavior: smooth;
}

#chat::-webkit-scrollbar{ width: 10px; }
#chat::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.10);
  border-radius: 999px;
}
#chat::-webkit-scrollbar-thumb:hover{
  background: rgba(255,255,255,.16);
}

/* Messages */
.msg{
  max-width: 84%;
  margin: 10px 0;
  padding: 12px 13px;
  border-radius: 14px;
  white-space: pre-wrap;
  border: 1px solid var(--stroke);
  box-shadow: 0 8px 16px rgba(2,6,23,.06);
}

.msg.user{
  margin-left:auto;
  background: rgba(22,163,74,.10);  /* green tint */
  border-color: rgba(22,163,74,.22);
}

.msg.bot{
  margin-right:auto;
  background: rgba(29,78,216,.06);  /* blue tint */
  border-color: rgba(29,78,216,.18);
}

.msg.sys{
  max-width: 100%;
  background: rgba(245,158,11,.10);
  border: 1px dashed rgba(245,158,11,.45);
  color: var(--ink);
}

.msg.thinking{
  opacity:.75;
  font-style: italic;
}

/* Sources block */
.sources{
  margin: 6px 0 14px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface2);
  border: 1px solid var(--stroke);
  color: var(--muted);
  font-size: 12.5px;
}

.sources ul{
  margin: 8px 0 0 18px;
  padding: 0;
}
.sources a{
  color: var(--accent3);
  text-decoration: none;
  font-weight: 700;
}

.sources a:hover{
  text-decoration: underline;
}

/* Composer */
#composer{
  display:flex;
  gap: 10px;
  margin-top: 14px;
  align-items: center;
}
#prompt{
  flex: 1;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  box-shadow: var(--shadow2);
}
#prompt::placeholder{ color: rgba(15,23,42,.45); }
#prompt:focus{
  border-color: rgba(29,78,216,.55);
  box-shadow: 0 0 0 3px rgba(29,78,216,.16), var(--shadow2);
}


#send{
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(22,163,74,.55);
  background: linear-gradient(180deg, rgba(22,163,74,.95), rgba(22,163,74,.72));
  color: #03130a;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
  box-shadow: 0 14px 28px rgba(22,163,74,.18);
}

#send:hover{
  filter: brightness(1.03);
  transform: translateY(-1px);
}
#send:active{
  transform: translateY(0);
}

/* Document controls */
.doc-controls{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
  align-items:center;
  margin: 10px 0 14px;
}
#docSearch{
  flex: 1 1 340px;
  min-width: 240px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  color: var(--ink);
  outline: none;
}
#docSearch:focus{
  border-color: rgba(42,111,219,.60);
  box-shadow: 0 0 0 3px rgba(42,111,219,.20);
}
select{
  flex: 0 0 auto;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--ink);
  outline:none;
}


/* Documents table */
.doc-table{
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--r20);
  background: var(--surface);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow2);
}

.doc-table th, .doc-table td{
  padding: 12px 12px;
  border-bottom: 1px solid rgba(15,23,42,.10);
  text-align: left;
  font-size: 13px;
  color: rgba(15,23,42,.92);
}

.doc-table th{
  color: rgba(15,23,42,.75);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: var(--surface2);
}

.doc-table tr:hover td{
  background: rgba(22,163,74,.06);
}
.doc-table a{
  color: var(--accent3);
  text-decoration: none;
  font-weight: 700;
}
.doc-table a:hover{
  text-decoration: underline;
}

/* Document viewer actions */
.doc-actions{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
  margin-top: 10px;
  margin-bottom: 8px;
}
.btn{
  display:inline-block;
  padding: 10px 12px;
  border-radius: 14px;
  text-decoration:none;
  font-weight: 800;
  font-size: 13px;
  color: #03130a;
  background: linear-gradient(180deg, rgba(22,163,74,.95), rgba(22,163,74,.75));
  border: 1px solid rgba(22,163,74,.55);
  box-shadow: 0 14px 28px rgba(22,163,74,.16);
  transition: transform .15s ease, filter .15s ease;
}

.btn:hover{ transform: translateY(-1px); filter: brightness(1.03); }
.btn:active{ transform: translateY(0); }
.btn.secondary{
  color: var(--ink);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow2);
}

/* PDF container */
.pdf-container{
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--r20);
  box-shadow: var(--shadow2);
  height: calc(100vh - 220px);
  padding: 10px;
  margin-top: 12px;
}
.pdf-container embed{
  width: 100%;
  height: 100%;
  border-radius: 14px;
  border: 0;
  background: #ffffff;
}


/* Responsive */
@media (max-width: 720px){
  .app{ margin: 14px auto; }
  #chat{ height: 56vh; }
  .msg{ max-width: 92%; font-size: 14px; }
  h1{ font-size: 18px; }
  .banner .brand{ font-size: 16px; }
  .banner .tag{ font-size: 12px; }
  #send{ padding: 12px 14px; }
  .pdf-container{ height: calc(100vh - 240px); }
}
