/* ==========================================================================
   GitBook-Style Lightweight Wiki CSS for ModernX / Warcraft Template
   Language: pt-PT
   ========================================================================== */

.gb-wiki-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: calc(100vh - 120px);
  color: #e2e8f0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.65;
  box-sizing: border-box;
  padding: 30px 20px 60px 20px;
}

.gb-wiki-container {
  display: flex;
  width: 100%;
  max-width: 1380px;
  gap: 32px;
  position: relative;
}

/* ==========================================================================
   1. Left Sidebar (Navigation Tree)
   ========================================================================== */

.gb-sidebar {
  width: 280px;
  min-width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 90px;
  height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.gb-sidebar::-webkit-scrollbar {
  width: 5px;
}

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

.gb-search-wrap {
  position: relative;
  margin-bottom: 20px;
}

.gb-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 13px;
  pointer-events: none;
}

.gb-search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  padding: 9px 12px 9px 34px;
  color: #f1f5f9;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  box-sizing: border-box;
}

.gb-search-input:focus {
  border-color: #00a2ff;
  background: rgba(0, 162, 255, 0.06);
}

.gb-search-input::placeholder {
  color: #64748b;
}

.gb-nav-group {
  margin-bottom: 22px;
}

.gb-nav-group-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #64748b;
  padding: 4px 10px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gb-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gb-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
  border-left: 2px solid transparent;
  cursor: pointer;
}

.gb-nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #f1f5f9;
}

.gb-nav-item.active {
  background: rgba(0, 162, 255, 0.1);
  color: #38bdf8;
  border-left-color: #00a2ff;
  font-weight: 600;
}

.gb-nav-item i {
  font-size: 13px;
  width: 16px;
  text-align: center;
  opacity: 0.8;
}

.gb-nav-item.active i {
  opacity: 1;
  color: #00a2ff;
}

/* ==========================================================================
   2. Main Content (Center)
   ========================================================================== */

.gb-content {
  flex: 1;
  min-width: 0;
  max-width: 820px;
}

.gb-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #64748b;
  margin-bottom: 20px;
}

.gb-breadcrumbs a {
  color: #64748b;
  text-decoration: none;
  transition: color 0.15s;
}

.gb-breadcrumbs a:hover {
  color: #94a3b8;
}

.gb-breadcrumbs span.sep {
  opacity: 0.4;
}

.gb-breadcrumbs span.current {
  color: #94a3b8;
  font-weight: 500;
}

.gb-article-pane {
  display: none;
  animation: gbFadeIn 0.25s ease-out;
}

.gb-article-pane.active {
  display: block;
}

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

.gb-article-header {
  margin-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 20px;
}

.gb-article-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: rgba(0, 162, 255, 0.12);
  border: 1px solid rgba(0, 162, 255, 0.25);
  border-radius: 20px;
  color: #38bdf8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.gb-article-title {
  font-size: 30px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 10px 0;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.gb-article-subtitle {
  font-size: 15px;
  color: #94a3b8;
  margin: 0;
}

.gb-section-title {
  font-size: 20px;
  font-weight: 700;
  color: #f1f5f9;
  margin: 32px 0 14px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  scroll-margin-top: 100px;
}

.gb-section-title::before {
  content: '#';
  color: #00a2ff;
  opacity: 0.6;
  font-weight: 800;
}

.gb-paragraph {
  font-size: 14.5px;
  color: #cbd5e1;
  margin: 0 0 16px 0;
}

/* Callout Boxes (Info, Warning, Success, Danger) */
.gb-callout {
  display: flex;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 10px;
  margin: 20px 0;
  font-size: 13.5px;
  line-height: 1.6;
  border-left: 4px solid;
}

.gb-callout i {
  font-size: 17px;
  margin-top: 2px;
  flex-shrink: 0;
}

.gb-callout-info {
  background: rgba(0, 162, 255, 0.08);
  border-left-color: #00a2ff;
  color: #e2e8f0;
}
.gb-callout-info i {
  color: #38bdf8;
}

