/* Webhook Tester — Violet Dark */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #8B5CF6;
  --primary-dim: rgba(139,92,246,0.12);
  --primary-glow: rgba(139,92,246,0.25);
  --accent: #A78BFA;
  --green: #10B981;
  --red: #EF4444;
  --orange: #F59E0B;
  --bg: #0C0A14;
  --bg-card: #171322;
  --border: rgba(139,92,246,0.10);
  --text: #E8E2F0;
  --text-dim: #9B8FB8;
  --text-muted: #5C4F7A;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --transition: 0.2s ease;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6; }

.header { border-bottom: 1px solid var(--border); background: rgba(23,19,34,0.95); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10; }
.header-inner { max-width: 750px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; }
.header-left { display: flex; align-items: center; gap: 10px; }
.header-actions { display: flex; gap: 6px; }
.logo-icon { font-size: 1.2rem; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: var(--primary-dim); border-radius: var(--radius-sm); }
.header h1 { font-size: 1.05rem; font-weight: 700; }
.subtitle { font-size: 0.72rem; color: var(--text-dim); }

.btn { padding: 8px 16px; font-family: var(--font); font-size: 0.78rem; font-weight: 600; border: none; border-radius: 6px; cursor: pointer; transition: all var(--transition); }
.btn-sm { padding: 5px 10px; font-size: 0.72rem; background: var(--primary-dim); color: var(--accent); border: 1px solid rgba(139,92,246,0.2); }
.btn-primary { background: linear-gradient(135deg, var(--primary), #7C3AED); color: #fff; }
.btn-primary:hover { box-shadow: 0 4px 16px var(--primary-glow); }

.main { max-width: 750px; margin: 0 auto; padding: 20px; }

.compose-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.compose-row { display: flex; gap: 6px; }
.method-select { width: 90px; padding: 8px; font-family: var(--font); font-size: 0.78rem; font-weight: 600; color: var(--accent); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; outline: none; cursor: pointer; }
.url-input { flex: 1; padding: 8px 10px; font-family: var(--mono); font-size: 0.78rem; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; outline: none; }
.url-input:focus { border-color: rgba(139,92,246,0.4); }

.compose-details { margin-top: 8px; }
.compose-details summary { font-size: 0.72rem; color: var(--text-muted); cursor: pointer; }
.compose-fields { margin-top: 8px; }
.field-label { display: block; font-size: 0.68rem; color: var(--text-muted); margin-bottom: 2px; margin-top: 6px; }
.field-label small { color: var(--text-muted); }
.field-input { width: 100%; padding: 6px 8px; font-family: var(--mono); font-size: 0.72rem; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; outline: none; resize: vertical; }

.filter-bar { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; }
.filter-label { font-size: 0.68rem; color: var(--text-muted); margin-right: 4px; }
.filter-btn { padding: 3px 8px; font-family: var(--font); font-size: 0.68rem; font-weight: 600; color: var(--text-muted); background: transparent; border: 1px solid transparent; border-radius: 4px; cursor: pointer; transition: all var(--transition); }
.filter-btn.active { color: var(--accent); background: var(--primary-dim); border-color: rgba(139,92,246,0.2); }

.log-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; border-bottom: 1px solid var(--border); }
.panel-label { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.log-count { font-size: 0.68rem; font-weight: 600; color: var(--primary); background: var(--primary-dim); padding: 2px 8px; border-radius: 10px; }

.log-list { max-height: 450px; overflow-y: auto; }
.log-row { border-bottom: 1px solid rgba(139,92,246,0.04); }
.log-header { display: flex; align-items: center; gap: 8px; padding: 8px 14px; cursor: pointer; transition: background var(--transition); }
.log-header:hover { background: rgba(139,92,246,0.04); }
.method-badge { font-family: var(--mono); font-size: 0.62rem; font-weight: 700; padding: 2px 6px; border-radius: 3px; min-width: 40px; text-align: center; }
.method-badge.GET { background: rgba(16,185,129,0.15); color: var(--green); }
.method-badge.POST { background: rgba(139,92,246,0.15); color: var(--primary); }
.method-badge.PUT { background: rgba(245,158,11,0.15); color: var(--orange); }
.method-badge.PATCH { background: rgba(245,158,11,0.15); color: var(--orange); }
.method-badge.DELETE { background: rgba(239,68,68,0.15); color: var(--red); }
.log-url { flex: 1; font-family: var(--mono); font-size: 0.72rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-status { font-family: var(--mono); font-size: 0.68rem; }
.log-status.ok { color: var(--green); }
.log-status.err { color: var(--red); }
.log-time { font-size: 0.62rem; color: var(--text-muted); }

.log-body { padding: 0 14px 10px; display: none; }
.log-body.open { display: block; }
.log-content { font-family: var(--mono); font-size: 0.68rem; color: var(--text-dim); white-space: pre-wrap; word-break: break-all; max-height: 200px; overflow: auto; padding: 8px; background: rgba(0,0,0,0.2); border-radius: 6px; margin-top: 4px; }
.log-section { font-size: 0.62rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; margin-top: 8px; margin-bottom: 2px; }

.empty-state { padding: 24px; text-align: center; font-size: 0.82rem; color: var(--text-muted); }

.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column-reverse; gap: 8px; }
.toast { padding: 10px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 4px 24px rgba(0,0,0,0.5); font-size: 0.82rem; animation: toastIn 0.3s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 600px) { .compose-row { flex-wrap: wrap; } .method-select { width: 100%; } }
