/* Documentation Layout Styles */

/* Layout Grid */
.docs-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  grid-template-rows: auto 1fr;
  gap: 0;
  min-height: 100vh;
  margin-left: 280px;
  padding: 20px 40px;
  max-width: 1400px;
}

@media (min-width: 1400px) {
  .docs-layout {
    grid-template-columns: 280px 1fr 220px;
  }
}

@media (max-width: 1024px) {
  .docs-layout {
    margin-left: 0;
    grid-template-columns: 1fr;
    padding: 20px;
  }
}

/* Breadcrumbs */
.breadcrumbs {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0 24px 0;
  font-size: 14px;
  color: var(--text-muted);
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.breadcrumbs a:hover {
  color: var(--accent-primary);
}

.breadcrumbs .current {
  color: var(--text);
  font-weight: 500;
}

.breadcrumbs i.fa-chevron-right {
  font-size: 10px;
  opacity: 0.5;
}

/* Sidebar */
.docs-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 280px;
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

/* Docs landing grids */
.docs-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
  justify-content: center;
  justify-items: center;
}

.docs-grid .card {
  width: 100%;
  max-width: 320px;
  text-align: center;
}

.docs-results-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  justify-content: center;
}

.feedback-card {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-secondary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.feedback-card .feedback-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.feedback-kicker {
  margin: 0 0 4px 0;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.feedback-card h3 {
  margin: 0;
}

.feedback-subtext {
  margin: 6px 0 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.feedback-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.feedback-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.feedback-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.feedback-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent-primary);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.feedback-btn.yes {
  color: var(--success, #1bd96f);
}

.feedback-btn.no {
  color: #ff7a7a;
}

.feedback-followup {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.feedback-followup textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text);
  border-radius: 10px;
  padding: 10px;
  min-height: 90px;
  resize: vertical;
}

.feedback-submit {
  align-self: flex-start;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--accent-primary);
  background: var(--accent-primary);
  color: #000;
  cursor: pointer;
  font-weight: 600;
}

.feedback-status {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.feedback-card.feedback-complete .feedback-actions {
  opacity: 0.5;
  pointer-events: none;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 18px;
}

.sidebar-logo i {
  color: var(--accent-primary);
  font-size: 24px;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.sidebar-close:hover {
  background: var(--bg-tertiary);
}

/* Sidebar Search */
.sidebar-search {
  position: relative;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-search input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
}

.sidebar-search i {
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.nav-category {
  margin-bottom: 8px;
}

.category-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease;
}

.category-toggle:hover {
  background: var(--bg-tertiary);
}

.category-toggle i:first-child {
  color: var(--accent-primary);
  font-size: 16px;
}

.category-toggle span {
  flex: 1;
}

.toggle-icon {
  font-size: 12px;
  transition: transform 0.2s ease;
}

.category-toggle.active .toggle-icon {
  transform: rotate(180deg);
}

.category-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.category-items.expanded {
  max-height: 1000px;
}

.nav-item {
  display: block;
  padding: 8px 20px 8px 56px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: var(--bg-tertiary);
  color: var(--text);
}

.nav-item.active {
  background: rgba(76, 175, 80, 0.1);
  color: var(--accent-primary);
  border-left-color: var(--accent-primary);
  font-weight: 500;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.footer-link:hover {
  background: var(--bg-tertiary);
  color: var(--text);
}

.footer-link i {
  font-size: 16px;
}

/* Mobile Sidebar */
@media (max-width: 1024px) {
  .docs-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .docs-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: block;
  }
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

.sidebar-overlay.active {
  display: block;
}

.mobile-sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  background: var(--accent-primary);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 98;
  transition: transform 0.2s ease;
}

.mobile-sidebar-toggle:hover {
  transform: scale(1.1);
}

@media (max-width: 1024px) {
  .mobile-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Main Content */
.docs-content {
  grid-column: 1 / -1;
  max-width: 800px;
  padding: 0;
}

@media (min-width: 1400px) {
  .docs-content {
    grid-column: 2 / 3;
  }
}

.docs-content article {
  padding-bottom: 40px;
}

.docs-content h1 {
  font-size: 40px;
  margin: 0 0 16px 0;
}

.docs-content h2 {
  font-size: 32px;
  margin: 48px 0 16px 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.docs-content h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.docs-content h3 {
  font-size: 24px;
  margin: 32px 0 12px 0;
}

.docs-content h4 {
  font-size: 20px;
  margin: 24px 0 8px 0;
}

.docs-content p {
  line-height: 1.7;
  margin: 16px 0;
}

.docs-content code {
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: "Monaco", "Courier New", monospace;
}

.docs-content pre {
  background: var(--bg-secondary);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid var(--border);
}

.docs-content pre code {
  background: none;
  padding: 0;
}

.docs-content ul,
.docs-content ol {
  padding-left: 24px;
  margin: 16px 0;
}

.docs-content li {
  margin: 8px 0;
  line-height: 1.6;
}

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
}

.docs-content th,
.docs-content td {
  padding: 12px;
  border: 1px solid var(--border);
  text-align: left;
}

.docs-content th {
  background: var(--bg-secondary);
  font-weight: 600;
}

.docs-content blockquote {
  border-left: 3px solid var(--accent-primary);
  padding: 12px 20px;
  margin: 16px 0;
  background: var(--bg-secondary);
  border-radius: 0 8px 8px 0;
}

/* Page Navigation */
.page-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.nav-prev,
.nav-next {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s ease;
}

.nav-prev:hover,
.nav-next:hover {
  border-color: var(--accent-primary);
  background: var(--bg-tertiary);
}

.nav-prev {
  justify-self: start;
}

.nav-next {
  justify-self: end;
  text-align: right;
}

.nav-prev i,
.nav-next i {
  color: var(--accent-primary);
  font-size: 20px;
}

.nav-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-title {
  display: block;
  font-weight: 500;
  font-size: 14px;
}

@media (max-width: 640px) {
  .page-navigation {
    grid-template-columns: 1fr;
  }
}

/* Table of Contents */
.docs-toc {
  display: none;
  position: sticky;
  top: 20px;
  height: fit-content;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
}

@media (min-width: 1400px) {
  .docs-toc {
    display: block;
    grid-column: 3 / 4;
  }
}

.toc-header h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 16px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-link {
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.2s ease;
}

.toc-link:hover {
  color: var(--text);
  background: var(--bg-tertiary);
}

.toc-link.active {
  color: var(--accent-primary);
  border-left-color: var(--accent-primary);
  background: rgba(76, 175, 80, 0.1);
}

.toc-link.toc-h3 {
  padding-left: 24px;
  font-size: 12px;
}

.theme-toggle {
  margin-top: 20px;
  width: 100%;
  padding: 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
}

[data-theme="dark"] .theme-toggle .fa-sun {
  display: none;
}

[data-theme="light"] .theme-toggle .fa-moon {
  display: none;
}
