/* ─── Reset & Base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #080b14;
  --bg-2:      #0d1120;
  --bg-card:   rgba(255,255,255,0.04);
  --bg-card-h: rgba(255,255,255,0.07);
  --border:    rgba(255,255,255,0.08);
  --border-h:  rgba(255,255,255,0.18);
  --text:      #e8eaf2;
  --text-2:    #8892aa;
  --text-3:    #4d5566;
  --accent:    #7c3aed;
  --accent-2:  #a855f7;
  --pink:      #ec4899;
  --cyan:      #06b6d4;
  --green:     #10b981;
  --yellow:    #f59e0b;
  --red:       #ef4444;
  --radius:    14px;
  --radius-sm: 8px;
  --shadow:    0 8px 40px rgba(0,0,0,0.6);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ─── Background ──────────────────────────────────────────────────────── */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(124,58,237,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,58,237,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

.orb {
  position: fixed; border-radius: 50%; filter: blur(80px); pointer-events: none; z-index: 0;
  animation: float 8s ease-in-out infinite;
}
.orb-1 { width: 500px; height: 500px; background: radial-gradient(circle, rgba(124,58,237,0.18) 0%, transparent 70%); top: -150px; left: -100px; }
.orb-2 { width: 400px; height: 400px; background: radial-gradient(circle, rgba(236,72,153,0.14) 0%, transparent 70%); bottom: -100px; right: -50px; animation-delay: -3s; }
.orb-3 { width: 300px; height: 300px; background: radial-gradient(circle, rgba(6,182,212,0.10) 0%, transparent 70%); top: 40%; left: 60%; animation-delay: -5s; }

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-30px) scale(1.05); }
}

/* ─── Header ───────────────────────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8,11,20,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1300px; margin: 0 auto;
  padding: 14px 28px;
  display: flex; align-items: center; gap: 24px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; }
.logo-icon { font-size: 1.4rem; }
.logo-badge {
  background: linear-gradient(135deg, var(--accent), var(--pink));
  color: #fff; font-size: 0.65rem; font-weight: 700;
  padding: 2px 8px; border-radius: 99px; letter-spacing: 0.05em;
  vertical-align: middle;
}
.nav-pills { display: flex; gap: 6px; margin-left: auto; }
.pill {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-2); padding: 7px 18px; border-radius: 99px;
  font-size: 0.82rem; font-weight: 500; cursor: pointer;
  transition: all 0.2s; font-family: 'Inter', sans-serif;
}
.pill:hover { border-color: var(--border-h); color: var(--text); }
.pill.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; color: #fff;
}
.status-badge {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.75rem; color: var(--text-2);
  border: 1px solid var(--border); border-radius: 99px; padding: 5px 12px;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--text-3);
  transition: background 0.3s;
}
.dot.online { background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse-dot 2s infinite; }
.dot.offline { background: var(--red); }
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 6px var(--green); }
  50%       { box-shadow: 0 0 14px var(--green); }
}

/* ─── Main ──────────────────────────────────────────────────────────────── */
.main { position: relative; z-index: 1; max-width: 1300px; margin: 0 auto; padding: 40px 28px 60px; }
.tab { display: none; }
.tab.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Hero ──────────────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 60px 0 40px; }
.hero-title { font-size: clamp(2.4rem, 5vw, 3.8rem); font-weight: 900; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 14px; }
.gradient-text { background: linear-gradient(135deg, var(--accent-2), var(--pink) 60%, var(--cyan)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-sub { color: var(--text-2); font-size: 1rem; margin-bottom: 36px; }
.quick-stats {
  display: inline-flex; gap: 0; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; background: var(--bg-card);
}
.stat {
  padding: 16px 28px; text-align: center;
  border-right: 1px solid var(--border);
}
.stat:last-child { border-right: none; }
.stat-val { display: block; font-size: 1.5rem; font-weight: 700; }
.stat-label { display: block; font-size: 0.7rem; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px; }

/* ─── Tester Card ──────────────────────────────────────────────────────── */
.tester-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-top: 16px;
}
.tester-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.method-badge {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
  padding: 5px 10px; border-radius: 6px; flex-shrink: 0;
}
.method-badge.get { background: rgba(16,185,129,0.15); color: var(--green); border: 1px solid rgba(16,185,129,0.3); }
.url-input-wrap { flex: 1; display: flex; align-items: center; background: rgba(0,0,0,0.3); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.base-url { padding: 9px 12px; color: var(--text-3); font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; white-space: nowrap; border-right: 1px solid var(--border); }
.endpoint-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--cyan); font-family: 'JetBrains Mono', monospace; font-size: 0.85rem;
  padding: 9px 12px;
}
.send-btn {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 9px 20px; font-weight: 600; font-size: 0.85rem; cursor: pointer;
  transition: opacity 0.2s, transform 0.1s; flex-shrink: 0;
  font-family: 'Inter', sans-serif;
}
.send-btn:hover { opacity: 0.88; }
.send-btn:active { transform: scale(0.97); }
.send-btn.loading { opacity: 0.6; pointer-events: none; }

/* Quick endpoints */
.quick-endpoints {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
}
.qe-label { font-size: 0.72rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.1em; }
.qe-btn {
  font-size: 0.75rem; padding: 4px 10px; border-radius: 6px;
  background: rgba(124,58,237,0.12); border: 1px solid rgba(124,58,237,0.25);
  color: var(--accent-2); cursor: pointer; transition: all 0.15s;
  font-family: 'JetBrains Mono', monospace;
}
.qe-btn:hover { background: rgba(124,58,237,0.25); border-color: var(--accent); }

