/* Piaxis API Documentation Custom Styles */

/* Brand colors */
:root {
  --piaxis-primary: #2980b9;
  --piaxis-secondary: #27ae60;
  --piaxis-accent: hsl(6, 78%, 57%);
  --piaxis-light: #ecf0f1;
  --piaxis-dark: #2c3e50;
}

/* Improve code blocks */
.highlight {
  border-radius: 4px;
  border-left: 4px solid var(--piaxis-primary);
  margin: 1em 0;
}

/* Better API endpoint styling */
.http-method {
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 3px;
  color: white;
  font-size: 0.8em;
  margin-right: 8px;
}

.http-get {
  background-color: #2196f3;
}
.http-post {
  background-color: #4caf50;
}
.http-put {
  background-color: #ff9800;
}
.http-delete {
  background-color: #f44336;
}

/* Improve parameter tables */
.docutils th {
  background-color: var(--piaxis-primary) !important;
  color: white !important;
  font-weight: 600;
}

.docutils td, .docutils th {
  padding: 8px 12px !important;
  border: 1px solid #ddd !important;
}

/* Better response examples */
.admonition {
  border-radius: 4px;
  border-left: 4px solid var(--piaxis-secondary);
  background-color: #f8f9fa;
}

.admonition-title {
  background-color: var(--piaxis-secondary) !important;
  color: white !important;
  margin: -12px -12px 12px -12px !important;
  padding: 8px 12px !important;
  font-weight: 600;
}

/* API status codes */
.status-200 { color: #4caf50; font-weight: bold; }
.status-400 { color: #ff9800; font-weight: bold; }
.status-401 { color: #f44336; font-weight: bold; }
.status-500 { color: #9c27b0; font-weight: bold; }

/* Navigation improvements */
.wy-nav-side {
  background: linear-gradient(180deg, var(--piaxis-primary) 0%, var(--piaxis-dark) 100%);
}

.wy-menu-vertical a {
  color: rgba(255, 255, 255, 0.9);
}

.wy-menu-vertical a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  /* Make tables responsive */
  .wy-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .wy-table-responsive table {
    font-size: 0.85em;
    min-width: 600px;
  }

  /* Adjust code blocks for mobile */
  .highlight {
    font-size: 0.8em;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Make navigation more touch-friendly */
  .wy-menu-vertical li.toctree-l1 > a {
    padding: 12px 16px;
    font-size: 1.1em;
  }

  /* Improve readability on small screens */
  .rst-content {
    font-size: 16px;
    line-height: 1.6;
  }

  /* Better spacing for mobile */
  .rst-content .section {
    padding: 0 10px;
  }

  /* Responsive images */
  .rst-content img {
    max-width: 100%;
    height: auto;
  }
}

@media (max-width: 480px) {
  /* Extra small screens */
  .wy-table-responsive table {
    font-size: 0.75em;
  }

  .highlight {
    font-size: 0.75em;
  }

  .rst-content {
    font-size: 14px;
  }

  /* Compact headers on mobile */
  .rst-content h1 {
    font-size: 1.8em;
  }

  .rst-content h2 {
    font-size: 1.5em;
  }

  .rst-content h3 {
    font-size: 1.3em;
  }
}

/* Desktop and large screen optimizations - Fix width constraint issue */
@media (min-width: 769px) {
  /* Remove default max-width constraints from Read the Docs theme */
  .wy-nav-content {
    max-width: none !important;
    margin-left: 300px;
    padding-right: 20px;
  }

  .wy-nav-content-wrap {
    margin-left: 300px;
    background: white;
  }

  .wy-nav-side {
    width: 280px;
  }

  /* Ensure content uses full available width */
  .rst-content {
    max-width: none !important;
    width: 100%;
  }

  /* Make sure tables and code blocks use available space efficiently */
  .wy-table-responsive {
    margin-left: 0;
    margin-right: 0;
  }

  .highlight {
    margin-left: 0;
    margin-right: 0;
  }
}

/* Extra large screens - optimize for wide displays */
@media (min-width: 1200px) {
  .wy-nav-content {
    padding-right: 40px;
  }

  /* Allow wider content on very large screens but maintain readability */
  .rst-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
  }
}

/* Ultra-wide screens - prevent content from becoming too wide */
@media (min-width: 1600px) {
  .rst-content {
    max-width: 1600px;
    padding: 0 40px;
  }
}

/* Print styles */
@media print {
  .wy-nav-side,
  .wy-nav-top,
  .rst-versions {
    display: none !important;
  }

  .wy-nav-content {
    margin-left: 0 !important;
  }

  .highlight {
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }
}

/* Better JSON/code formatting */
.highlight-json .highlight {
  background-color: #f8f8f8;
  border: 1px solid #e1e4e8;
}

.highlight-bash .highlight {
  background-color: #2d3748;
  color: #e2e8f0;
  border-left: 4px solid var(--piaxis-accent);
}

/* Enhance version selector */
.rst-versions {
  border-top: 2px solid var(--piaxis-primary);
}

.rst-versions .rst-current-version {
  background-color: var(--piaxis-primary);
}

/* Focus improvements for accessibility */
a:focus,
button:focus,
input:focus {
  outline: 2px solid var(--piaxis-secondary);
  outline-offset: 2px;
}

/* Better loading states */
.wy-nav-content-wrap {
  transition: margin-left 0.3s ease;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--piaxis-primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--piaxis-dark);
}
