:root {
  --bg-body: #090a0f;
  --bg-card: #12131b;
  --bg-card-hover: #161824;
  --border-card: rgba(255, 255, 255, 0.08);
  --border-card-hover: rgba(59, 130, 246, 0.45);
  
  --primary: #3b82f6;
  --primary-purple: #8b5cf6;
  --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --accent-green: #10b981;
  --accent-cyan: #06b6d4;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-pill: 9999px;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-body);
}
::-webkit-scrollbar-thumb {
  background: #1f2335;
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: #313753;
}

.site-wrapper {
  width: 100%;
  max-width: 960px;
  padding: 48px 24px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Hero Section (Matching reference image) */
.hero-section {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 36px;
}

.main-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.api-highlight {
  background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 14px;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 4px;
}

.hero-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 18px;
}

/* Domain Pill */
.domain-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: #11131c;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.domain-pill:hover {
  border-color: rgba(16, 185, 129, 0.5);
  background: #151824;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.9);
  animation: pulseDot 1.6s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.domain-pill code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #f1f5f9;
  font-weight: 500;
}

/* Endpoints Grid (2 Columns Layout) */
.api-grid-container {
  width: 100%;
}

.endpoints-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  width: 100%;
}

/* Endpoint Card */
.endpoint-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.endpoint-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.endpoint-card-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.endpoint-method {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #60a5fa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.endpoint-path {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.endpoint-desc {
  font-size: 12px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Copy Button */
.btn-copy-card {
  background: #0b0d14;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.btn-copy-card:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.5);
}

.btn-copy-card.copied {
  background: #059669;
  border-color: #059669;
  color: #ffffff;
}

/* Demo Web CTA Button (KMKV26) */
.demo-cta-container {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.btn-demo-kmkv {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #1a1e30 0%, #232a48 50%, #1a1b3a 100%);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-pill);
  color: #ffffff;
  text-decoration: none;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.2);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.btn-demo-kmkv:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: #6366f1;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 30px rgba(99, 102, 241, 0.45);
  background: linear-gradient(135deg, #242b46 0%, #313c69 50%, #272855 100%);
}

.demo-icon {
  font-size: 20px;
}

.demo-btn-text {
  letter-spacing: 0.5px;
  color: #ffffff;
}

.demo-badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.5px;
}

.demo-arrow {
  color: #818cf8;
  transition: transform 0.2s ease;
}

.btn-demo-kmkv:hover .demo-arrow {
  transform: translateX(4px);
  color: #fff;
}

.demo-cta-hint {
  font-size: 12px;
  color: #64748b;
  text-align: center;
}

/* Footer */
.site-footer {
  margin-top: 32px;
  font-size: 12px;
  color: #64748b;
  text-align: center;
}

/* JSON Response Modal */
.json-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.85);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.json-modal-backdrop.show {
  display: flex;
}

.json-modal-container {
  background: #0e1017;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  width: 100%;
  max-width: 820px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  animation: modalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.json-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #141722;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-method {
  background: rgba(37, 99, 235, 0.25);
  color: #60a5fa;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.modal-endpoint-path {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-status-badge {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.modal-time-badge {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.modal-btn-action {
  background: #1a1e2d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-btn-action:hover {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.modal-close-btn:hover {
  color: #ffffff;
}

/* Parameter Bar */
.modal-param-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: #11131c;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-param-bar label {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.modal-param-bar input {
  flex: 1;
  background: #090a0f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 4px;
}

.modal-param-bar input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-param-run {
  background: #2563eb;
  border: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-param-run:hover {
  background: #1d4ed8;
}

/* Modal Body */
.json-modal-body {
  padding: 20px;
  overflow: auto;
  flex: 1;
  background: #08090d;
}

.modal-loading {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 12px;
  color: var(--text-muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.json-modal-body pre {
  margin: 0;
}

.json-modal-body code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Syntax Highlighting */
.json-key { color: #818cf8; }
.json-string { color: #34d399; }
.json-number { color: #fbbf24; }
.json-boolean { color: #f43f5e; }
.json-null { color: #94a3b8; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e2438;
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 2000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.25s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
  .endpoints-grid {
    grid-template-columns: 1fr;
  }
  .site-wrapper {
    padding: 32px 16px;
  }
  .main-title {
    font-size: 26px;
  }
}
