/* ==========================================================================
   Routing Library Documentation - Custom Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties (Variables)
   -------------------------------------------------------------------------- */
:root {
  /* Primary palette - teal/forest tones */
  --pst-color-primary: #0a5b5f;
  --pst-color-primary-light: #1a7b7f;
  --pst-color-primary-dark: #064345;

  /* Accent - warm orange */
  --pst-color-secondary: #c46a1a;
  --pst-color-accent: #e88a3a;

  /* Typography */
  --pst-font-family-base: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --pst-font-family-heading: "Space Grotesk", "Inter", -apple-system, sans-serif;
  --pst-font-family-monospace: "JetBrains Mono", "Fira Code", "SF Mono", ui-monospace, monospace;

  /* Spacing */
  --section-spacing: 3rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
}

/* Dark mode overrides */
html[data-theme="dark"] {
  --pst-color-primary: #3eb8bd;
  --pst-color-primary-light: #5ed0d5;
  --pst-color-secondary: #f5a050;
}

/* --------------------------------------------------------------------------
   Base Layout & Background
   -------------------------------------------------------------------------- */
body {
  background: linear-gradient(180deg, #f8f6f3 0%, #ffffff 100%);
}

html[data-theme="dark"] body {
  background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
}

/* --------------------------------------------------------------------------
   Navigation & Header
   -------------------------------------------------------------------------- */
.bd-header.navbar {
  background: linear-gradient(90deg,
    rgba(10, 91, 95, 0.08) 0%,
    rgba(196, 106, 26, 0.08) 100%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(10, 91, 95, 0.1);
}

html[data-theme="dark"] .bd-header.navbar {
  background: linear-gradient(90deg,
    rgba(62, 184, 189, 0.1) 0%,
    rgba(245, 160, 80, 0.1) 100%);
  border-bottom: 1px solid rgba(62, 184, 189, 0.2);
}

.navbar-brand img {
  max-height: 40px;
  transition: transform 0.2s ease;
}

.navbar-brand:hover img {
  transform: scale(1.05);
}

/* --------------------------------------------------------------------------
   Hero Section & Tagline
   -------------------------------------------------------------------------- */
.hero-tagline {
  padding: 1rem 2rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg,
    rgba(10, 91, 95, 0.03) 0%,
    rgba(196, 106, 26, 0.03) 100%);
}

/* --------------------------------------------------------------------------
   Feature Cards (Grid Items)
   -------------------------------------------------------------------------- */
.sd-card.feature-card {
  border: 1px solid rgba(10, 91, 95, 0.15);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
  transition: all 0.3s ease;
  overflow: hidden;
}

.sd-card.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--pst-color-primary);
}