.gb-callout-warning {
  background: rgba(245, 158, 11, 0.08);
  border-left-color: #f59e0b;
  color: #fef3c7;
}
.gb-callout-warning i {
  color: #fbbf24;
}

.gb-callout-success {
  background: rgba(16, 185, 129, 0.08);
  border-left-color: #10b981;
  color: #d1fae5;
}
.gb-callout-success i {
  color: #34d399;
}

.gb-callout-danger {
  background: rgba(239, 68, 68, 0.08);
  border-left-color: #ef4444;
  color: #fee2e2;
}
.gb-callout-danger i {
  color: #f87171;
}

/* Command Cards */
.gb-cmd-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.2s;
}

.gb-cmd-card:hover {
  border-color: rgba(0, 162, 255, 0.3);
}

.gb-cmd-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gb-cmd-code {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 13.5px;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.3px;
}

.gb-cmd-desc {
  font-size: 12px;
  color: #94a3b8;
}

.gb-cmd-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.gb-cmd-btn:hover {
  background: #00a2ff;
  color: #ffffff;
  border-color: #00a2ff;
}

.gb-cmd-btn.copied {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
}

/* Tables */
.gb-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13.5px;
}

.gb-table th {
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11.5px;
  letter-spacing: 0.6px;
  padding: 10px 14px;
  text-align: left;
}

.gb-table td {
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
}

.gb-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Quick Cards Grid */
.gb-grid-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.gb-link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  color: #e2e8f0;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.gb-link-card i {
  font-size: 18px;
  color: #00a2ff;
  width: 22px;
  text-align: center;
}

.gb-link-card:hover {
  background: rgba(0, 162, 255, 0.08);
  border-color: rgba(0, 162, 255, 0.35);
  transform: translateY(-2px);
  color: #ffffff;
}

/* Footer Navigation (Prev / Next) */
.gb-nav-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.gb-footer-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  color: #e2e8f0;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gb-footer-btn:hover {
  border-color: rgba(0, 162, 255, 0.4);
  background: rgba(0, 162, 255, 0.06);
  transform: translateY(-2px);
}

.gb-footer-btn.next {
  text-align: right;
  align-items: flex-end;
}

.gb-footer-btn .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #64748b;
  font-weight: 700;
}

.gb-footer-btn .title {
  font-size: 14px;
  font-weight: 600;
  color: #38bdf8;
}

/* ==========================================================================
   3. Right Sidebar (On this page / TOC)
   ========================================================================== */

.gb-toc {
  width: 220px;
  min-width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 90px;
  height: fit-content;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-left: 8px;
}

.gb-toc-title {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #64748b;
  margin-bottom: 12px;
}

.gb-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.gb-toc-item a {
  display: block;
  padding: 4px 0 4px 14px;
  font-size: 12.5px;
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.15s;
  border-left: 2px solid transparent;
  margin-left: -1px;
}

.gb-toc-item a:hover {
  color: #38bdf8;
  border-left-color: #00a2ff;
}

/* ==========================================================================
   4. Responsiveness
   ========================================================================== */

.gb-mobile-toggle {
  display: none;
  background: rgba(0, 162, 255, 0.15);
  border: 1px solid rgba(0, 162, 255, 0.3);
  color: #38bdf8;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

@media (max-width: 1100px) {
  .gb-toc {
    display: none;
  }
}

@media (max-width: 860px) {
  .gb-wiki-container {
    flex-direction: column;
    gap: 16px;
  }

  .gb-mobile-toggle {
    display: flex;
  }

  .gb-sidebar {
    display: none;
    width: 100%;
    min-width: 100%;
    height: auto;
    position: static;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 16px;
  }

  .gb-sidebar.mobile-open {
    display: block;
  }

  .gb-content {
    max-width: 100%;
  }

  .gb-article-title {
    font-size: 24px;
  }
}
