/* ============================================================
   PayCentral Design System
   Dark & Premium — v1.0
   ============================================================ */

/* ── Alpine.js ─────────────────────────────────────────────── */
[x-cloak] { display: none !important; }

/* ── Variables ──────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-base:     #0a0f1e;
  --bg-surface:  #0d1117;
  --bg-elevated: #161b27;
  --bg-hover:    #1c2333;

  /* Accent emerald */
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-glow: rgba(16, 185, 129, 0.25);
  --emerald-glow-sm: rgba(16, 185, 129, 0.12);

  /* Text */
  --text-primary:   #f0f6fc;
  --text-secondary: #8b949e;
  --text-muted:     #484f58;

  /* Borders */
  --border:       #1e2638;
  --border-light: #2d3748;

  /* Status */
  --yellow-400: #fbbf24;
  --red-400:    #f87171;
  --blue-400:   #60a5fa;
  --purple-400: #a78bfa;

  /* Fonts */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Spacing */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

a {
  color: var(--emerald-500);
  text-decoration: none;
  transition: color 0.15s;
}
a:hover { color: var(--emerald-400); }

code, pre, .font-mono {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn-primary {
  background: var(--emerald-500);
  color: #0a0f1e;
  box-shadow: 0 0 20px var(--emerald-glow);
}
.btn-primary:hover {
  background: var(--emerald-400);
  color: #0a0f1e;
  box-shadow: 0 0 32px rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.btn-outline {
  background: transparent;
  color: var(--emerald-500);
  border: 1px solid var(--emerald-500);
}
.btn-outline:hover {
  background: var(--emerald-glow-sm);
  color: var(--emerald-400);
  border-color: var(--emerald-400);
}

.btn-sm { padding: 6px 14px; font-size: 0.8125rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 32px; font-size: 1.0625rem; border-radius: var(--radius-lg); }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.card:hover {
  border-color: var(--border-light);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}
.card-glow:hover {
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 4px 32px var(--emerald-glow-sm), 0 0 0 1px rgba(16, 185, 129, 0.15);
}

/* ── Code Blocks ────────────────────────────────────────────── */
.code-block {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.code-block-header .dots {
  display: flex;
  gap: 6px;
}
.code-block-header .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-red    { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green  { background: #27c93f; }

.code-block-header .filename {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.code-block pre {
  padding: 20px;
  overflow-x: auto;
  margin: 0;
}

/* Copy button */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-sans);
}
.copy-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-light);
}
.copy-btn.copied {
  color: var(--emerald-500);
  border-color: var(--emerald-500);
}

/* ── Syntax Highlighting ────────────────────────────────────── */
.token-keyword   { color: #ff7b72; }          /* rose — function, return, use, class */
.token-string    { color: #a5d6ff; }          /* bleu clair — 'chaînes' */
.token-comment   { color: var(--text-muted); font-style: italic; }
.token-number    { color: #79c0ff; }          /* bleu — chiffres */
.token-value     { color: #ffa657; }          /* orange — constantes, true/false/null */
.token-method    { color: var(--emerald-400); } /* vert — méthodes/fonctions */
.token-variable  { color: #e6edf3; }          /* blanc */
.token-operator  { color: #ff7b72; }          /* rose — => , ; */
.token-key       { color: #79c0ff; }          /* bleu — clés tableau */
.token-type      { color: #ffa657; }          /* orange — types PHP */
.token-namespace { color: #d2a8ff; }          /* violet — namespace, use */
.token-bash      { color: var(--emerald-400); } /* vert — commandes bash */
.token-url       { color: #a5d6ff; }          /* bleu — URLs */
.token-label     { color: var(--text-secondary); } /* gris — labels JSON */
.token-punct     { color: var(--text-secondary); } /* ponctuation */

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 15, 30, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero-gradient {
  background: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(16, 185, 129, 0.12) 0%, transparent 70%),
              radial-gradient(ellipse 60% 40% at 80% 50%, rgba(16, 185, 129, 0.05) 0%, transparent 60%),
              var(--bg-base);
}

.hero-grid {
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.3;
  position: absolute;
  inset: 0;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 0%, black, transparent);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 0%, black, transparent);
}

/* ── Sections ───────────────────────────────────────────────── */
.section { padding: 96px 0; }
.section-sm { padding: 64px 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 24px; }

/* ── Badge ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid;
}
.badge-emerald {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--emerald-400);
}
.badge-blue {
  background: rgba(96, 165, 250, 0.1);
  border-color: rgba(96, 165, 250, 0.3);
  color: var(--blue-400);
}

/* ── Tables ─────────────────────────────────────────────────── */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
table {
  width: 100%;
  border-collapse: collapse;
}
thead tr {
  background: var(--bg-elevated);
}
th {
  padding: 12px 20px;
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 14px 20px;
  font-size: 0.9375rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}
td:first-child { color: var(--text-primary); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }

/* ── Docs Layout ────────────────────────────────────────────── */
.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 65px);
  gap: 0;
}

@media (max-width: 1024px) {
  .docs-layout { grid-template-columns: 1fr; }
}

.docs-sidebar {
  position: sticky;
  top: 65px;
  height: calc(100vh - 65px);
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  background: var(--bg-surface);
}

.sidebar-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 16px 12px 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: all 0.15s;
  text-decoration: none;
}
.sidebar-link:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.sidebar-link.active {
  background: var(--emerald-glow-sm);
  color: var(--emerald-400);
  border-left: 2px solid var(--emerald-500);
}

.docs-content {
  padding: 48px;
  max-width: 760px;
}

@media (max-width: 768px) {
  .docs-content { padding: 24px 16px; }
}

/* ── Docs Typography ────────────────────────────────────────── */
.docs-content h1 {
  font-size: 2rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}
.docs-content h2 {
  font-size: 1.4rem;
  margin-top: 56px;
  margin-bottom: 16px;
  color: var(--text-primary);
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.docs-content h3 {
  font-size: 1.1rem;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--text-primary);
}
.docs-content p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.75;
}
.docs-content ul, .docs-content ol {
  color: var(--text-secondary);
  padding-left: 1.5rem;
  margin-bottom: 16px;
  line-height: 1.75;
}
.docs-content li { margin-bottom: 6px; }
.docs-content code:not(pre code) {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.85em;
  color: var(--emerald-400);
}
.docs-content .code-block { margin: 20px 0; }

/* ── Tabs (Alpine.js) ───────────────────────────────────────── */
.tab-list {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  overflow-x: auto;
}
.tab-btn {
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active {
  color: var(--emerald-400);
  border-bottom-color: var(--emerald-500);
}

/* ── Steps ──────────────────────────────────────────────────── */
.step-item {
  display: flex;
  gap: 20px;
  position: relative;
}
.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 19px;
  top: 48px;
  width: 1px;
  height: calc(100% - 12px);
  background: var(--border);
}
.step-number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--emerald-glow-sm);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--emerald-400);
  font-weight: 700;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Pricing ────────────────────────────────────────────────── */
.pricing-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  transition: all 0.2s;
}
.pricing-card.featured {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 40px var(--emerald-glow-sm), 0 0 0 1px rgba(16,185,129,0.12);
  background: linear-gradient(135deg, rgba(16,185,129,0.06) 0%, var(--bg-elevated) 60%);
}
.pricing-card:not(.featured):hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}
.price-amount {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

/* ── Feature icons ──────────────────────────────────────────── */
.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--emerald-glow-sm);
  border: 1px solid rgba(16, 185, 129, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px var(--emerald-glow); }
  50%       { box-shadow: 0 0 40px rgba(16, 185, 129, 0.45); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.animate-fade-up   { animation: fadeUp 0.5s ease forwards; }
.animate-fade-in   { animation: fadeIn 0.4s ease forwards; }
.animate-float     { animation: float 4s ease-in-out infinite; }
.animate-pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

/* ── Gradient text ──────────────────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, var(--emerald-400) 0%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Divider ────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 48px 0;
}

/* ── Callout (docs) ─────────────────────────────────────────── */
.callout {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border-left: 3px solid;
  margin: 20px 0;
  font-size: 0.9375rem;
}
.callout-info {
  background: rgba(96, 165, 250, 0.08);
  border-color: var(--blue-400);
  color: var(--text-secondary);
}
.callout-warning {
  background: rgba(251, 191, 36, 0.08);
  border-color: var(--yellow-400);
  color: var(--text-secondary);
}
.callout-success {
  background: rgba(16, 185, 129, 0.08);
  border-color: var(--emerald-500);
  color: var(--text-secondary);
}

/* ── Lang switcher ──────────────────────────────────────────── */
.lang-btn {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text-muted);
  transition: all 0.15s;
}
.lang-btn.active {
  background: var(--emerald-glow-sm);
  color: var(--emerald-400);
}
.lang-btn:hover:not(.active) { color: var(--text-primary); }

/* ── Mobile menu ────────────────────────────────────────────── */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg-base);
  padding: 80px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Provider badges ────────────────────────────────────────── */
