*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d0f14;
  --surface: #161920;
  --surface2: #1e2230;
  --surface3: #252a3a;
  --border: #2a2f42;
  --accent: #6c8fff;
  --accent-glow: rgba(108,143,255,0.15);
  --green: #4cde80;
  --green-dim: rgba(76,222,128,0.12);
  --red: #f45c5c;
  --red-dim: rgba(244,92,92,0.12);
  --yellow: #fbbf24;
  --text: #e2e8f0;
  --text-dim: #8892a4;
  --text-muted: #4a5568;
  --get: #4cde80;
  --post: #fbbf24;
  --radius: 8px;
  --radius-sm: 5px;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; }

/* ── Layout ── */
.layout { display: flex; height: calc(100vh - 36px); overflow: hidden; }

/* ── Sidebar ── */
.sidebar {
  width: 260px; min-width: 260px; background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.brand { display: flex; align-items: center; gap: 8px; padding: 20px 16px 14px; border-bottom: 1px solid var(--border); }
.brand-dot { width: 8px; height: 8px; background: var(--green); border-radius: 50%; box-shadow: 0 0 8px var(--green); }
.brand-name { font-weight: 700; font-size: 15px; color: var(--text); }
.brand-tag { font-size: 11px; padding: 2px 7px; background: var(--accent-glow); color: var(--accent); border: 1px solid var(--accent); border-radius: 20px; font-weight: 600; }

.base-url-section { padding: 14px 14px 8px; border-bottom: 1px solid var(--border); }
.label { font-size: 11px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: .6px; display: block; margin-bottom: 6px; }
.base-input { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px; color: var(--text); font-family: var(--mono); font-size: 12px; outline: none; }
.base-input:focus { border-color: var(--accent); }
.connection-status { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--text-dim); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); }
.dot.connected { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot.disconnected { background: var(--red); }
.dot.testing { background: var(--yellow); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity:1 } 50% { opacity:.4 } }

.sidebar-nav { flex: 1; padding: 8px 0 16px; }
.nav-group-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-muted); padding: 12px 16px 4px; }
.nav-item {
  width: 100%; background: none; border: none; cursor: pointer; color: var(--text-dim);
  display: flex; align-items: center; gap: 8px; padding: 7px 14px;
  font-size: 12px; font-family: var(--mono); text-align: left;
  border-left: 2px solid transparent; transition: all .15s;
}
.nav-item:hover { background: var(--surface2); color: var(--text); border-left-color: var(--border); }
.nav-item.active { background: var(--accent-glow); color: var(--text); border-left-color: var(--accent); }
.nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.method-badge { font-size: 10px; font-weight: 700; padding: 2px 5px; border-radius: 3px; flex-shrink: 0; font-family: var(--mono); }
.method-badge.get { background: var(--green-dim); color: var(--get); }
.method-badge.post { background: rgba(251,191,36,.12); color: var(--post); }

