/* VoteGuard Docs — Light Grey Professional Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Fira+Code:wght@400;500&display=swap');

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

:root {
  --bg-page: #f0f2f5;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-code: #1e2030;
  --border: #e2e5eb;
  --border-hover: #cbd0d8;
  --text-primary: #1a1d2d;
  --text-secondary: #4a5068;
  --text-muted: #8490a5;
  --accent: #4f46e5;
  --accent-light: #ede9fe;
  --accent-lighter: #f5f3ff;
  --accent-text: #4338ca;
  --green: #059669;
  --blue: #3b82f6;
  --purple: #7c3aed;
  --red: #dc2626;
  --amber: #d97706;
  --get: #059669;
  --post: #3b82f6;
  --put: #7c3aed;
  --delete: #dc2626;
  --sidebar-w: 272px;
  --radius: 12px;
  --radius-sm: 8px;
  --ease: 0.2s ease;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── PAGE LAYOUT ─── */
.docs-page {
  min-height: 100vh;
  display: flex;
  background:
    radial-gradient(ellipse 60% 50% at 0% 0%, rgba(79, 70, 229, 0.06), transparent 60%),
    radial-gradient(ellipse 50% 50% at 100% 100%, rgba(59, 130, 246, 0.05), transparent 55%),
    radial-gradient(ellipse 40% 40% at 50% 50%, rgba(124, 58, 237, 0.03), transparent 50%),
    var(--bg-page);
  background-attachment: fixed;
}

.docs-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, #d1d5db 0.6px, transparent 0.6px);
  background-size: 28px 28px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

/* hide dark-theme orbs */
.glow-orb {
  display: none;
}

/* ─── SIDEBAR ─── */
.docs-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 100;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
}

.docs-sidebar::-webkit-scrollbar {
  width: 4px;
}

.docs-sidebar::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

.docs-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-primary);
  background: var(--accent-lighter);
  border: 1px solid #e0ddf7;
  border-radius: var(--radius);
  transition: var(--ease);
}

.docs-logo:hover {
  background: var(--accent-light);
  border-color: #c7c2f0;
  box-shadow: var(--shadow-sm);
}

.docs-logo span {
  font-size: 1.35rem;
}

.docs-nav-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--text-muted);
  padding: 18px 12px 6px;
}

.docs-nav-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  font-size: 0.84rem;
  font-weight: 460;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: var(--ease);
  cursor: pointer;
  margin-bottom: 1px;
  position: relative;
}

.docs-nav-item:hover {
  color: var(--text-primary);
  background: #f5f6f8;
}

.docs-nav-item.active {
  color: var(--accent);
  background: var(--accent-lighter);
  border-color: #e0ddf7;
  font-weight: 560;
}

.docs-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 55%;
  background: var(--accent);
  border-radius: 0 4px 4px 0;
}

/* ─── MAIN CONTENT ─── */
.docs-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 36px 60px 80px;
  max-width: 1100px;
  margin-right: auto;
  position: relative;
  z-index: 1;
}

/* ─── HERO ─── */
.docs-hero {
  position: relative;
  border-radius: 16px;
  padding: 48px 44px;
  margin-bottom: 40px;
  overflow: hidden;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 40%, #3b82f6 100%);
  box-shadow: 0 8px 32px rgba(79, 70, 229, 0.22), var(--shadow);
}

.docs-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(255, 255, 255, 0.12), transparent 55%),
    radial-gradient(ellipse at 80% 80%, rgba(255, 255, 255, 0.08), transparent 55%);
}

.docs-hero canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.docs-hero h1 {
  font-size: 2.3rem;
  font-weight: 800;
  margin: 0 0 10px;
  position: relative;
  z-index: 2;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.docs-hero p {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  line-height: 1.7;
  position: relative;
  z-index: 2;
  max-width: 560px;
}

/* ─── SECTIONS ─── */
.docs-section {
  margin-bottom: 40px;
  scroll-margin-top: 24px;
}

.docs-section.reveal {
  animation: riseIn 0.5s ease-out both;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.docs-section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.docs-section h3 {
  font-size: 1.02rem;
  font-weight: 600;
  margin: 24px 0 10px;
  color: var(--text-primary);
}

/* ─── CARDS ─── */
.docs-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  transition: var(--ease);
}

.docs-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-hover);
}