.provider-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 600;
}
.provider-mtn      { background: rgba(255, 204, 0, 0.15); color: #ffcc00; }
.provider-orange   { background: rgba(255, 102, 0, 0.15); color: #ff6600; }
.provider-airtel   { background: rgba(229, 57, 53, 0.15); color: #e53935; }
.provider-moov     { background: rgba(30, 136, 229, 0.15); color: #1e88e5; }
.provider-mastercard { background: rgba(167, 139, 250, 0.15); color: var(--purple-400); }

/* ── HTTP Method badges ─────────────────────────────────────── */
.method-get    { background: rgba(16, 185, 129, 0.15); color: var(--emerald-400); font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.method-post   { background: rgba(96, 165, 250, 0.15); color: var(--blue-400); font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.method-patch  { background: rgba(251, 191, 36, 0.15); color: var(--yellow-400); font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.method-delete { background: rgba(248, 113, 113, 0.15); color: var(--red-400); font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; }

/* ── Endpoint row ───────────────────────────────────────────── */
.endpoint-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 12px;
  transition: border-color 0.15s;
  cursor: default;
}
.endpoint-row:hover { border-color: var(--border-light); }
.endpoint-path { font-family: var(--font-mono); font-size: 0.875rem; color: var(--text-primary); }
.endpoint-desc { font-size: 0.875rem; color: var(--text-muted); margin-top: 2px; }

/* ── Footer ─────────────────────────────────────────────────── */
.footer-link {
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: color 0.15s;
  text-decoration: none;
}
.footer-link:hover { color: var(--text-primary); }

/* ── Responsive Helpers ─────────────────────────────────────── */
@media (max-width: 768px) {
  .section { padding: 64px 0; }
  .section-sm { padding: 40px 0; }
  .docs-sidebar { display: none; }
  .docs-layout { grid-template-columns: 1fr; }
  .hide-mobile { display: none !important; }
}
@media (min-width: 769px) {
  .show-mobile { display: none !important; }
}
