:root {
  color-scheme: light;
  --bg: #f9fafb;
  --bg-card: #ffffff;
  --bg-soft: #f3f4f6;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --accent: #0ea5e9;
  --accent-soft: rgba(14,165,233,0.12);
  --accent-strong: #0369a1;
  --text-main: #0f172a;
  --text-muted: #6b7280;
  --danger: #dc2626;
}

body.dark {
  color-scheme: dark;
  --bg: #222222;
  --bg-card: #212121;
  --bg-soft: #181818;
  --border: #2e2e2e;
  --border-strong: #383838;
  --accent: white;
  --accent-soft: rgba(255,255,255,0.08);
  --accent-strong: #e5e7eb;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --danger: #f97373;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0 10px 30px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #181818;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  color: var(--text-main);
  min-height: 100vh;
}

.shell {
  max-width: 960px;
  margin: 0 auto;
}

.api-page-shell {
  padding-top: 42px;
}

.mono {
  font-family: "Ubuntu Mono", monospace;
}

/* =========================
   NAVBAR
========================= */

.api-navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(24, 24, 24, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid #2e2e2e;
  margin: 0 -10px;
}

.api-navbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.api-logo {
  color: #fff;
  text-decoration: none;
  font-family: "Ubuntu Mono", monospace;
  font-size: 22px;
  font-weight: 700;
}

.api-nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
}

.api-nav-links a {
  color: #9ca3af;
  text-decoration: none;
  transition: 0.2s ease;
}

.api-nav-links a:hover {
  color: #fff;
}

.api-nav-btn {
  display: none;
  height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #383838;
  background: #212121;
  color: #e5e7eb;
  font-family: "Ubuntu Mono", monospace;
  font-weight: 700;
  cursor: pointer;
}

/* =========================
   HERO
========================= */

.hero {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  margin-bottom: 26px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin: 0 auto;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid #2e2e2e;
  background: #212121;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--text-muted);
}

h1 {
  margin: 18px 0 12px;
  font-size: clamp(2.4rem, 8vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: -3px;
  color: #fff;
}

.hero-sub {
  margin: 0;
  font-size: .95rem;
  color: #9ca3af;
}

.desc {
  max-width: 640px;
  margin: 10px auto 0;
  line-height: 1.5;
}

/* =========================
   STATUS DOT
========================= */

#status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.status-online {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34,197,94,.4);
  animation: pulseOnline 2s infinite ease-in-out;
}

.status-offline {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239,68,68,.4);
}

@keyframes pulseOnline {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

/* =========================
   STATS
========================= */

#api-section {
  margin-top: 22px;
}

.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
  text-align: center;
}

.stat-card {
  width: 100%;
  min-width: 0;
  border-radius: 18px;
  border: 1px solid #2e2e2e;
  background: #212121;
  padding: 16px 12px;
  position: relative;
  overflow: hidden;
}

.stat-card:nth-child(3) {
  grid-column: 1 / -1;
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -22px;
  width: 80px;
  height: 80px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.04);
}

.stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-muted);
}

.stat-value {
  margin-top: 2px;
  font-size: 1.45rem;
  font-weight: 600;
  color: #fff;
}

.stat-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* =========================
   TOOLBAR
========================= */

.toolbar {
  width: 100%;
  margin: 16px 0 14px;
}

.toolbar-right {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: relative;
  flex-wrap: nowrap;
}

.toolbar-search {
  flex: 1;
  min-width: 0;
}

.endpoint-search,
.btn-menu {
  height: 42px;
  border-radius: 12px;
  border: 1px solid #2e2e2e;
  background: #212121;
  color: var(--text-muted);
  font-family: "Ubuntu Mono", monospace;
  font-size: 13px;
}

.endpoint-search {
  width: 100%;
  padding: 0 10px;
  outline: none;
}

.endpoint-search:focus,
.endpoint-search:hover,
.btn-menu:hover {
  border-color: #666;
  box-shadow: none;
}

