/* CellProxy Docs — Mashnet-style dark + neon lime */

:root {
  --bg: #000000;
  --surface: #121212;
  --surface-2: #1a1a1a;
  --stroke: #2a2a2a;
  --lime: #c8ff00;
  --lime-dim: #9ecc00;
  --lime-glow: rgba(200, 255, 0, 0.15);
  --text: #ffffff;
  --muted: #8e8e93;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 24px;
  --radius-sm: 14px;
}

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

body.docs-page {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.mono { font-family: var(--mono); }

.docs-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

.docs-glow-a {
  width: 400px;
  height: 400px;
  background: rgba(200, 255, 0, 0.07);
  top: -100px;
  left: -80px;
}

.docs-glow-b {
  width: 350px;
  height: 350px;
  background: rgba(200, 255, 0, 0.05);
  bottom: 10%;
  right: -60px;
}

/* Header */
.docs-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 28px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--stroke);
}

.docs-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.docs-logo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--lime);
  color: #000;
  font-weight: 800;
  font-size: 14px;
  display: grid;
  place-items: center;
}

.docs-brand h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.docs-brand p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.docs-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Buttons */
.docs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: transform 0.15s, opacity 0.15s;
}

.docs-btn:active { transform: scale(0.97); }

.docs-btn-primary {
  background: var(--lime);
  color: #000;
}

.docs-btn-primary:hover {
  background: #d4ff33;
}

.docs-btn-outline {
  background: transparent;
  color: var(--lime);
  border: 1.5px solid var(--lime);
}

.docs-btn-outline:hover {
  background: var(--lime-glow);
}

.docs-btn-sm {
  padding: 6px 14px;
  font-size: 11px;
}

/* Layout */
.docs-shell {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 28px 100px;
}

/* Tab bar — Mashnet pill style */
.docs-tabbar {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  margin-bottom: 28px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.docs-tabbar::-webkit-scrollbar { display: none; }

.docs-tab {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.docs-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: inherit;
}

.docs-tab-icon svg,
.docs-config-icon svg,
.docs-hero-card-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.docs-tab.active .docs-tab-icon svg {
  stroke: #000;
}

.docs-config-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--lime-glow);
  border: 1px solid rgba(200, 255, 0, 0.2);
  display: grid;
  place-items: center;
  color: var(--lime);
}

.docs-config-icon svg {
  width: 18px;
  height: 18px;
}

.docs-hero-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--lime-glow);
  border: 1px solid rgba(200, 255, 0, 0.25);
  color: var(--lime);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}

.docs-hero-card-icon svg {
  width: 22px;
  height: 22px;
}

.docs-tab.active {
  background: var(--lime);
  color: #000;
  box-shadow: 0 4px 20px rgba(200, 255, 0, 0.25);
}

.docs-tab-panel { display: none; }
.docs-tab-panel.active { display: block; }

.docs-panel-head { margin-bottom: 24px; }

.docs-panel-title {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.docs-panel-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.docs-section-subtitle {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 28px 0 14px;
}

.docs-pill-sm {
  font-size: 11px;
  padding: 6px 12px;
}

/* Config cards — Mashnet style */
.docs-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.docs-config-card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s;
}

.docs-config-card:hover { border-color: rgba(200, 255, 0, 0.2); }

.docs-config-card-active {
  border-color: rgba(200, 255, 0, 0.35);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(200, 255, 0, 0.06) 100%);
}

.docs-config-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.docs-config-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--lime);
  background: var(--lime-glow);
  padding: 4px 10px;
  border-radius: 999px;
}

.docs-config-card h3 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.docs-config-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.docs-config-card strong { color: var(--text); }

.docs-hero-card-inline { margin-top: 24px; }

/* APK progress */
.docs-apk-progress-wrap { margin: 16px 0 12px; }

.docs-apk-progress-bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--stroke);
}

.docs-apk-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--lime);
  border-radius: 999px;
  transition: width 0.15s ease;
  box-shadow: 0 0 12px rgba(200, 255, 0, 0.5);
}

.docs-apk-progress-text {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.docs-apk-action {
  width: 100%;
  padding: 14px 20px;
  font-size: 14px;
  margin-top: 4px;
}

.docs-apk-action.docs-apk-loading {
  opacity: 0.85;
  cursor: wait;
}

.docs-apk-install {
  background: #fff !important;
  color: #000 !important;
  border: 2px solid var(--lime);
}

.docs-apk-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
  text-align: center;
}

.docs-apk-scan {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 10px;
}

.docs-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: docs-spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

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

.toast-error {
  background: #ff453a !important;
  color: #fff !important;
}

