/* Documentation Styles - Clean Version */

/* Override global main padding from style.css for docs pages */
.docs-main {
  padding: 8px 30px 30px 30px; /* reduce top gap (40px -> 8px) */
}

a {
  text-decoration: underline;
}

/* Header */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
  max-width: 95%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.logo {
  display: flex;
  align-items: center;
}

.logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #000;
}

.logo img {
  width: 32px;
  height: 32px;
  margin-right: 10px;
}

.logo-text {
  font-size: 24px;
  font-weight: bold;
}

.docs-nav {
  display: flex;
  gap: 25px;
}

.docs-nav a {
  text-decoration: none;
  color: #000;
  font-size: 16px;
  transition: color 0.3s ease;
}

.docs-nav a:hover {
  color: #007bff;
}

/* Main Container */
.docs-container {
  display: flex;
  background: #fff;
  position: relative;
}

/* Sidebar */
.docs-sidebar {
  width: 340px;
  flex-shrink: 0;
  padding: 30px 20px 30px 55px;
  background: #fff;
  position: sticky;
  top: 70px;
  height: calc(100vh - 70px);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-section {
  margin-bottom: 25px;
}

.sidebar-section h3 {
  font-size: 13px;
  font-weight: bold;
  color: #000;
  letter-spacing: 0.5px;
  margin: 0 0 10px 0;
}

.sidebar-section h3 a {
  display: inline;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-decoration: none;
}

.sidebar-section h3 a:hover {
  color: #0056b3;
  text-decoration: underline;
}

.sidebar-section div {
  margin-bottom: 4px;
}

.nested {
  padding-left: 18px;
}

.sidebar-section a {
  display: block;
  color: #333;
  text-decoration: none;
  font-size: 15px;
  transition: color 0.2s ease;
}

.sidebar-section a:hover {
  color: #0056b3;
  text-decoration: underline;
}

.sidebar-section a.active {
  color: #0056b3;
  font-weight: 600;
}

/* Main Content */
.docs-main-content {
  flex: 1;
  min-width: 0;
  background: #fff;
  padding: 8px 0px 30px 15px;
}

.docs-main {
  width: 100%;
}

.docs-content {
  line-height: 1.8;
}

.docs-content h2 {
  font-size: 28px;
  margin-top: 8px;
  margin-bottom: 15px;
  color: #333;
  border-bottom: 2px solid #007bff;
  padding-bottom: 10px;
}

.docs-content h3 {
  font-size: 24px;
  margin-top: 25px;
  margin-bottom: 12px;
  color: #444;
}

.docs-content p {
  margin: 15px 0;
}

.docs-content p.lead {
  font-size: 20px;
  color: #555;
  margin-bottom: 20px;
}

.docs-content ul {
  list-style: disc;
  padding-left: 30px;
  margin: 15px 0;
}

.docs-content ul li {
  margin: 8px 0;
}

.docs-content hr {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 25px 0;
}

.docs-content img {
  max-width: 100%;
  height: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin: 15px 0;
  display: block;
}

.docs-content blockquote {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  padding: 15px 20px;
  margin: 20px 0;
}

.docs-content blockquote p {
  margin: 5px 0;
}

.docs-content blockquote .callout-title {
  font-weight: bold;
  margin-bottom: 8px;
  color: #856404;
}

/* Footer */
.docs-footer {
  background: #f8f9fa;
  border-top: 1px solid #e0e0e0;
  padding: 20px 0;
  text-align: center;
  margin-top: 0;
}

.docs-footer p {
  margin: 0;
  font-size: 15px;
  color: #666;
}

.docs-footer a {
  color: #007bff;
  text-decoration: none;
}

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

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 15px;
  }

  .docs-nav {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .docs-container {
    flex-direction: column;
  }

  .docs-sidebar {
    width: 100%;
    padding: 20px 15px;
  }

  .docs-main-content {
    padding: 20px 15px;
  }

  .docs-content h2 {
    font-size: 24px;
  }

  .docs-content h3 {
    font-size: 20px;
  }
}

/* first column: doesnot wrap (removed to prevent overflow) */
table td:first-child,
table th:first-child {
  /* white-space: nowrap; */
}

/* Restyle sidebar width and spacing, and add vertical line */
.docs-sidebar {
  width: 250px !important;
  padding: 30px 15px 30px 20px !important;
  border-right: 1px solid #ccc !important;
}

.docs-main-content {
  padding-left: 30px !important;
}

/* Folding navigation styles */
.caret { 
  cursor: pointer; 
  color: #555; 
  user-select: none; 
  font-size: 12px; 
  margin-right: 5px; 
  display: inline-block; 
  width: 15px;
}

.nested { display: none !important; }
.nested.active { display: block !important; }

/* Restyle sidebar width and spacing, and add vertical line */
.docs-sidebar {
  width: 250px !important;
  padding: 30px 15px 30px 20px !important;
  border-right: 1px solid #ccc !important;
}

.docs-main-content {
  padding-left: 30px !important;
}

/* Folding navigation styles */
.caret { 
  cursor: pointer; 
  color: #555; 
  user-select: none; 
  font-size: 12px; 
  margin-right: 5px; 
  display: inline-block; 
  width: 15px;
}

.nested { display: none !important; }
.nested.active { display: block !important; }
/* ---------------------------------
   MERGED DOCS AND NEW STYLES
--------------------------------- */

/* Restyle sidebar width and spacing, and add vertical line */
.docs-sidebar {
  width: 250px !important;
  padding: 30px 15px 30px 20px !important;
  border-right: 1px solid #ccc !important;
}

.docs-main-content {
  padding-left: 30px !important;
}

