﻿/* ========================================================================
   DOCUMENTATION STYLES
   ======================================================================== */

:root {
  --docs-primary: #2f3238;
  --docs-secondary: #868b94;
  --docs-success: #575b63;
  --docs-bg-light: #f6f7f9;
  --docs-bg-dark: #1a1d29;
  --docs-text-light: #5a5c69;
  --docs-text-dark: #e3e6f0;
  --docs-border-light: #e3e6f0;
  --docs-border-dark: #3a3b45;

  --docs-sidebar-width: 280px;
  --docs-toc-width: 250px;
  --docs-header-height: 70px;
}

/* Dark Theme Variables */
[data-theme="dark"] {
  --docs-bg-light: #1a1d29;
  --docs-text-light: #e3e6f0;
  --docs-border-light: #3a3b45;
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: var(--docs-text-light);
  background-color: var(--docs-bg-light);
  margin: 0;
  padding: 0;
}

/* Header Styles */
.docs-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--docs-header-height);
  background: white;
  border-bottom: 1px solid var(--docs-border-light);
  z-index: 1030;
  padding: 0 20px;
}

.docs-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--docs-primary);
}

.theme-toggle {
  margin-left: auto;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.theme-toggle:hover {
  background-color: var(--docs-bg-light);
}

/* Search Styles */
.docs-search {
  max-width: 500px;
  margin: 0 auto;
}

.search-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--docs-text-light);
  opacity: 0.6;
}

.search-shortcut {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: var(--docs-text-light);
  opacity: 0.6;
  background: var(--docs-bg-light);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--docs-border-light);
}

#docsSearch {
  padding-left: 40px;
  padding-right: 60px;
  border: 1px solid var(--docs-border-light);
  border-radius: 8px;
  background-color: var(--docs-bg-light);
}

#docsSearch:focus {
  border-color: var(--docs-primary);
  box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

/* Layout Styles */
.docs-layout {
  display: flex;
  margin-top: var(--docs-header-height);
  min-height: calc(100vh - var(--docs-header-height));
}

/* Sidebar Styles */
.docs-sidebar {
  width: var(--docs-sidebar-width);
  background: white;
  border-right: 1px solid var(--docs-border-light);
  position: fixed;
  top: var(--docs-header-height);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 1020;
}

.sidebar-content {
  padding: 20px 0;
}

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

.nav-section-header {
  padding: 12px 20px;
  font-weight: 600;
  color: #2d3748;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s;
  user-select: none;
}

.nav-section-header:hover {
  background-color: var(--docs-bg-light);
}

.collapse-icon {
  transition: transform 0.2s;
  font-size: 0.875rem;
}

.nav-section-header[aria-expanded="true"] .collapse-icon {
  transform: rotate(90deg);
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-link {
  display: block;
  padding: 8px 20px 8px 45px;
  color: var(--docs-text-light);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  background-color: var(--docs-bg-light);
  color: var(--docs-primary);
}

.nav-link.active {
  background-color: rgba(78, 115, 223, 0.1);
  color: var(--docs-primary);
  border-left-color: var(--docs-primary);
  font-weight: 500;
}

/* Main Content Styles */
.docs-content {
  flex: 1;
  margin-left: var(--docs-sidebar-width);
  margin-right: var(--docs-toc-width);
  padding: 0;
  max-width: calc(100% - var(--docs-sidebar-width) - var(--docs-toc-width));
}

.content-header {
  padding: 20px 30px;
  background: white;
  border-bottom: 1px solid var(--docs-border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.breadcrumb {
  margin: 0;
  background: transparent;
  padding: 0;
  font-size: 0.875rem;
}

.breadcrumb-item a {
  color: var(--docs-primary);
  text-decoration: none;
}

.breadcrumb-item.active {
  color: var(--docs-text-light);
}

.content-body {
  padding: 30px;
  background: white;
  min-height: calc(100vh - var(--docs-header-height) - 80px);
}

/* Article Styles */
.docs-article {
  max-width: 800px;
  margin: 0 auto;
}

.docs-article h1 {
  font-size: 2.5rem;
  color: #2d3748;
  margin-bottom: 1rem;
  font-weight: 700;
}

.docs-article h2 {
  font-size: 2rem;
  color: #2d3748;
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--docs-border-light);
  padding-bottom: 0.5rem;
}

.docs-article h3 {
  font-size: 1.5rem;
  color: #2d3748;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.docs-article p {
  margin-bottom: 1rem;
  line-height: 1.7;
  color: var(--docs-text-light);
}

.docs-article ul,
.docs-article ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.docs-article li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.docs-article code {
  background: var(--docs-bg-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.875rem;
  color: var(--docs-primary);
}

.docs-article pre {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--docs-border-light);
}

.docs-article pre code {
  background: transparent;
  padding: 0;
  color: #2d3748;
}

/* Table of Contents Styles */
.docs-toc {
  width: var(--docs-toc-width);
  background: white;
  border-left: 1px solid var(--docs-border-light);
  position: fixed;
  top: var(--docs-header-height);
  right: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 1020;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.docs-toc.show {
  transform: translateX(0);
}

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

.toc-header h6 {
  margin: 0;
  font-weight: 600;
  color: #2d3748;
}

.toc-nav {
  padding: 20px;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  margin-bottom: 8px;
}

.toc-list a {
  color: var(--docs-text-light);
  text-decoration: none;
  font-size: 0.875rem;
  display: block;
  padding: 4px 0;
  border-left: 2px solid transparent;
  padding-left: 12px;
  transition: all 0.2s;
}

.toc-list a:hover {
  color: var(--docs-primary);
  border-left-color: var(--docs-primary);
}

.toc-list a.active {
  color: var(--docs-primary);
  border-left-color: var(--docs-primary);
  font-weight: 500;
}

/* Utility Classes */
.loading-content {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
}

.reading-time {
  font-size: 0.875rem;
  color: var(--docs-text-light);
  opacity: 0.7;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 1rem;
}

.alert-info {
  background: rgba(78, 115, 223, 0.1);
  border: 1px solid rgba(78, 115, 223, 0.2);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
}

.alert-warning {
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.2);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .docs-toc {
    display: none;
  }

  .docs-content {
    margin-right: 0;
    max-width: calc(100% - var(--docs-sidebar-width));
  }
}

@media (max-width: 768px) {
  .docs-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

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

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

  .content-body {
    padding: 20px;
  }

  .docs-article h1 {
    font-size: 2rem;
  }

  .docs-article h2 {
    font-size: 1.5rem;
  }

  .search-shortcut {
    display: none;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

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

/* Scrollbar Styling */
.docs-sidebar::-webkit-scrollbar,
.docs-toc::-webkit-scrollbar {
  width: 6px;
}

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

.docs-sidebar::-webkit-scrollbar-thumb,
.docs-toc::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.docs-sidebar::-webkit-scrollbar-thumb:hover,
.docs-toc::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

