/* API Documentation Styles - CSS Grid Approach */

/* Main Grid Container */
.api-grid,
.docs-wrapper,
.api-container {
  display: grid;
  grid-template-columns: 280px 1fr 250px;
  grid-template-areas: "sidebar main toc";
  min-height: calc(100vh - 120px);
  background: var(--bg-color);
  color: var(--text-color);
  font-family: 'Poppins', sans-serif;
  line-height: 1.4;
  gap: 0;
}

/* Left Sidebar Navigation */
.left-sidebar {
  grid-area: sidebar;
  background: transparent;
  position: sticky;
  top: 100px;
  height: calc(100vh - 80px);
  overflow-y: auto;
  padding: 1.5rem 0;
  z-index: 10;
}

/* Main Content Area */
.main-content {
  grid-area: main;
  padding: 2rem 3rem;
  overflow-x: hidden;
  min-width: 0;
}

/* Right Sidebar - Table of Contents */
.right-sidebar {
  grid-area: toc;
  background: transparent;
  position: sticky;
  top: 100px;
  height: calc(100vh - 80px);
  overflow-y: auto;
  padding: 1.5rem 0;
}

/* Sidebar Content */
.sidebar-content {
  padding: 0 1.5rem;
}

/* Table of Contents Styles */
.toc-content {
  padding: 0 0.5rem 0rem 0rem; 
}

.toc-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-color);
  opacity: 0.8;
  margin-bottom: 1rem;
  padding: 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.toc-header i {
  color: var(--accent);
  font-size: 0.8rem;
}

.toc-nav ul ul {
  margin-left: 0.5rem !important;
  margin-top: 1rem !important;
  margin-bottom: 0.5rem !important;
  display: flex !important;
  flex-direction: column !important;
}

/*Spacing between content in the rightside bar*/

.toc-nav li {
  margin-top:  0rem !important;
  margin-bottom: 0rem !important;
  display: block !important;
  width: 100% !important;
}

.toc-link {
  display: block !important;
  padding: 0.35rem 0.5rem;
  color: var(--text-color);
  text-decoration: none;
  border-radius: 5px;
  font-size: 0.85rem;
  line-height: 1.2;
  transition: all 0.2s ease;
  opacity: 0.8;
  width: 100% !important;
  box-sizing: border-box !important;
}

.toc-link:hover {
  background: rgba(0, 123, 255, 0.1);
  color: var(--accent);
  opacity: 1;
}

.toc-link.active {
  border-left: 3px solid var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
  padding-left: 0.25rem; /* adjust because of the border */
}

.toc-nav ul ul .toc-link {
  font-size: 0.75rem;
  opacity: 0.7;
  line-height: 0px;
  margin: 0px;
  padding: 0rem 0rem 0rem 0.5rem;
}

.toc-nav ul ul .toc-link:hover {
  opacity: 1;
}

.api-title {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color, #e1e1e1);
  padding-bottom: 1rem;
}

.api-title h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.api-title p {
  font-size: 0.75rem;
  color: var(--text-color);
  opacity: 0.7;
  margin: 0;
}

/* Navigation Styles */
.api-nav {
  padding: 0 !important;
}

.api-nav ul {
  list-style: none !important;
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
  padding-left: 1rem !important;
}

.api-nav li {
  margin-top: 0 !important;
  padding: 0 !important;
}

.api-nav ul ul {
  margin: 0 !important;
  padding: 0 !important;
}

.nav-section {
  margin-bottom: 0.8rem !important;
  display: block !important;
}

.nav-section > h3 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-color);
  opacity: 0.6;
  margin-top: 0rem;
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
  display: block !important;
}

.nav-section ul {
  margin-left: 1 !important;
  display: flex !important;
  flex-direction: column !important;
}