.btn-menu {
  flex: 0 0 auto;
  padding: 0 12px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-menu span.icon {
  width: 15px;
  height: 10px;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
}

.btn-menu span.icon i {
  display: block;
  height: 1px;
  width: 100%;
  background: var(--text-muted);
}

/* =========================
   MENU PANEL
========================= */

.menu-panel {
  position: absolute;
  right: 0;
  left: auto;
  top: 48px;
  border: 1px solid #2e2e2e;
  background: #212121;
  padding: 6px;
  min-width: 170px;
  display: none;
  z-index: 20;
  border-radius: 18px;
  box-shadow: 0 20px 45px rgba(0,0,0,0.35);
}

.menu-item {
  padding: 8px;
  font-size: .85rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 12px;
}

.menu-item:hover,
.menu-item.active {
  background: #2a2a2a;
}

.menu-item .badge {
  font-size: .72rem;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* =========================
   CATEGORY / CARD
========================= */

.api-layout {
  margin-top: 10px;
}

.category-section {
  display: none;
}

.category-section.active {
  display: block;
}

.category-title {
  margin: 18px 0 12px;
  font-size: 1.15rem;
  color: #fff;
}

.endpoint-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.endpoint-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #2e2e2e;
  background: #212121;
  padding: 14px;
  border-radius: 18px;
  transition: .22s ease;
  box-shadow: none;
}

.endpoint-card:hover {
  transform: translateY(-4px);
  border-color: #666;
}

.ep-header {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.ep-name-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.arrow {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.arrow img {
  width: 12px;
  height: 12px;
  display: block;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.arrow.down img {
  transform: rotate(180deg);
}

body.dark .arrow img,
body.dark .play img,
body.dark .respon img,
body.dark .terminal img {
  filter: invert(1) brightness(2);
}

.ep-name {
  font-size: 0.96rem;
  font-weight: 700;
  color: #fff;
}

.ep-path-line {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .78rem;
  color: #9ca3af;
  margin-top: 3px;
}

.ep-method-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .72rem;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #383838;
  color: #e5e7eb;
  background: #2a2a2a;
}

.ep-body {
  margin-top: 14px;
  border-top: 1px solid #2e2e2e;
  padding-top: 12px;
}

/* =========================
   LABEL ICONS
========================= */

.ep-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--text-muted);
  margin: 8px 0 6px;
}

.play,
.respon,
.terminal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.play img {
  width: 13px;
  height: 13px;
  display: block;
  object-fit: contain;
}

.respon img,
.terminal img {
  width: 15px;
  height: 15px;
  display: block;
  object-fit: contain;
}

/* =========================
   INPUT
========================= */

.ep-actions {
  margin-top: 8px;
  display: grid ;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) ;
  gap: 10px ;
  align-items: stretch ;
}

.ep-input-wrap {
  grid-column: 1 / -1 ;
  width: 100% ;
  margin-bottom: 12px;
  position: relative;
}

