/* ===================================
   DOCUMENTATION PAGE STYLES
   =================================== */

/* Variables */
:root {
  --docs-sidebar-width: 280px;
  --docs-header-height: 70px;
  --docs-primary: #667eea;
  --docs-primary-light: rgba(102, 126, 234, 0.1);
  --docs-text: #e9edff;
  --docs-text-muted: #a0aec0;
  --docs-bg: #070b13;
  --docs-bg-secondary: #0f1419;
  --docs-border: rgba(255, 255, 255, 0.12);
  --docs-hover: rgba(255, 255, 255, 0.05);
}

/* Base */
.docs-page {
  background: var(--docs-bg);
  color: var(--docs-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* Header */
.docs-header {
  background: var(--docs-bg-secondary);
  border-bottom: 1px solid var(--docs-border);
  height: calc(var(--docs-header-height) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  box-sizing: border-box;
}

.docs-header .container {
  max-width: 100%;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.docs-logo {
  font-size: 24px;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-logo-img {
  display: inline-block;
  height: clamp(24px, 3vw, 32px);
  max-height: 32px;
  width: auto;
}

.docs-nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

.docs-nav a {
  color: var(--docs-text);
  text-decoration: none;
  font-size: 15px;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.docs-nav a:hover {
  opacity: 1;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  background: transparent;
  color: var(--docs-text);
  border: none;
  padding: 8px;
  border-radius: 8px;
  font-size: 24px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.mobile-menu-toggle:hover {
  opacity: 0.7;
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }
}

/* Container */
.docs-container {
  display: flex;
  position: absolute;
  top: calc(var(--docs-header-height) + env(safe-area-inset-top, 0px));
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}

/* Sidebar */
.docs-sidebar {
  width: var(--docs-sidebar-width);
  min-width: var(--docs-sidebar-width);
  background: var(--docs-bg-secondary);
  border-right: 1px solid var(--docs-border);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  z-index: 50;
}

.sidebar-content {
  padding: 24px 16px;
}

.sidebar-content h2 {
  font-size: 20px;
  margin: 0 0 20px 12px;
  color: #ff7f50 !important;
  background: none !important;
  background-clip: initial !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: #ff7f50 !important;
  font-weight: 700;
}

/* Sidebar Navigation */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section {
  margin-bottom: 20px;
}

.nav-section h3 {
  font-size: 13px;
  font-weight: 700;
  color: #ff7f50 !important;
  background: none !important;
  background-clip: initial !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: #ff7f50 !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 8px 12px;
}

.sidebar-nav a {
  display: block;
  padding: 10px 12px;
  color: var(--docs-text);
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
  opacity: 0.85;
}

.sidebar-nav a:hover {
  background: var(--docs-hover);
  opacity: 1;
}

.sidebar-nav a.active {
  background: var(--docs-primary-light);
  color: var(--docs-primary);
  opacity: 1;
  font-weight: 600;
}

/* Main Content */
.docs-main {
  flex: 1;
  overflow-y: scroll;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.docs-main-inner {
  min-height: 100%;
  padding: 40px;
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* Sections */
.doc-section {
  display: none;
  max-width: 900px;
  animation: fadeIn 0.3s ease;
}

.doc-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Typography */
.doc-section h1 {
  font-size: 36px;
  font-weight: 800;
  margin: 0 0 16px 0;
  color: #ff7f50 !important;
  background: none !important;
  background-clip: initial !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: #ff7f50 !important;
  line-height: 1.2;
}

.doc-section h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 40px 0 16px 0;
  color: #ff7f50 !important;
  background: none !important;
  background-clip: initial !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: #ff7f50 !important;
  padding-top: 16px;
  border-top: 1px solid var(--docs-border);
}

.doc-section h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 24px;
}

.doc-section h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 24px 0 12px 0;
  color: #ff7f50 !important;
  background: none !important;
  background-clip: initial !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: #ff7f50 !important;
}

.doc-section p {
  font-size: 16px;
  line-height: 1.7;
  margin: 0 0 16px 0;
  color: var(--docs-text);
  opacity: 0.95;
}

.doc-section .lead {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 24px;
  opacity: 0.9;
}

.doc-section ul,
.doc-section ol {
  margin: 0 0 20px 0;
  padding-left: 24px;
  line-height: 1.8;
}

.doc-section li {
  margin-bottom: 8px;
  opacity: 0.95;
}

.doc-section strong {
  font-weight: 700;
  color: var(--docs-text);
}

.doc-section code {
  background: rgba(102, 126, 234, 0.15);
  color: var(--docs-primary);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 14px;
  font-family: 'Monaco', 'Courier New', monospace;
}

/* Info Boxes */
.info-box,
.warning-box,
.option-box {
  padding: 16px 20px;
  border-radius: 12px;
  margin: 24px 0;
  border-left: 4px solid;
}

.info-box {
  background: rgba(66, 153, 225, 0.1);
  border-left-color: #4299e1;
}

.warning-box {
  background: rgba(245, 101, 101, 0.1);
  border-left-color: #f56565;
}

.option-box {
  background: var(--docs-primary-light);
  border-left-color: var(--docs-primary);
}

.info-box strong,
.warning-box strong,
.option-box strong {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
}

.info-box p,
.warning-box p,
.option-box p {
  margin-bottom: 8px;
}

.info-box ul,
.warning-box ul,
.option-box ul {
  margin-bottom: 0;
}

/* Examples Box */
.examples-box {
  background: var(--docs-bg-secondary);
  border: 1px solid var(--docs-border);
  border-radius: 12px;
  padding: 20px;
  margin: 24px 0;
}

.examples-box p {
  margin-bottom: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border-left: 3px solid var(--docs-primary);
}

.examples-box p:last-child {
  margin-bottom: 0;
}

/* Tables */
.limits-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  background: var(--docs-bg-secondary);
  border-radius: 12px;
  overflow: hidden;
}

.limits-table th,
.limits-table td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--docs-border);
}

.limits-table th {
  background: rgba(102, 126, 234, 0.15);
  font-weight: 700;
  color: var(--docs-text);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.limits-table tr:hover {
  background: var(--docs-hover);
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.feature-card {
  background: var(--docs-bg-secondary);
  border: 1px solid var(--docs-border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--docs-primary);
}

.feature-card h3 {
  font-size: 18px;
  margin: 0 0 8px 0;
  color: #ff7f50 !important;
  background: none !important;
  background-clip: initial !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: #ff7f50 !important;
}

.feature-card p {
  font-size: 14px;
  margin: 0;
  opacity: 0.8;
}

/* Pricing Grid */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin: 32px 0;
}

.pricing-card {
  background: var(--docs-bg-secondary);
  border: 2px solid var(--docs-border);
  border-radius: 16px;
  padding: 28px 24px;
  transition: transform 0.2s, border-color 0.2s;
}

.pricing-card:hover {
  transform: translateY(-6px);
  border-color: var(--docs-primary);
}

.pricing-card.featured {
  border-color: var(--docs-primary);
  background: var(--docs-primary-light);
  position: relative;
}

.pricing-card.featured::before {
  content: 'Populaire';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--docs-primary);
  color: white;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pricing-card h3 {
  font-size: 24px;
  margin: 0 0 12px 0;
  text-align: center;
  color: #ff7f50 !important;
  background: none !important;
  background-clip: initial !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: #ff7f50 !important;
}

.pricing-card .price {
  font-size: 40px;
  font-weight: 800;
  text-align: center;
  margin: 0 0 24px 0;
  color: var(--docs-primary);
}

.pricing-card .price span {
  font-size: 18px;
  font-weight: 400;
  opacity: 0.7;
}

.pricing-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pricing-card li {
  padding: 10px 0;
  font-size: 15px;
  border-bottom: 1px solid var(--docs-border);
}

.pricing-card li:last-child {
  border-bottom: none;
}

/* FAQ Items */
.faq-item {
  background: var(--docs-bg-secondary);
  border: 1px solid var(--docs-border);
  border-radius: 12px;
  padding: 24px;
  margin: 20px 0;
}

.faq-item h3 {
  margin-top: 0;
  color: #ff7f50 !important;
  background: none !important;
  background-clip: initial !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: #ff7f50 !important;
  font-size: 18px;
}

.faq-item p {
  margin-bottom: 0;
}

/* Footer */
.docs-footer {
  background: var(--docs-bg-secondary);
  border-top: 1px solid var(--docs-border);
  padding: 24px 0;
  margin-left: var(--docs-sidebar-width);
}

/* Footer inline (sticky footer behavior) */
.docs-footer.docs-footer-inline {
  margin-left: 0;
  margin-top: auto;
  border-radius: 12px;
  flex-shrink: 0;
}

.docs-footer .container {
  max-width: 900px;
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.docs-footer-inline .container {
  padding: 0 20px;
  flex-direction: column;
  text-align: center;
}

.docs-footer p {
  margin: 0;
  color: var(--docs-text-muted);
  font-size: 14px;
}

.docs-footer-inline p {
  margin-top: 16px;
}

.footer-nav {
  display: flex;
  gap: 20px;
}

.footer-nav a {
  color: var(--docs-text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.footer-nav a:hover {
  color: var(--docs-text);
}

/* Responsive */
@media (max-width: 768px) {
  .docs-sidebar {
    position: fixed;
    top: calc(var(--docs-header-height) + env(safe-area-inset-top, 0px));
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .docs-sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  }

  .docs-main {
    margin-left: 0;
    max-width: 100%;
  }

  .docs-main-inner {
    padding: 24px 20px;
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  }

  .docs-footer {
    margin-left: 0;
  }

  .docs-footer:not(.docs-footer-inline) .container {
    padding: 0 20px;
    flex-direction: column-reverse;
    text-align: center;
  }

  .footer-nav {
    flex-direction: column;
    gap: 12px;
  }

  .doc-section h1 {
    font-size: 28px;
  }

  .doc-section h2 {
    font-size: 22px;
  }

  .doc-section h3 {
    font-size: 18px;
  }

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

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

/* Scrollbar */
.docs-sidebar::-webkit-scrollbar,
.docs-main::-webkit-scrollbar {
  width: 8px;
}

.docs-sidebar::-webkit-scrollbar-track,
.docs-main::-webkit-scrollbar-track {
  background: transparent;
}

.docs-sidebar::-webkit-scrollbar-thumb,
.docs-main::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.docs-sidebar::-webkit-scrollbar-thumb:hover,
.docs-main::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Print Styles */
@media print {
  .docs-header,
  .docs-sidebar,
  .docs-footer,
  .mobile-menu-toggle {
    display: none;
  }

  .docs-container {
    margin-top: 0;
  }

  .docs-main {
    margin-left: 0;
    max-width: 100%;
    height: auto;
    overflow: visible;
  }

  .doc-section {
    display: block !important;
    page-break-after: always;
  }
}
