/* ==========================================================================
   PayHamyon — API Hujjatlari Uslublari (docs.css)
   Stripe & Vercel Style Developer Documentation Portal
   ========================================================================== */

.docs-body {
  background-color: #07090e;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Documentation Header */
.docs-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 24px;
}

.docs-header-inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.docs-header-left {
  display: flex;
  align-items: center;
  gap: 32px;
}

.docs-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  white-space: nowrap;
}

.docs-header-brand span {
  white-space: nowrap;
}

.docs-version-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan);
  border-radius: var(--radius-full);
}

.docs-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.docs-search-bar {
  position: relative;
  width: 280px;
}

.docs-search-input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  background: #060911;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 0.85rem;
  outline: none;
  transition: all var(--transition-fast);
}

.docs-search-input:focus {
  border-color: var(--accent-cyan);
  background: #0a0f1d;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.25);
}

.docs-search-input:focus {
  border-color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.08);
}

.docs-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

/* Docs Main Layout: 3-column / 2-column + Code */
.docs-layout {
  display: flex;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

/* Sidebar Navigation (Left) */
.docs-sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 69px;
  height: calc(100vh - 69px);
  overflow-y: auto;
  padding: 32px 20px;
  border-right: 1px solid var(--border-subtle);
  background: rgba(7, 9, 14, 0.5);
}

.docs-nav-group {
  margin-bottom: 28px;
}

.docs-nav-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-left: 12px;
}

.docs-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.docs-nav-item a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.docs-nav-item a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

.docs-nav-item.active a {
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  font-weight: 600;
}

.method-tag {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
}

.method-post {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.method-get {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Documentation Content (Middle) */
.docs-content {
  flex: 1;
  padding: 48px 48px 80px;
  max-width: 820px;
  overflow-wrap: break-word;
}

.docs-section {
  padding-bottom: 64px;
  margin-bottom: 64px;
  border-bottom: 1px solid var(--border-subtle);
}

.docs-section:last-child {
  border-bottom: none;
}

.docs-h1 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}

.docs-h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 24px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.docs-h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 12px;
}

.docs-lead {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}

.docs-alert {
  background: rgba(99, 102, 241, 0.08);
  border-left: 3px solid var(--accent-indigo);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 0.95rem;
}

.docs-alert.info {
  background: rgba(6, 182, 212, 0.08);
  border-color: var(--accent-cyan);
}

.docs-alert.warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: var(--accent-amber);
}

.endpoint-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin: 20px 0 28px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
}

.endpoint-url {
  color: #ffffff;
  font-weight: 600;
}

/* Parameters Table */
.param-table-wrap {
  margin: 24px 0 32px;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.param-table th {
  background: rgba(15, 23, 42, 0.8);
  padding: 14px 18px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
}

.param-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: top;
}

.param-table tr:last-child td {
  border-bottom: none;
}

.param-name {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--accent-cyan);
}

.param-type {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.param-required {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
}

.param-optional {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

/* Code Playground Panel (Right Sticky) */
.docs-code-pane {
  width: 480px;
  flex-shrink: 0;
  position: sticky;
  top: 69px;
  height: calc(100vh - 69px);
  overflow-y: auto;
  padding: 32px 24px;
  background: #090e1a;
  border-left: 1px solid var(--border-subtle);
}

.code-card {
  background: #060911;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.code-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.lang-tabs {
  display: flex;
  gap: 4px;
}

.lang-tab {
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-tab:hover {
  color: #ffffff;
}

.lang-tab.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent-cyan);
}

.copy-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.code-card-body {
  padding: 16px;
  overflow-x: auto;
}

.code-card-body pre {
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #cbd5e1;
}

.code-token-keyword { color: #c084fc; font-weight: 600; }
.code-token-string { color: #34d399; }
.code-token-number { color: #38bdf8; }
.code-token-bool { color: #f59e0b; }
.code-token-key { color: #93c5fd; }
.code-token-comment { color: #64748b; font-style: italic; }

/* Backdrop for mobile drawer */
.docs-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 95;
}
.docs-backdrop.active {
  display: block;
}

/* Mobile Menu & Responsive adjustments for Docs */
@media (max-width: 1280px) {
  .docs-code-pane {
    display: none; /* In smaller viewports, code snippets appear inline within content */
  }
  .docs-content {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .docs-header {
    padding: 10px 12px;
  }
  .docs-header-inner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .docs-header-left {
    gap: 8px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }
  .docs-header-brand {
    font-size: 1rem;
    gap: 6px;
    white-space: nowrap;
  }
  .docs-header-brand span {
    white-space: nowrap;
  }
  .docs-header-brand .brand-logo-img {
    width: 28px !important;
    height: 24px !important;
  }
  .docs-version-badge {
    display: none !important;
  }
  .docs-search-bar {
    display: none !important;
  }
  .docs-header-right {
    gap: 6px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }
  .docs-home-btn span,
  .docs-bot-btn span {
    display: none !important;
  }
  .docs-home-btn,
  .docs-bot-btn {
    width: 34px;
    height: 34px;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
  }
  .mobile-toggle.docs-mobile-nav-btn {
    width: 36px;
    height: 36px;
  }
  .docs-sidebar {
    display: block !important;
    position: fixed;
    top: 57px;
    left: -320px;
    width: min(280px, 85vw);
    height: calc(100vh - 57px);
    background: #090e1a;
    z-index: 100;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.8);
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .docs-sidebar.mobile-open {
    left: 0;
  }
  .docs-content {
    padding: 24px 14px;
  }
  .docs-mobile-nav-btn {
    display: inline-flex !important;
  }
}

@media (max-width: 480px) {
  .docs-header {
    padding: 10px 10px;
  }
  .docs-header-brand {
    font-size: 0.95rem;
  }
  .docs-h1 {
    font-size: 1.85rem;
  }
  .docs-h2 {
    font-size: 1.4rem;
  }
  .endpoint-banner {
    flex-direction: column;
    align-items: flex-start;
    font-size: 0.82rem;
    padding: 10px 14px;
  }
  .param-table th, .param-table td {
    padding: 10px 12px;
    font-size: 0.82rem;
  }
}

@media (max-width: 360px) {
  .docs-header-brand {
    font-size: 0.88rem;
  }
}