.ep-input-wrap label,
.ep-apikey-wrap label {
  display: block;
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.ep-input-wrap input,
.ep-apikey-wrap input {
  width: 100%;
  padding: 8px 9px;
  border-radius: 12px;
  border: 1px solid #383838;
  background: #181818;
  color: var(--text-main);
  outline: none;
  font-family: "Ubuntu Mono", monospace;
  font-size: 13px;
}

.ep-input-wrap input:focus,
.ep-apikey-wrap input:focus {
  border-color: #666;
}

.ep-hint {
  font-size: .76rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.ep-apikey-wrap {
  margin-top: 10px;
}

/* =========================
   FORCE BUTTONS EQUAL SIZE
========================= */

.ep-actions {
  display: grid ;
  grid-template-columns: repeat(2, minmax(0, 1fr)) ;
  gap: 12px ;
  align-items: stretch ;
}

.ep-actions > .ep-input-wrap {
  grid-column: 1 / -1 ;
  width: 100% ;
}

.ep-actions > .btn-ep-test,
.ep-actions > .btn-ep-clear {
  grid-column: auto ;
  width: 100% ;
  max-width: none ;
  min-width: 0 ;
  height: 58px ;
  margin: 0 ;
  padding: 0 ;

  display: flex ;
  align-items: center ;
  justify-content: center ;

  border-radius: 14px ;
  box-sizing: border-box ;
  font-size: 12px ;
  line-height: 1 ;
}

/* EXECUTE kiri */
.ep-actions > .btn-ep-test {
  background: #181818 ;
  border: 1px solid #383838 ;
  color: #e5e7eb ;
}

/* CLEAR kanan, dibuat solid biar nggak keliatan kecil */
.ep-actions > .btn-ep-clear {
  background: #181818 ;
  border: 1px solid #383838 ;
  color: #e5e7eb ;
}

/* kalau mau CLEAR ikut putih juga, aktifin ini */
/*
.ep-actions > .btn-ep-clear {
  background: #ffffff ;
  border: 1px solid #ffffff ;
  color: #111111 ;
}
*/

/* =========================
   RESPONSE
========================= */

.ep-response {
  margin-top: 8px;
  border: 1px solid #2e2e2e;
  background: #111;
  color: #e5e7eb;
  font-size: .78rem;
  display: none;
  border-radius: 16px;
  overflow: hidden;
}

.ep-response.open {
  display: block;
}

.preview-dots {
  display: inline-flex;
  gap: 5px;
  padding: 7px 0 3px 8px;
}

.preview-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.preview-dot.red {
  background: #fb7185;
}

.preview-dot.amber {
  background: #fdba74;
}

.preview-dot.green {
  background: #86efac;
}

.ep-response-header {
  padding: 6px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #2e2e2e;
  border-bottom: 1px solid #2e2e2e;
  font-size: .74rem;
  color: #9ca3af;
}

.ep-response-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ep-response-body {
  max-height: 300px;
  overflow: auto;
  padding: 8px;
}

.ep-response-body pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.btn-copy-resp {
  border: 1px solid #383838;
  background: #181818;
  color: #e5e7eb;
  cursor: pointer;
  border-radius: 10px;
  padding: 6px 10px;
  font-family: "Ubuntu Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  transition: .2s ease;
}

.btn-copy-resp:hover {
  border-color: #666;
  background: #222;
}

/* =========================
   META
========================= */

.ep-meta-block {
  margin-top: 8px;
  display: grid;
  gap: 10px;
}

.ep-meta-card {
  border: 1px solid #2e2e2e;
  background: #212121;
  padding: 12px;
  border-radius: 16px;
}

.ep-meta-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ep-meta-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ep-meta-value {
  font-size: .78rem;
  word-break: break-all;
}

.ep-meta-code {
  margin: 0;
  font-size: .78rem;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* =========================
   TOAST
========================= */

#toast-container {
  position: fixed;
  top: 65px;
  right: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 99999;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 6px;
  padding: 10px 14px;
  background: #fef3c7;
  border-left: 5px solid #f59e0b;
  color: #8a4b0e;
  font-size: .8rem;
  min-width: 200px;
  max-width: 280px;
  animation: toastFadeIn .3s ease forwards;
}

.toast.error {
  background: #fee2e2;
  border-left-color: #dc2626;
  color: #7f1d1d;
}

@keyframes toastFadeIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastFadeOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

/* =========================
   FOOTER
========================= */

.footer {
  border-top: 1px solid #2e2e2e;
  margin-top: 34px;
  padding-top: 18px;
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
  gap: 8px;
  color: var(--text-muted);
}

/* =========================
   MOBILE
========================= */

@media (max-width: 640px) {
  .api-navbar-inner {
    padding: 14px;
  }

  .api-logo {
    font-size: 19px;
  }

  .api-nav-links {
    display: none;
  }

  .api-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .api-page-shell {
    padding-top: 28px;
  }

  .hero {
    min-height: 240px;
  }

  h1 {
    letter-spacing: -2px;
  }

  .toolbar-right {
    width: 100%;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .toolbar-search {
    flex: 1;
    min-width: 0;
  }

  .endpoint-search {
    width: 100%;
  }

  .btn-menu {
    width: 46px;
    justify-content: center;
    padding: 0 8px;
    font-size: 12px;
  }

  .btn-menu .mono {
    display: none;
  }

  .stats-row {
    grid-template-columns: 1fr 1fr;
  }

  .stat-card:nth-child(3) {
    grid-column: 1 / -1;
  }
}

.image-response-box {
  width: 100%;
  display: grid;
  gap: 10px;
}

.image-response-preview {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  display: block;
  border-radius: 14px;
  border: 1px solid #2e2e2e;
  background: #181818;
}

.image-response-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid #383838;
  background: #181818;
  color: #e5e7eb;
  text-decoration: none;
  font-family: "Ubuntu Mono", monospace;
  font-size: 12px;
  font-weight: 700;
}

.image-response-link:hover {
  border-color: #666;
}

.ep-select-wrap {
  margin-top: 10px;
}

.ep-select-wrap label {
  display: block;
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.ep-select {
  width: 100%;
  padding: 8px 9px;
  border-radius: 12px;
  border: 1px solid #383838;
  background: #181818;
  color: var(--text-main);
  outline: none;
  font-family: "Ubuntu Mono", monospace;
  font-size: 13px;
}

.ep-select:focus {
  border-color: #666;
}

.video-response-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.video-response-preview {
  width: 100%;
  border-radius: 12px;
  background: #000;
}

.video-response-link {
  text-decoration: none;
  font-size: 13px;
  color: white;
}

.ep-method-select,
.ep-size-select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: #181818;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: 0.2s ease;
  appearance: none;
  cursor: pointer;
}

.ep-method-select:hover,
.ep-size-select:hover {
  border-color: #666;
}

.ep-method-select:focus,
.ep-size-select:focus {
  border-color: #666;
  box-shadow: none;
}

.ep-method-select option,
.ep-size-select option {
  background: #181818;
  color: #fff;
}

.ep-input-wrap-btn {
  grid-column: 1 / -1 ;
  width: 100% ;
  margin-bottom: 12px;
  position: relative;
}

.ep-input-wrap-btn::after {
  position: absolute;
  right: 14px;
  top: 42px;
  color: #9ca3af;
  pointer-events: none;
  font-size: 14px;
}

.select-wrap {
  position: relative;
  width: 100%;
}

.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  padding-right: 40px;
}

.select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
  transition: .25s ease;
  pointer-events: none;
  width: 14px;
  height: 14px;
  opacity: .7;
}