/* Legacy sidebar removed — keep old classes for compat */
.docs-sidebar { display: none; }
.docs-nav { display: none; }

.docs-main {
  position: relative;
  z-index: 1;
}

/* Hero */
.docs-hero {
  margin-bottom: 48px;
  scroll-margin-top: 100px;
}

.docs-hero-top { margin-bottom: 20px; }

.docs-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.docs-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime);
}

.docs-hero-title {
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.docs-hero-desc {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 520px;
  margin-bottom: 24px;
}

.docs-hero-desc code {
  color: var(--lime);
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 13px;
}

.docs-hero-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
}

.docs-hero-card strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.docs-hero-card p {
  font-size: 13px;
  color: var(--muted);
}

.docs-accent { color: var(--lime); font-weight: 600; }

/* Sections */
.docs-section {
  margin-bottom: 48px;
  scroll-margin-top: 100px;
}

.docs-section-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.docs-section-desc {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Cards */
.docs-card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 12px;
}

.docs-card-highlight {
  border-color: rgba(200, 255, 0, 0.2);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(200, 255, 0, 0.04) 100%);
}

.docs-card-tip {
  font-size: 14px;
  margin-top: 16px;
}

.docs-card-tip code {
  color: var(--lime);
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 6px;
}

.docs-muted { color: var(--muted); }

.docs-card-cta {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

.docs-card-cta p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
}

.docs-card-actions { margin-top: 14px; }

.docs-url {
  font-size: 13px;
  word-break: break-all;
  margin: 10px 0 0;
  color: var(--lime);
}

/* Stats grid */
.docs-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.docs-stat-card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}

.docs-stat-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
}

.docs-stat-value {
  display: block;
  font-size: 14px;
  font-weight: 600;
  word-break: break-all;
  color: var(--text);
}

/* Rules grid */
.docs-rules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}

.docs-rule-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
}

.docs-rule-card.docs-rule-active {
  border-color: rgba(200, 255, 0, 0.35);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(200, 255, 0, 0.06) 100%);
}

.docs-rule-icon {
  color: var(--lime);
  font-size: 14px;
  line-height: 1.4;
}

.docs-rule-card strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.docs-rule-card p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* Code blocks */
.docs-code-card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.docs-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--stroke);
  background: var(--surface-2);
}

.docs-code-lang {
  font-size: 12px;
  font-weight: 600;
  color: var(--lime);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.docs-code-card pre {
  padding: 18px 20px;
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  color: #e5e5e5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  background: #0a0a0a;
}

/* Checklist */
.docs-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.docs-checklist li {
  font-size: 14px;
  color: var(--muted);
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  line-height: 1.5;
}

.docs-checklist li::before {
  content: "✓ ";
  color: var(--lime);
  font-weight: 700;
}

.docs-checklist code {
  color: var(--lime);
  font-size: 12px;
}

/* APK section */
.docs-apk-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: start;
  background: var(--surface);
  border: 1px solid rgba(200, 255, 0, 0.2);
  border-radius: var(--radius);
  padding: 24px;
  background: linear-gradient(135deg, var(--surface) 0%, rgba(200, 255, 0, 0.05) 100%);
}

.docs-apk-qr-wrap {
  background: #fff;
  border-radius: 16px;
  padding: 12px;
  line-height: 0;
}

.docs-apk-qr-wrap img {
  display: block;
  width: 140px;
  height: 140px;
}

.docs-apk-version {
  font-size: 22px;
  font-weight: 700;
  color: var(--lime);
  margin: 6px 0 8px;
}

.docs-apk-url {
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
  margin-bottom: 16px;
}

.docs-apk-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.docs-apk-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.docs-apk-step span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--lime);
  color: #000;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.docs-apk-step strong { color: var(--text); }

.docs-apk-download {
  text-decoration: none;
  display: inline-flex;
}

@media (max-width: 640px) {
  .docs-apk-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .docs-apk-right { width: 100%; }
  .docs-apk-step { text-align: left; }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--lime);
  color: #000;
  font-weight: 600;
  font-size: 13px;
  padding: 12px 24px;
  border-radius: 999px;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(200, 255, 0, 0.25);
}

/* Responsive */
@media (max-width: 768px) {
  .docs-shell {
    padding: 16px 16px 90px;
  }

  .docs-tabbar {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    z-index: 200;
    margin-bottom: 0;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(16px);
  }

  .docs-tab-label { font-size: 10px; }

  .docs-stats-grid,
  .docs-rules-grid {
    grid-template-columns: 1fr;
  }

  .docs-header {
    padding: 14px 16px;
  }

  .docs-header-actions .docs-btn-primary { display: none; }
}
