/* ============================================================
   GSY Learning Bot — Tema: "Deep Ocean" (biru tua + teal)
   ============================================================ */
:root {
  --bg: #0b1220;
  --bg-2: #0f1a2e;
  --panel: #111c33;
  --panel-2: #16233f;
  --border: #22314f;
  --text: #e6edf7;
  --muted: #93a4c0;
  --accent: #22d3ee;      /* teal */
  --accent-2: #3b82f6;    /* blue */
  --user: #1d4ed8;
  --bot: #16233f;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(34,211,238,.10), transparent),
    radial-gradient(900px 500px at -10% 110%, rgba(59,130,246,.12), transparent),
    var(--bg);
  color: var(--text);
}

/* ---------- Layout ---------- */
.app {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px;
  height: 100vh;
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; height: auto; }
}

/* ---------- Header ---------- */
.brand {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 0 6px;
}
.logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  font-weight: 800; color: #04121c; font-size: 18px;
  box-shadow: var(--shadow);
}
.brand h1 { font-size: 18px; margin: 0; letter-spacing: .3px; }
.brand p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }

/* ---------- Panels ---------- */
.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.side { padding: 16px; overflow-y: auto; }
.side h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); margin: 0 0 10px; }

/* ---------- Dropzone ---------- */
.drop {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: .2s;
  font-size: 13px;
}
.drop:hover, .drop.over { border-color: var(--accent); color: var(--text); background: rgba(34,211,238,.06); }
.drop b { color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  border: none; cursor: pointer; border-radius: 10px;
  padding: 10px 14px; font-weight: 600; font-size: 13px;
  color: #04121c;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  transition: .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost {
  background: transparent; color: var(--muted);
  border: 1px solid var(--border);
}
.btn.ghost:hover { color: var(--text); border-color: var(--accent); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Doc list ---------- */
.docs { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.doc {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 11px; font-size: 12px;
}
.doc .name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc .meta { color: var(--muted); font-size: 11px; white-space: nowrap; }
.empty { color: var(--muted); font-size: 12px; text-align: center; padding: 10px; }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-head {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.chat-head .status { font-size: 12px; color: var(--muted); }
.dot { display:inline-block; width:8px; height:8px; border-radius:50%; background: var(--ok); margin-right:6px; }

.messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 82%; padding: 12px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: var(--user); border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--bot); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg .src { margin-top: 8px; font-size: 11px; color: var(--accent); opacity: .9; }
.msg .src span { display:inline-block; background: rgba(34,211,238,.12); border:1px solid rgba(34,211,238,.3); border-radius: 6px; padding: 1px 6px; margin: 2px 4px 0 0; }

.composer { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--border); }
.composer input {
  flex: 1; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; color: var(--text); font-size: 14px; outline: none;
}
.composer input:focus { border-color: var(--accent); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  padding: 10px 16px; border-radius: 10px; font-size: 13px; opacity: 0;
  transition: .25s; pointer-events: none; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { border-color: var(--ok); }
.toast.err { border-color: var(--err); }

.typing { color: var(--muted); font-size: 13px; font-style: italic; }

/* ---------- Header actions (admin) ---------- */
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn.sm { padding: 7px 11px; font-size: 12px; }
.pill {
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border);
  color: var(--muted); background: rgba(148,163,184,.12);
}
.pill.admin {
  color: var(--ok); border-color: rgba(52,211,153,.4);
  background: rgba(52,211,153,.12);
}
.notice {
  background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.35);
  color: #fde68a; border-radius: 12px; padding: 13px 15px; font-size: 12.5px;
  line-height: 1.55;
}
.notice a { color: var(--accent); }
