/*
 * Classroom styles for Agentic Team Studio.
 * Role: visual layer only — cards, badges, and layout for the teaching UI.
 * Teaching metaphor: the UI is the classroom window where students see agent behavior.
 */

:root {
  --brand: #8b1d2c;
  --brand2: #5a1320;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --soft: #f8fafc;
  --good: #166534;
  --warn: #b45309;
  --bad: #991b1b;
  --info: #1d4ed8;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

body {
  margin: 0;
  font-family: Inter, system-ui, Segoe UI, Arial, sans-serif;
  background: #f7f9fc;
  color: var(--ink);
  line-height: 1.55;
}

.wrap {
  max-width: 1180px;
  margin: auto;
  padding: 26px 18px 48px;
}

.hero {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #fff;
  border-radius: 22px;
  padding: 26px;
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 1.85rem;
  letter-spacing: -0.02em;
}

.hero p { margin: 0; opacity: 0.96; max-width: 70ch; }

.grid {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

@media (min-width: 900px) {
  .grid-2 { grid-template-columns: 1.1fr 0.9fr; }
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.muted { color: var(--muted); font-size: 0.92rem; }

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin: 10px 0 6px;
  color: #334155;
}

textarea,
input,
select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}

textarea { resize: vertical; min-height: 96px; }

button,
.btn {
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  font: inherit;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button.secondary {
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--line);
}

.hero button.secondary {
  background: #fff;
  color: var(--brand);
}

.examples {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  max-height: 180px;
  overflow: auto;
}

.chip {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--soft);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  font-weight: 600;
  font-size: 0.82rem;
  line-height: 1.35;
}

.chip:hover {
  border-color: var(--brand);
}

.chip-tool {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--info);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.item,
.task,
.trace-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 8px;
  background: var(--soft);
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 800;
  margin: 2px 4px 2px 0;
  background: #fff;
}

.badge.info { background: #eff6ff; color: var(--info); border-color: #bfdbfe; }
.badge.good { background: #ecfdf3; color: var(--good); border-color: #bbf7d0; }
.badge.warn { background: #fff7ed; color: var(--warn); border-color: #fed7aa; }
.badge.bad { background: #fef2f2; color: var(--bad); border-color: #fecaca; }

.tool-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.tool-row label.inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 600;
  white-space: nowrap;
}

.tool-row input[type="checkbox"] {
  width: auto;
}

pre.trace {
  margin: 8px 0 0;
  padding: 12px;
  border-radius: 12px;
  background: #0b1220;
  color: #e5e7eb;
  overflow: auto;
  font-size: 12px;
  line-height: 1.5;
}

.status-bar {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

.empty {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 8px;
}

/* Toast notifications — confirm button/process outcomes */
.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #0f172a;
  color: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-size: 0.92rem;
  font-weight: 600;
  border-left: 4px solid #94a3b8;
  animation: toast-in 0.2s ease-out;
}

.toast.success { border-left-color: #22c55e; }
.toast.error { border-left-color: #ef4444; }
.toast.info { border-left-color: #3b82f6; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Friendly overlay while waiting on OpenAI */
.ai-thinking {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ai-thinking-card {
  background: #fff;
  border-radius: 18px;
  padding: 28px 32px;
  max-width: 360px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.ai-thinking-card strong {
  display: block;
  font-size: 1.15rem;
  margin-bottom: 8px;
  color: var(--brand);
}

.ai-thinking-card p {
  margin: 0;
  color: var(--muted);
}

.ai-thinking-dots {
  display: inline-flex;
  gap: 6px;
  margin-top: 16px;
}

.ai-thinking-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  animation: think-bounce 1s infinite ease-in-out;
}

.ai-thinking-dots span:nth-child(2) { animation-delay: 0.15s; }
.ai-thinking-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes think-bounce {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-4px); }
}