/* Folding navigation styles */
.caret { 
  cursor: pointer; 
  color: #555; 
  user-select: none; 
  font-size: 12px; 
  margin-right: 5px; 
  display: inline-block; 
  width: 15px;
}

.nested { display: none !important; }
.nested.active { display: block !important; }


/* Right Table of Contents */
.docs-toc {
  width: 250px;
  flex-shrink: 0;
  padding: 30px 20px 30px 10px;
  position: sticky;
  top: 70px;
  height: calc(100vh - 70px);
  overflow-y: auto;
}
.toc-title {
  font-weight: bold;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  color: #000;
}
.toc-list {
  list-style: none !important;
  padding-left: 0 !important;
  margin: 0 !important;
  border-left: 2px solid #e0e0e0;
}
.toc-list li {
  margin: 0 !important;
}
.toc-list a {
  display: block;
  padding: 4px 0 4px 15px;
  color: #333;
  text-decoration: none;
  font-size: 15px;
  border-left: 2px solid transparent;
  margin-left: -2px;
  transition: all 0.2s;
}
.toc-list a:hover {
  color: #007bff;
}
.toc-list a.active {
  color: #007bff;
  font-weight: 600;
  border-left-color: #007bff;
}
.toc-list .toc-h3 a {
  padding-left: 25px;
}

.docs-main-content {
  padding-left: 30px !important;
}



/* Override TinyMCE hard-coded table styles to prevent wrapping and ensure optimal width */
.article-body table {
  width: auto !important;
  max-width: 100%;
  table-layout: auto !important;
  border-collapse: collapse;
}
.article-body table col,
.article-body table colgroup {
  width: auto !important;
}
.article-body table td,
.article-body table th {
  width: auto !important;
  padding: 8px 12px;
  word-break: break-word;
}

/* ---------------------------------
   DASHBOARD
--------------------------------- */

/* Section toggle */
.db-section        { display: none; }
.db-section.active { display: block; }

/* Plan badge */
.plan-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}
.plan-badge.free { background: #e0f2fe; color: #0369a1; }
.plan-badge.paid { background: #dcfce7; color: #166534; }

/* Credits number */
.credits-number { font-size: 56px; font-weight: 800; color: #0b1a2a; margin: 12px 0 4px; }
.credits-unit   { color: #666; font-size: 16px; margin-bottom: 16px; }

/* Alert boxes */
.db-alert {
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 16px;
}
.db-alert-info    { background: #e7f3ff; border-left: 4px solid #0066cc; color: #0b4a8a; }
.db-alert-warning { background: #fff8e7; border-left: 4px solid #ffa500; color: #8b6914; }
.db-alert-success { background: #e7ffe7; border-left: 4px solid #28a745; color: #145914; }
.db-alert-danger  { background: #ffe7e7; border-left: 4px solid #dc3545; color: #8b1414; }

/* Two-column card row */
.cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 768px) { .cards-row { grid-template-columns: 1fr; } }

/* Card box */
.card-box        { border: 1px solid #c8d4dc; padding: 24px; background: #fff; margin-bottom: 20px; }
.card-box.center { text-align: center; }
.card-box.danger { border-color: #f5a5a5; background: #ffe7e7; }

/* Cards stacked column */
.cards-col { display: flex; flex-direction: column; gap: 20px; }

/* Form fields */
.db-field { margin-bottom: 14px; }
.db-field label { display: block; font-weight: 600; font-size: 16px; margin-bottom: 5px; color: #0b1a2a; }
.db-field input[type="password"],
.db-field input[type="email"],
.db-field input[type="text"] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  font-size: 16px;
  font-family: inherit;
}
.db-field input:focus { outline: none; border-color: #0066cc; }
.db-field small { display: block; font-size: 14px; color: #666; margin-top: 4px; }

/* Profile info rows */
.info-row { padding: 10px 0; border-bottom: 1px solid #e2e8f0; display: flex; gap: 20px; align-items: center; }
.info-row:last-child { border-bottom: none; }
.info-label { min-width: 130px; font-weight: 600; color: #666; font-size: 16px; }
.info-value { color: #0b1a2a; font-size: 16px; }

/* Optional badge */
.badge-optional {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  background: #f5f5f5;
  color: #999;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  margin-left: 8px;
  vertical-align: middle;
}

/* Utility */
.text-danger { color: #8b1414; }
.mono        { font-family: "Consolas","Courier New",monospace; font-size: 14px; }
.muted       { color: #999; font-style: italic; }
.truncate    { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }

/* Empty state */
.db-empty   { text-align: center; padding: 40px 20px; color: #999; }
.db-empty i { font-size: 48px; margin-bottom: 15px; display: block; }

/* Data table */
.data-table             { width: 100%; border-collapse: collapse; }
.data-table thead th    { background: #f4f7fa; border: 1px solid #c8d4dc; padding: 10px 12px; text-align: left; font-weight: 700; font-size: 14px; text-transform: uppercase; }
.data-table tbody td    { border: 1px solid #e2e8f0; padding: 10px 12px; font-size: 16px; }
.data-table tbody tr:hover { background: #f8fafc; }
.table-wrap             { overflow-x: auto; }

/* Danger button */
.btn-danger       { background-color: #dc3545; color: #fff; }
.btn-danger:hover { background-color: #c82333; }

/* Section subtitle */
.section-sub { color: #666; font-size: 16px; margin-bottom: 20px; }

/* ---------------------------------
   DOCS INDEX PAGES (category card grid)
--------------------------------- */
.article-body a.index-card,
.article-body a.index-card:hover {
  text-decoration: none;
}