/* Response area */
.response-area {
  min-height: 280px; padding: 20px;
  overflow-x: auto;
}
.response-placeholder { text-align: center; padding: 60px 20px; color: var(--text-3); }
.placeholder-icon { font-size: 2.5rem; margin-bottom: 12px; }
pre.json-output {
  font-family: 'JetBrains Mono', monospace; font-size: 0.82rem;
  line-height: 1.7; white-space: pre-wrap; word-break: break-word;
  color: var(--text);
}
.response-meta {
  display: flex; gap: 16px; padding: 10px 20px;
  border-top: 1px solid var(--border); font-size: 0.75rem; color: var(--text-3);
}
.response-meta span { color: var(--text-2); }

/* JSON Syntax highlighting */
.json-key { color: #a78bfa; }
.json-str { color: #34d399; }
.json-num { color: #fb923c; }
.json-bool { color: #60a5fa; }
.json-null { color: #f87171; }

/* ─── Docs ──────────────────────────────────────────────────────────────── */
.docs-header { text-align: center; padding: 50px 0 40px; }
.docs-header h2 { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.02em; }
.docs-header p { color: var(--text-2); margin-top: 10px; }
.endpoints-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.endpoint-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  transition: border-color 0.2s, background 0.2s;
}
.endpoint-card:hover { border-color: var(--border-h); background: var(--bg-card-h); }
.ep-method { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em; display: inline-block; padding: 3px 8px; border-radius: 5px; margin-bottom: 10px; }
.ep-method.get { background: rgba(16,185,129,0.15); color: var(--green); border: 1px solid rgba(16,185,129,0.3); }
.ep-path { font-family: 'JetBrains Mono', monospace; font-size: 0.9rem; color: var(--cyan); display: block; margin-bottom: 8px; }
.ep-desc { font-size: 0.85rem; color: var(--text-2); margin-bottom: 10px; }
.ep-params, .ep-return { font-size: 0.77rem; color: var(--text-3); }
.ep-params code, .ep-return code { color: var(--accent-2); font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; }
.schema-block { margin-top: 36px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.schema-block h3 { font-size: 1rem; margin-bottom: 16px; color: var(--text-2); }
.code-block { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; line-height: 1.8; color: #34d399; overflow-x: auto; }

/* ─── Browse ────────────────────────────────────────────────────────────── */
.browse-controls { margin-bottom: 28px; }
.search-bar-wrap {
  position: relative; display: flex; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 16px;
  transition: border-color 0.2s;
}
.search-bar-wrap:focus-within { border-color: var(--accent); }
.search-icon { position: absolute; left: 16px; color: var(--text-3); pointer-events: none; }
.search-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-family: 'Inter', sans-serif; font-size: 0.95rem;
  padding: 14px 16px 14px 48px;
}
.search-input::placeholder { color: var(--text-3); }
.search-clear {
  background: none; border: none; color: var(--text-3); cursor: pointer;
  padding: 0 16px; font-size: 0.9rem; transition: color 0.15s;
}
.search-clear:hover { color: var(--text); }
.cat-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-btn {
  font-size: 0.78rem; padding: 6px 14px; border-radius: 99px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-2); cursor: pointer; transition: all 0.15s;
  font-family: 'Inter', sans-serif;
}
.cat-btn:hover { border-color: var(--border-h); color: var(--text); }
.cat-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; color: #fff;
}

/* Posts Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.grid-loading { grid-column: 1/-1; text-align: center; padding: 80px 20px; color: var(--text-3); }
.spinner {
  width: 36px; height: 36px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.post-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.post-card:hover { transform: translateY(-4px); border-color: var(--border-h); box-shadow: var(--shadow); }
.post-thumb { position: relative; width: 100%; padding-top: 56%; overflow: hidden; background: #0d1120; }
.post-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.post-card:hover .post-thumb img { transform: scale(1.06); }
.post-thumb-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; }
.video-badge {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,0.7); color: #fff; font-size: 0.65rem; font-weight: 700;
  padding: 3px 8px; border-radius: 99px; backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.15); text-transform: uppercase; letter-spacing: 0.06em;
}
.post-body { padding: 16px; }
.post-title-card { font-size: 0.84rem; font-weight: 600; line-height: 1.4; margin-bottom: 10px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta-row { display: flex; flex-wrap: wrap; gap: 6px; }
.post-meta-tag {
  font-size: 0.65rem; padding: 2px 8px; border-radius: 99px;
  background: rgba(124,58,237,0.12); border: 1px solid rgba(124,58,237,0.2);
  color: var(--accent-2);
}
.post-photos { font-size: 0.7rem; color: var(--text-3); margin-top: 8px; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; flex-wrap: wrap; }
.page-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-2); cursor: pointer; font-size: 0.82rem; font-weight: 500;
  transition: all 0.15s; font-family: 'Inter', sans-serif;
}
.page-btn:hover { border-color: var(--border-h); color: var(--text); }
.page-btn.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ─── Footer ────────────────────────────────────────────────────────────── */
.footer { text-align: center; padding: 24px; color: var(--text-3); font-size: 0.8rem; border-top: 1px solid var(--border); position: relative; z-index: 1; }
.footer a { color: var(--accent-2); text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.heart { color: var(--pink); }

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .header-inner { padding: 12px 16px; }
  .logo-text .logo-badge { display: none; }
  .main { padding: 24px 16px 48px; }
  .tester-header { flex-wrap: wrap; }
  .url-input-wrap { order: 3; flex: 1 1 100%; }
  .quick-stats { flex-direction: column; }
  .stat { border-right: none; border-bottom: 1px solid var(--border); }
  .stat:last-child { border-bottom: none; }
}