.nav-section li {
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.nav-link {
  display: block !important;
  padding-top: 0.1rem !important;    /* cut vertical padding in half */
  padding-bottom: 0.1rem !important; /* same here */
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
  font-size: 0.9rem !important;        /* optional—smaller font */
  line-height: 1.8rem !important;         /* tighter spacing between lines */
  margin-bottom: 0 !important;        /* remove extra margin */
  border-radius: 5px;
  color: var(--text-color);
  text-decoration: none;
  font-weight: 400;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  width: 100% !important;
  box-sizing: border-box !important;
}

.nav-link:hover {
  background: rgba(0, 123, 255, 0.1);
  color: var(--accent);
  transform: translateX(4px);
}

.nav-link.active {
  background: var(--accent);
  color: white;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

/* Legacy class support - redirect to new classes */
.api-content,
.docs-content {
  grid-area: main;
  padding: 2rem 3rem;
  overflow-x: hidden;
  min-width: 0;
}

.api-sidebar,
.docs-sidebar {
  grid-area: sidebar;
  background: var(--card-bg);
  border-right: 1px solid var(--border-color, #e1e1e1);
  position: sticky;
  top: 80px;
  height: calc(100vh - 80px);
  overflow-y: auto;
  padding: 1.5rem 0;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.docs-toc {
  grid-area: toc;
  background: var(--card-bg);
  border-left: 1px solid var(--border-color, #e1e1e1);
  position: sticky;
  top: 80px;
  height: calc(100vh - 80px);
  overflow-y: auto;
  padding: 1.5rem 0;
}

.api-section {
  margin-bottom: 4rem;
  scroll-margin-top: 100px;
}

.section-header {
  margin-bottom: 2rem;
}

.section-header h1 {
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  line-height: 1.2;
}

.section-header h2 i {
  color: var(--accent);
  font-size: 1.8rem;
}

.section-description {
  font-size: 1.1rem;
  color: var(--text-color);
  opacity: 0.8;
  margin: 0;
  max-width: 800px;
}

/* Info Cards */
.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.info-card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--border-color, #e1e1e1);
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.info-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-color: var(--accent);
}

.card-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--accent), #66ccff);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.5rem;
  color: white;
}

.info-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.info-card p {
  color: var(--text-color);
  opacity: 0.7;
  margin: 0;
}

/* API Overview */
.api-overview {
  margin: 3rem 0;
}

.api-overview h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 1rem;
}

.code-block {
  background: var(--card-bg);
  border: 1px solid var(--border-color, #e1e1e1);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow-x: auto;
}

.code-block code {
  color: var(--accent);
  font-weight: 500;
}

.copy-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  margin-left: 1rem;
  flex-shrink: 0;
}

.copy-btn:hover {
  background: #0056b3;
  transform: scale(1.05);
}

/* Authentication Methods */
.auth-methods {
  margin: 2rem 0;
}

.auth-method {
  background: var(--card-bg);
  border: 1px solid var(--border-color, #e1e1e1);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.auth-method h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 1rem;
}

.auth-method p {
  color: var(--text-color);
  opacity: 0.8;
  margin-bottom: 1.5rem;
}

/* Code Examples */
.code-example {
  background: var(--card-bg);
  border: 1px solid var(--border-color, #e1e1e1);
  border-radius: 8px;
  overflow: hidden;
  margin: 1.5rem 0;
}

.code-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid var(--border-color, #e1e1e1);
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 0.75rem 1.5rem;
  color: var(--text-color);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.tab-btn:hover {
  background: rgba(0, 123, 255, 0.1);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(0, 123, 255, 0.1);
}

.code-content {
  display: none;
  padding: 1.5rem;
}

.code-content.active {
  display: block;
}

.code-content pre {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  overflow-x: auto;
}

.code-content code {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Quick Start Steps */
.quick-start-steps {
  margin: 2rem 0;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 3rem;
  padding: 2rem;
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border-color, #e1e1e1);
  position: relative;
}

.step-number {
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.step-content h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.75rem;
}

.step-content p {
  color: var(--text-color);
  opacity: 0.8;
  margin-bottom: 1rem;
}

/* Endpoints */
.endpoints {
  margin: 2rem 0;
}

.endpoint {
  background: var(--card-bg);
  border: 1px solid var(--border-color, #e1e1e1);
  border-radius: 12px;
  margin-bottom: 2rem;
  overflow: hidden;
}

.endpoint-header {
  background: rgba(0, 123, 255, 0.05);
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color, #e1e1e1);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.method {
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 60px;
  text-align: center;
}

.method.get {
  background: #28a745;
  color: white;
}

.method.post {
  background: #007bff;
  color: white;
}

.method.put {
  background: #ffc107;
  color: #212529;
}

.method.delete {
  background: #dc3545;
  color: white;
}

.path {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-color);
}

.description {
  color: var(--text-color);
  opacity: 0.7;
  margin-left: auto;
  font-style: italic;
}

.endpoint-details {
  padding: 2rem;
}

.endpoint-details h4 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 1rem;
  margin-top: 2rem;
}

.endpoint-details h4:first-child {
  margin-top: 0;
}

/* Parameters Table */
.params-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: var(--bg-color);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color, #e1e1e1);
}

.params-table th,
.params-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color, #e1e1e1);
}

.params-table th {
  background: rgba(0, 123, 255, 0.05);
  font-weight: 600;
  color: var(--text-color);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.params-table td {
  color: var(--text-color);
  font-size: 0.9rem;
}

.params-table td code {
  background: rgba(0, 123, 255, 0.1);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.8rem;
  color: var(--accent);
}

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

/* Error Codes */
.error-codes {
  display: grid;
  gap: 1.5rem;
  margin: 2rem 0;
}

.error-code {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color, #e1e1e1);
}

.status-code {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
  flex-shrink: 0;
}

.error-400 {
  background: #ffc107;
}

.error-401 {
  background: #dc3545;
}

.error-429 {
  background: #fd7e14;
}

.error-details h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.error-details p {
  color: var(--text-color);
  opacity: 0.8;
  margin: 0;
  font-size: 0.9rem;
}

/* Support Grid */
.support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.support-item {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--border-color, #e1e1e1);
  text-align: center;
  transition: all 0.3s ease;
}

.support-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-color: var(--accent);
}

.support-item i {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.support-item h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.support-item p {
  color: var(--text-color);
  opacity: 0.7;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.support-item a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.support-item a:hover {
  border-bottom-color: var(--accent);
}

/* CTA Button */
.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--accent), #66ccff);
  color: white;
  padding: 1rem 2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
  text-decoration: none;
  color: white;
}

.cta-button i {
  transition: transform 0.3s ease;
}

.cta-button:hover i {
  transform: translateX(4px);
}

/* Dark Mode Specific Styles */
body.dark-mode {
  --border-color: #333;
}

body.dark-mode .api-sidebar {
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode .code-tabs {
  background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .tab-btn:hover {
  background: rgba(102, 204, 255, 0.1);
}

body.dark-mode .tab-btn.active {
  background: rgba(102, 204, 255, 0.2);
}

body.dark-mode .endpoint-header {
  background: rgba(102, 204, 255, 0.1);
}

body.dark-mode .params-table th {
  background: rgba(102, 204, 255, 0.1);
}

/* Responsive Design for CSS Grid Layout */

/* Large screens - Full three-column layout */
@media (min-width: 1200px) {
  .api-grid {
    max-width: 1400px;
    margin: 0 auto;
  }
}

/* Medium screens - Hide right sidebar, keep left sidebar */
@media (max-width: 1199px) and (min-width: 769px) {
  .api-grid {
    grid-template-columns: 260px 1fr;
    grid-template-areas: "sidebar main";
  }
  
  .right-sidebar {
    display: none;
  }
  
  .main-content {
    padding: 2rem;
  }
}

/* Tablet - Smaller left sidebar, no right sidebar */
@media (max-width: 768px) and (min-width: 641px) {
  .api-grid {
    grid-template-columns: 240px 1fr;
    grid-template-areas: "sidebar main";
  }
  
  .right-sidebar {
    display: none;
  }
  
  .main-content {
    padding: 1.5rem;
  }
}

/* Mobile - Stack everything vertically */
@media (max-width: 640px) {
  .api-grid {
    grid-template-columns: 1fr;
    grid-template-areas: 
      "main"
      "sidebar";
  }
  
  .left-sidebar {
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border-color, #e1e1e1);
    margin-top: 1rem;
  }
  
  .right-sidebar {
    display: none;
  }
  
  .main-content {
    padding: 1rem;
  }
  
  .section-header h1 {
    font-size: 2rem;
  }
  
  .section-header h2 {
    font-size: 1.6rem;
  }
}

  .api-content {
    padding: 1rem;
  }
  
  .step {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .endpoint-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .description {
    margin-left: 0;
  }
  
  .info-cards {
    grid-template-columns: 1fr;
  }
  
  .support-grid {
    grid-template-columns: 1fr;
  }
  
  .params-table {
    font-size: 0.8rem;
  }
  
  .params-table th,
  .params-table td {
    padding: 0.75rem 0.5rem;
  }

@media (max-width: 480px) {
  .section-header h1 {
    font-size: 1.8rem;
  }
  
  .section-header h2 {
    font-size: 1.4rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .code-tabs {
    flex-wrap: wrap;
  }
  
  .tab-btn {
    flex: 1;
    min-width: 100px;
  }
}

/* API Endpoint Styles */
.endpoint {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin: 2rem 0;
  overflow: hidden;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(0, 123, 255, 0.1);
  border-bottom: 1px solid var(--border-color);
}

.method {
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.8rem;
  min-width: 60px;
  text-align: center;
}

.method.get {
  background: var(--success-color);
  color: white;
}

.method.post {
  background: var(--accent);
  color: white;
}

.method.put {
  background: var(--warning-color);
  color: white;
}

.method.delete {
  background: var(--error-color);
  color: white;
}

.path {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  color: var(--text-color);
}

.description {
  color: var(--text-color);
  opacity: 0.8;
}

.endpoint-details {
  padding: 1.5rem;
}

.endpoint-details h4 {
  color: var(--text-color);
  margin: 1.5rem 0 1rem 0;
  font-size: 1.1rem;
}

.endpoint-details h4:first-child {
  margin-top: 0;
}

/* Parameter Tables */
.params-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
}

.params-table th,
.params-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.params-table th {
  background: rgba(0, 123, 255, 0.1);
  font-weight: 600;
  color: var(--text-color);
}

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

.params-table code {
  background: rgba(0, 123, 255, 0.1);
  color: var(--accent);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
}