.select-arrow img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.select-wrap.active .select-arrow {
  transform: translateY(-50%) rotate(-90deg);
}

.image-response-box {
  width: 100%;
  margin-top: 10px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  background: #0b0b0b;
}

.image-response-link {
  display: block;
  width: 100%;
}

.image-response-preview {
  width: 100%;
  display: block;
  object-fit: cover;
  border-radius: 14px;
}

/* =========================
   FIX RESPONSE OVERFLOW
========================= */

.ep-response {
  max-width: 100%;
  overflow: hidden;
}

.ep-response-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.ep-response-meta {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 4px;
  overflow: hidden;
}

.ep-response-meta span {
  min-width: 0;
  max-width: 100%;
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ep-res-url {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-copy-resp {
  flex: 0 0 auto;
  white-space: nowrap;
  max-width: 96px;
  font-size: 10px;
  padding: 6px 8px;
}

.ep-response-body {
  max-width: 100%;
  overflow-x: auto;
}

.ep-response-body pre {
  max-width: 100%;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* =========================
   FIX META URL / CURL OVERFLOW
========================= */

.ep-meta-card {
  max-width: 100%;
  overflow: hidden;
}

.ep-meta-value,
.ep-meta-code {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* =========================
   FIX VIDEO / IMAGE WIDTH
========================= */

.video-response-box,
.audio-response-box,
.image-response-box {
  max-width: 100%;
  overflow: hidden;
}

.video-response-preview {
  width: 100%;
  max-width: 100%;
  max-height: 360px;
  display: block;
  object-fit: contain;
  background: #000;
  border-radius: 12px;
}

.image-response-preview {
  width: 100%;
  max-width: 100%;
  max-height: 520px;
  display: block;
  object-fit: contain;
  background: #0b0b0b;
  border-radius: 12px;
}