/**
 * iHRM API Documentation — aligned with ihrm-corporate + ecosystem marketing
 */
body.ihrm-docs-page {
  background: var(--ihrm-surface, #f8fafc);
  padding-top: 64px;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 1100;
  background: linear-gradient(90deg, var(--ihrm-accent, #2563eb), #60a5fa, var(--ihrm-primary-light, #2d4f7c));
}

/* Navbar */
.ihrm-docs-navbar {
  background: var(--ihrm-primary, #1e3a5f);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
  min-height: 64px;
}

.ihrm-docs-navbar .navbar-brand {
  color: #fff !important;
  font-weight: 700;
  font-size: 1.35rem;
}

.ihrm-docs-navbar .navbar-brand .i {
  font-style: italic;
  font-weight: 300;
}

.ihrm-docs-navbar .docs-brand-sub {
  font-size: 0.75rem;
  opacity: 0.75;
  font-weight: 500;
  margin-left: 0.35rem;
}

.ihrm-docs-navbar .nav-link {
  color: rgba(255, 255, 255, 0.88) !important;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.45rem 0.75rem !important;
  border-radius: 0.375rem;
  transition: color 0.2s, background 0.2s;
}

.ihrm-docs-navbar .nav-link:hover,
.ihrm-docs-navbar .docs-nav-link.active {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.1);
}

.ihrm-docs-navbar .nav-cta {
  background: var(--ihrm-accent, #2563eb);
  color: #fff !important;
  margin-left: 0.25rem;
}

.ihrm-docs-navbar .nav-cta:hover {
  background: #1d4ed8;
}

.ihrm-docs-navbar .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.35);
}

.ihrm-docs-navbar .navbar-toggler-icon {
  filter: invert(1);
}

/* Hero */
.docs-hero {
  background: linear-gradient(135deg, var(--ihrm-primary, #1e3a5f) 0%, var(--ihrm-primary-light, #2d4f7c) 55%, #1d4ed8 100%);
  color: #fff;
  padding: 2.5rem 0 2rem;
  position: relative;
  overflow: hidden;
}

.docs-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 15%, rgba(37, 99, 235, 0.3), transparent 45%);
  pointer-events: none;
}

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

.docs-hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.3rem 0.85rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

.docs-hero h1 {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.docs-hero p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
}

.docs-hero code {
  color: #bfdbfe;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
}

.docs-btn {
  font-weight: 600;
  border-radius: 0.375rem;
  transition: transform 0.2s;
}

.docs-btn:hover {
  transform: translateY(-2px);
}

/* Shell */
.docs-shell {
  padding: 2rem 0 3rem;
}

.docs-sidebar {
  position: sticky;
  top: 84px;
  background: var(--ihrm-surface-elevated, #fff);
  border: 1px solid var(--ihrm-border, rgba(30, 58, 95, 0.1));
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.docs-sidebar-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ihrm-text-muted, #64748b);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.docs-sidebar-link {
  display: block;
  color: var(--ihrm-text, #1e293b);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.375rem;
  margin-bottom: 0.15rem;
  transition: background 0.15s, color 0.15s;
}

.docs-sidebar-link:hover,
.docs-sidebar-link.active {
  background: var(--ihrm-accent-soft, rgba(37, 99, 235, 0.1));
  color: var(--ihrm-accent, #2563eb);
}

.docs-sidebar-divider {
  margin: 0.75rem 0;
  border-color: var(--ihrm-border, rgba(30, 58, 95, 0.1));
}

.docs-main-card {
  border-radius: 0.75rem;
  border: 1px solid var(--ihrm-border, rgba(30, 58, 95, 0.1));
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

/* Sections */
.ihrm-doc-section {
  margin-bottom: 3rem;
  scroll-margin-top: 88px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.ihrm-doc-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.ihrm-doc-section h3 {
  color: var(--ihrm-primary, #1e3a5f);
  font-weight: 700;
  font-size: 1.35rem;
  padding-bottom: 0.65rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--ihrm-accent-soft, rgba(37, 99, 235, 0.1));
}

.ihrm-doc-section h4 {
  color: var(--ihrm-primary, #1e3a5f);
  font-weight: 600;
  font-size: 1.05rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.ihrm-endpoint-card {
  background: var(--ihrm-surface, #f8fafc);
  border: 1px solid var(--ihrm-border, rgba(30, 58, 95, 0.1));
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.ihrm-endpoint-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.ihrm-endpoint-card h4 {
  margin-top: 0;
}

/* Code blocks */
.ihrm-code-block {
  position: relative;
  background: #0f172a;
  border-radius: 0.5rem;
  margin: 1rem 0;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.ihrm-code-block pre {
  margin: 0;
  padding: 1rem 3rem 1rem 1rem;
  overflow-x: auto;
}

.ihrm-code-block code {
  color: #e2e8f0;
  font-size: 0.85rem;
  font-family: ui-monospace, 'Cascadia Code', monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.ihrm-copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background 0.2s;
}

.ihrm-copy-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.ihrm-copy-btn.copied {
  background: var(--ihrm-success, #059669);
}

/* REST table */
.docs-api-table {
  background: #fff;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.docs-api-table thead th {
  background: var(--ihrm-primary, #1e3a5f);
  color: #fff;
  font-size: 0.85rem;
  border: none;
}

.docs-api-table tbody tr {
  transition: background 0.15s;
}

.docs-api-table tbody tr:hover {
  background: var(--ihrm-accent-soft, rgba(37, 99, 235, 0.08));
}

.api-method {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 0.25rem;
}

.api-method-get { background: #dbeafe; color: #1d4ed8; }
.api-method-post { background: #dcfce7; color: #166534; }

/* Footer */
.docs-footer {
  background: var(--ihrm-primary, #1e3a5f);
  color: rgba(255, 255, 255, 0.85);
  padding: 2rem 0 1.5rem;
}

.docs-footer .ihrm-ecosystem-link {
  color: rgba(255, 255, 255, 0.75);
}

.docs-footer .ihrm-ecosystem-link:hover {
  color: #93c5fd;
}

.docs-scroll-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ihrm-accent, #2563eb);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  z-index: 1050;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.docs-scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (max-width: 991px) {
  body.ihrm-docs-page { padding-top: 56px; }
  .docs-hero { padding: 1.75rem 0 1.5rem; }
}