/* ── Main Panel ── */
.main-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.topbar { padding: 16px 20px 12px; border-bottom: 1px solid var(--border); background: var(--surface); }
.request-bar { display: flex; align-items: center; gap: 10px; }
.method-display { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--get); background: var(--green-dim); padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid rgba(76,222,128,.2); white-space: nowrap; }
.path-input {
  flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 12px; color: var(--text); font-family: var(--mono); font-size: 13px; outline: none;
}
.path-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
.send-btn {
  background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 8px 22px; font-weight: 600; font-size: 13px; cursor: pointer; transition: all .15s;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.send-btn:hover { background: #7fa0ff; }
.send-btn:active { transform: scale(.97); }
.send-btn.loading { background: var(--surface3); cursor: not-allowed; }
.spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .6s linear infinite; }
.spinner.hidden { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Note Box ── */
.note-box {
  display: flex; align-items: flex-start; gap: 10px; margin: 14px 20px 0;
  background: rgba(108,143,255,.07); border: 1px solid rgba(108,143,255,.2);
  border-radius: var(--radius); padding: 12px 14px;
}
.note-icon { color: var(--accent); font-size: 16px; margin-top: 1px; flex-shrink: 0; }
.note-text { font-size: 13px; color: var(--text-dim); line-height: 1.5; }

/* ── Response ── */
.response-section { flex: 1; display: flex; flex-direction: column; margin: 14px 20px 0; overflow: hidden; }
.response-meta { display: flex; gap: 12px; margin-bottom: 8px; font-size: 12px; min-height: 20px; }
.meta-chip { padding: 3px 10px; border-radius: 20px; font-weight: 600; font-family: var(--mono); }
.meta-chip.ok { background: var(--green-dim); color: var(--get); }
.meta-chip.error { background: var(--red-dim); color: var(--red); }
.meta-chip.neutral { background: var(--surface2); color: var(--text-dim); }

.response-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.response-tabs { display: flex; gap: 4px; }
.resp-tab { background: none; border: 1px solid var(--border); color: var(--text-dim); padding: 4px 12px; border-radius: var(--radius-sm); font-size: 12px; cursor: pointer; font-family: var(--font); }
.resp-tab.active { background: var(--surface3); color: var(--text); border-color: var(--border); }
.resp-tab:hover { border-color: var(--accent); }
.copy-btn { background: none; border: 1px solid var(--border); color: var(--text-dim); padding: 4px 12px; border-radius: var(--radius-sm); font-size: 12px; cursor: pointer; }
.copy-btn:hover { color: var(--text); border-color: var(--accent); }

.response-body-wrap { flex: 1; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.response-body-wrap::-webkit-scrollbar { width: 6px; height: 6px; }
.response-body-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.response-body { padding: 16px 18px; font-family: var(--mono); font-size: 12.5px; line-height: 1.7; color: var(--text); white-space: pre-wrap; word-break: break-all; }
.placeholder-text { color: var(--text-muted); font-style: italic; font-family: var(--font); font-size: 13px; }

/* JSON syntax highlighting */
.json-key { color: #7dd3fc; }
.json-string { color: #86efac; }
.json-number { color: #fbbf24; }
.json-bool { color: #c084fc; }
.json-null { color: #f87171; }

/* ── Events Picker ── */
.events-picker { margin: 14px 20px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.picker-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.picker-header h3 { font-size: 13px; font-weight: 600; color: var(--text); }
.picker-hint { font-size: 11px; color: var(--text-muted); font-weight: 400; margin-left: 6px; }
.refresh-picker { background: none; border: 1px solid var(--border); color: var(--text-dim); width: 28px; height: 28px; border-radius: var(--radius-sm); font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .2s; }
.refresh-picker:hover { border-color: var(--accent); color: var(--accent); transform: rotate(20deg); }
.events-grid { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
.event-pill {
  display: flex; flex-direction: column; gap: 2px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px;
  cursor: pointer; transition: all .15s; max-width: 200px;
}
.event-pill:hover { border-color: var(--accent); background: var(--accent-glow); }
.event-pill .pill-id { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.event-pill .pill-name { font-size: 11px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-pill .pill-sport { font-size: 10px; color: var(--text-muted); }
.pill-live { font-size: 9px; font-weight: 700; color: var(--green); background: var(--green-dim); padding: 1px 5px; border-radius: 20px; display: inline-block; margin-left: 4px; }

/* ── Stats Panel ── */
.stats-panel {
  height: 36px; background: var(--surface); border-top: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 20px; gap: 24px;
}
.stats-item { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.stats-label { color: var(--text-muted); }
.stats-value { font-family: var(--mono); font-weight: 600; color: var(--text-dim); }
.stats-value.green { color: var(--green); }
.stats-value.ok { color: var(--green); }
.stats-value.error { color: var(--red); }
.in-flight-note { margin-left: auto; cursor: help; }