html[data-theme="dark"] .sd-card.feature-card {
  background: linear-gradient(135deg, #1f1f1f 0%, #171717 100%);
  border-color: rgba(62, 184, 189, 0.2);
}

html[data-theme="dark"] .sd-card.feature-card:hover {
  border-color: var(--pst-color-primary);
}

.sd-card.feature-card .sd-card-header {
  background: linear-gradient(135deg,
    rgba(10, 91, 95, 0.05) 0%,
    rgba(196, 106, 26, 0.03) 100%);
  border-bottom: 1px solid rgba(10, 91, 95, 0.1);
  font-weight: 600;
  color: var(--pst-color-primary);
}

/* --------------------------------------------------------------------------
   Code Blocks
   -------------------------------------------------------------------------- */
pre {
  border-radius: var(--radius-md);
  border: 1px solid rgba(10, 91, 95, 0.1);
  box-shadow: var(--shadow-sm);
}

code {
  font-family: var(--pst-font-family-monospace);
  font-size: 0.9em;
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  background: rgba(10, 91, 95, 0.06);
  color: var(--pst-color-primary-dark);
}

html[data-theme="dark"] code {
  background: rgba(62, 184, 189, 0.15);
  color: var(--pst-color-primary);
}

pre code {
  background: transparent;
  padding: 0;
}

/* Syntax highlighting enhancements */
.highlight .k,
.highlight .kd,
.highlight .kn {
  color: #0a5b5f;
  font-weight: 600;
}

html[data-theme="dark"] .highlight .k,
html[data-theme="dark"] .highlight .kd,
html[data-theme="dark"] .highlight .kn {
  color: #5ed0d5;
}

.highlight .s,
.highlight .s1,
.highlight .s2 {
  color: #c46a1a;
}

html[data-theme="dark"] .highlight .s,
html[data-theme="dark"] .highlight .s1,
html[data-theme="dark"] .highlight .s2 {
  color: #f5a050;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
table {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(10, 91, 95, 0.15);
  box-shadow: var(--shadow-sm);
}

thead {
  background: linear-gradient(135deg,
    rgba(10, 91, 95, 0.08) 0%,
    rgba(10, 91, 95, 0.04) 100%);
}

th {
  font-weight: 600;
  color: var(--pst-color-primary-dark);
  border-bottom: 2px solid rgba(10, 91, 95, 0.2) !important;
}

html[data-theme="dark"] th {
  color: var(--pst-color-primary);
}

tr:hover {
  background: rgba(10, 91, 95, 0.02);
}

html[data-theme="dark"] tr:hover {
  background: rgba(62, 184, 189, 0.05);
}

/* --------------------------------------------------------------------------
   Tabs
   -------------------------------------------------------------------------- */
.sd-tab-set > input:checked + label {
  color: var(--pst-color-primary);
  border-color: var(--pst-color-primary);
  background: rgba(10, 91, 95, 0.05);
}

.sd-tab-set > label {
  font-weight: 500;
  transition: all 0.2s ease;
}

.sd-tab-set > label:hover {
  color: var(--pst-color-primary);
}

.sd-tab-content {
  border: 1px solid rgba(10, 91, 95, 0.15);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 1.25rem;
}

/* --------------------------------------------------------------------------
   Admonitions & Notes
   -------------------------------------------------------------------------- */
.admonition {
  border-radius: var(--radius-md);
  border-left-width: 4px;
  box-shadow: var(--shadow-sm);
}

.admonition.note {
  border-left-color: var(--pst-color-primary);
  background: rgba(10, 91, 95, 0.04);
}

.admonition.warning {
  border-left-color: var(--pst-color-secondary);
  background: rgba(196, 106, 26, 0.04);
}

.admonition.tip {
  border-left-color: #2a9d8f;
  background: rgba(42, 157, 143, 0.04);
}

.admonition-title {
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Sidebar Navigation
   -------------------------------------------------------------------------- */
.bd-sidebar .nav-link {
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.bd-sidebar .nav-link:hover {
  background: rgba(10, 91, 95, 0.06);
}

.bd-sidebar .nav-link.active {
  background: rgba(10, 91, 95, 0.1);
  color: var(--pst-color-primary);
  font-weight: 500;
}

/* Hide empty section navigation sidebar */
.bd-docs-nav.bd-links:has(.bd-toc-item:empty),
.bd-docs-nav.bd-links .bd-toc-item:empty {
  display: none;
}

/* Fallback for browsers without :has() support */
nav.bd-docs-nav.bd-links {
  display: none;
}
.bd-sidebar-primary{
  display: none;
}

/* --------------------------------------------------------------------------
   Section Headings
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--pst-font-family-heading);
}

h1 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-weight: 600;
  color: var(--pst-color-primary-dark);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(10, 91, 95, 0.1);
  margin-top: 2.5rem;
}

html[data-theme="dark"] h2 {
  color: var(--pst-color-primary);
  border-bottom-color: rgba(62, 184, 189, 0.2);
}

h3 {
  font-weight: 600;
  color: #374151;
}

html[data-theme="dark"] h3 {
  color: #e5e7eb;
}

/* --------------------------------------------------------------------------
   Links
   -------------------------------------------------------------------------- */
a {
  color: var(--pst-color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--pst-color-primary-light);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Horizontal Rules
   -------------------------------------------------------------------------- */
hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(10, 91, 95, 0.2) 50%,
    transparent 100%);
  margin: 2.5rem 0;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.bd-footer {
  background: linear-gradient(180deg,
    rgba(10, 91, 95, 0.03) 0%,
    rgba(10, 91, 95, 0.08) 100%);
  border-top: 1px solid rgba(10, 91, 95, 0.1);
}

/* --------------------------------------------------------------------------
   Scrollbar (Webkit)
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(10, 91, 95, 0.05);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(10, 91, 95, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(10, 91, 95, 0.35);
}

/* --------------------------------------------------------------------------
   Mobile Responsiveness
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .hero-tagline {
    padding: 0.75rem 1rem;
  }

  h2 {
    margin-top: 2rem;
  }

  .sd-card.feature-card {
    margin-bottom: 1rem;
  }
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */
@media print {
  .bd-sidebar,
  .bd-header,
  .bd-footer {
    display: none;
  }

  body {
    background: white;
  }
}