.docs-card p,
.docs-card li {
  font-size: 0.91rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

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

.docs-card a {
  color: var(--accent);
  text-decoration: none;
}

.docs-card a:hover {
  text-decoration: underline;
}

.docs-card ul,
.docs-card ol {
  padding-left: 20px;
  margin: 8px 0;
}

/* ─── CODE BLOCKS ─── */
.docs-code-block {
  background: var(--bg-code);
  border: 1px solid #2a2d42;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 12px 0;
  box-shadow: var(--shadow-sm);
}

.docs-code-label {
  font-family: 'Fira Code', monospace;
  font-size: 0.6rem;
  color: #6b7294;
  padding: 10px 16px 0;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 500;
}

.docs-code-block pre {
  margin: 0;
  padding: 12px 16px 14px;
  font-family: 'Fira Code', monospace;
  font-size: 0.82rem;
  line-height: 1.65;
  color: #d4d7ed;
  white-space: pre;
}

code:not(pre code) {
  font-family: 'Fira Code', monospace;
  font-size: 0.8em;
  background: var(--accent-lighter);
  border: 1px solid #e0ddf7;
  color: var(--accent-text);
  padding: 2px 7px;
  border-radius: 5px;
}

/* ─── METHOD BADGES ─── */
.method-badge {
  display: inline-block;
  font-family: 'Fira Code', monospace;
  font-size: 0.63rem;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 52px;
  text-align: center;
  color: #fff;
}

.method-badge.get {
  background: var(--get);
}

.method-badge.post {
  background: var(--post);
}

.method-badge.put {
  background: var(--put);
}

.method-badge.delete {
  background: var(--delete);
}

/* ─── API ENDPOINT CARDS ─── */
.api-endpoint {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
  transition: var(--ease);
  box-shadow: var(--shadow-sm);
}

.api-endpoint:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-hover);
}

.api-endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--ease);
}

.api-endpoint-header:hover {
  background: #f9fafb;
}

.api-endpoint-path {
  font-family: 'Fira Code', monospace;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-primary);
}

.api-endpoint-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: auto;
}

.api-endpoint-body {
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  background: #fafbfc;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.api-auth-badge {
  font-size: 0.58rem;
  font-weight: 650;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.api-auth-badge.required {
  background: #fef2f2;
  color: var(--delete);
  border: 1px solid #fecaca;
}

.api-auth-badge.admin {
  background: #f5f3ff;
  color: var(--put);
  border: 1px solid #ddd6fe;
}

.api-auth-badge.public {
  background: #ecfdf5;
  color: var(--get);
  border: 1px solid #a7f3d0;
}

/* ─── FEATURE GRID ─── */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.docs-grid-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: var(--ease);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.docs-grid-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--purple), var(--blue));
  opacity: 0;
  transition: var(--ease);
}

.docs-grid-item:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.docs-grid-item:hover::before {
  opacity: 1;
}

.docs-grid-item .icon {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.docs-grid-item h4 {
  font-size: 0.92rem;
  font-weight: 600;
  margin: 0 0 5px;
  color: var(--text-primary);
}

.docs-grid-item p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.55;
}

/* ─── TABLES ─── */
.docs-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 12px 0;
  font-size: 0.88rem;
}

.docs-table th {
  background: #f8f9fb;
  color: var(--text-primary);
  font-weight: 600;
  padding: 12px 16px;
  text-align: left;
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid var(--border);
}

.docs-table td {
  padding: 11px 16px;
  border-bottom: 1px solid #f0f1f3;
  color: var(--text-secondary);
}

.docs-table td strong {
  color: var(--text-primary);
}

.docs-table td code {
  font-size: 0.78em;
}

.docs-table td a {
  color: var(--accent);
  text-decoration: none;
}

.docs-table td a:hover {
  text-decoration: underline;
}

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

.docs-table tr:hover td {
  background: #f9fafb;
}

/* ─── ALERTS ─── */
.docs-alert {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  margin: 14px 0;
  font-size: 0.88rem;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

.docs-alert strong {
  color: var(--text-primary);
}

.docs-alert.info {
  border-left: 4px solid var(--blue);
  background: #eff6ff;
}

.docs-alert.warning {
  border-left: 4px solid var(--amber);
  background: #fffbeb;
}

.docs-alert.danger {
  border-left: 4px solid var(--red);
  background: #fef2f2;
}

.docs-alert.tip {
  border-left: 4px solid var(--green);
  background: #ecfdf5;
}

/* ─── MOBILE HAMBURGER ─── */
.docs-hamburger {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transition: var(--ease);
}

.docs-hamburger:hover {
  box-shadow: var(--shadow);
}

.docs-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
  z-index: 90;
}

/* ─── FOOTER ─── */
.docs-footer {
  text-align: center;
  padding: 40px 0 24px;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}

.docs-footer strong {
  color: var(--text-secondary);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .docs-hamburger {
    display: flex;
  }

  .docs-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: none;
  }

  .docs-sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.1);
  }

  .docs-overlay.open {
    display: block;
  }

  .docs-main {
    margin-left: 0;
    padding: 60px 20px 80px;
  }

  .docs-hero {
    padding: 32px 22px;
  }

  .docs-hero h1 {
    font-size: 1.6rem;
  }

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

  .api-endpoint-desc {
    display: none;
  }

  .docs-card {
    padding: 18px;
  }
}

/* ─── SELECTION ─── */
::selection {
  background: rgba(79, 70, 229, 0.15);
  color: var(--text-primary);
}

/* ─── LINKS ─── */
a {
  color: var(--accent);
  transition: var(--ease);
}

a:hover {
  color: var(--accent-text);
}