/* ========================================
   GUACAMOLE DOCUMENTATION STYLES
   Uses Nachos Design System Variables
   ======================================== */

/* Layout */
.docs-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg-color);
}

/* ========================================
   READING PROGRESS BAR
   ======================================== */

.docs-progress-bar {
    position: fixed;
    top: 0;
    left: 280px;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color, var(--primary-color)));
    z-index: calc(var(--z-fixed) + 1);
    transition: width 0.1s ease-out;
}

@media (max-width: 768px) {
    .docs-progress-bar {
        left: 0;
    }
}

/* ========================================
   SIDEBAR
   ======================================== */

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

.docs-sidebar-header {
    padding: var(--space-5);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 1;
}

.docs-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    color: var(--text-primary);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-lg);
}

.docs-logo img {
    width: 36px;
    height: 36px;
}

.docs-logo:hover {
    color: var(--primary-color);
}

/* Navigation */
.docs-nav {
    flex: 1;
    padding: var(--space-4);
    overflow-y: auto;
}

/* ========================================
   SEARCH
   ======================================== */

.docs-search {
    position: relative;
    margin-bottom: var(--space-4);
}

.docs-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.docs-search-input-wrapper i {
    position: absolute;
    left: var(--space-3);
    color: var(--text-tertiary);
    font-size: var(--font-size-sm);
}

.docs-search-input {
    width: 100%;
    padding: var(--space-2) var(--space-4);
    padding-left: var(--space-8);
    padding-right: var(--space-8);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
}

.docs-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-overlay-light);
}

.docs-search-input::placeholder {
    color: var(--text-quaternary);
}

.docs-search-shortcut {
    position: absolute;
    right: var(--space-3);
    padding: 2px 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    font-size: var(--font-size-xs);
    font-family: var(--font-family-mono);
}

.docs-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: var(--space-2);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: var(--z-dropdown);
    display: none;
}

.docs-search-results.active {
    display: block;
}

.docs-search-result {
    display: flex;
    flex-direction: column;
    padding: var(--space-3);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.docs-search-result:last-child {
    border-bottom: none;
}

.docs-search-result:hover {
    background: var(--primary-light);
}

.docs-search-result-title {
    color: var(--text-primary);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
}

.docs-search-result-section {
    color: var(--text-tertiary);
    font-size: var(--font-size-xs);
    margin-top: 2px;
}

.docs-search-no-results {
    padding: var(--space-4);
    text-align: center;
    color: var(--text-tertiary);
    font-size: var(--font-size-sm);
}

.docs-nav-home {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

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

.docs-nav-home.active {
    background: var(--primary-overlay-medium);
    color: var(--primary-color);
}

.docs-nav-home i {
    width: 20px;
    text-align: center;
    color: var(--primary-color);
}

.docs-nav-section {
    margin-bottom: var(--space-2);
}

.docs-nav-section-title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    color: var(--text-primary);
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-size: var(--font-size-sm);
}

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

.docs-nav-section-title.active {
    background: var(--primary-overlay-medium);
    color: var(--primary-color);
}

.docs-nav-section-title i {
    width: 18px;
    text-align: center;
    color: var(--primary-color);
    font-size: var(--font-size-sm);
}

.docs-nav-pages {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
}

.docs-nav-pages.open {
    max-height: 500px;
}

.docs-nav-pages li {
    margin: 0;
}

.docs-nav-pages a {
    display: block;
    padding: var(--space-2) var(--space-4);
    padding-left: var(--space-10);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    border-left: 2px solid transparent;
    transition: all var(--transition-fast);
    font-size: var(--font-size-sm);
}

.docs-nav-pages a:hover {
    background: var(--surface-hover);
    color: var(--primary-color);
}

.docs-nav-pages a.active {
    background: var(--primary-light);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: var(--font-weight-medium);
}

.docs-sidebar-footer {
    padding: var(--space-4);
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* Theme Toggle Button */
.docs-theme-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-2) var(--space-3);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

/* Light theme: show sun icon and "Light Mode" text */
.docs-theme-toggle .theme-icon-dark,
.docs-theme-toggle .theme-label-dark {
    display: none;
}

.docs-theme-toggle .theme-icon-light,
.docs-theme-toggle .theme-label-light {
    display: inline;
}

/* Dark theme: show moon icon and "Dark Mode" text */
[data-theme="dark"] .docs-theme-toggle .theme-icon-light,
[data-theme="dark"] .docs-theme-toggle .theme-label-light {
    display: none;
}

[data-theme="dark"] .docs-theme-toggle .theme-icon-dark,
[data-theme="dark"] .docs-theme-toggle .theme-label-dark {
    display: inline;
}

.docs-theme-toggle i {
    color: var(--primary-color);
}

.docs-back-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: var(--font-size-sm);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

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

/* ========================================
   MOBILE SIDEBAR
   ======================================== */

.docs-sidebar-toggle {
    display: none;
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--primary-color);
    color: var(--white);
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: var(--z-fixed);
    font-size: var(--font-size-xl);
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.docs-sidebar-toggle:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.docs-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--modal-backdrop);
    z-index: calc(var(--z-fixed) - 1);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.docs-overlay.active {
    display: block;
    opacity: 1;
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.docs-main {
    flex: 1;
    margin-left: 280px;
    padding: var(--space-8);
    max-width: 100%;
    min-height: 100vh;
}

/* ========================================
   HERO SECTION
   ======================================== */

.docs-hero {
    text-align: center;
    padding: var(--space-12) var(--space-8);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-secondary) 100%);
    border-radius: var(--radius-2xl);
    margin-bottom: var(--space-8);
    border: 1px solid var(--border-color);
}

.docs-hero-icon {
    margin-bottom: var(--space-6);
    display: flex;
    justify-content: center;
}

.docs-hero-icon img {
    width: 100px;
    height: 100px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

.docs-hero h1 {
    font-size: var(--font-size-4xl);
    color: var(--text-primary);
    margin-bottom: var(--space-4);
    font-weight: var(--font-weight-bold);
}

.docs-hero p {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   CARDS GRID
   ======================================== */

.docs-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-10);
}

.docs-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    text-decoration: none;
    transition: all var(--transition-fast);
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
}

.docs-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--primary-color);
}

.docs-card-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    background: var(--primary-light);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.docs-card-icon i {
    font-size: var(--font-size-2xl);
    color: var(--primary-color);
}

.docs-card-content {
    flex: 1;
}

.docs-card h3 {
    color: var(--text-primary);
    margin-bottom: var(--space-2);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
}

.docs-card p {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin: 0;
    line-height: var(--line-height-relaxed);
}

.docs-card-arrow {
    color: var(--text-quaternary);
    transition: all var(--transition-fast);
}

.docs-card:hover .docs-card-arrow {
    color: var(--primary-color);
    transform: translateX(4px);
}

/* Quick Links */
.docs-quick-links {
    margin-top: var(--space-10);
}

.docs-quick-links h2 {
    font-size: var(--font-size-xl);
    color: var(--text-primary);
    margin-bottom: var(--space-6);
    font-weight: var(--font-weight-semibold);
}

.docs-quick-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.docs-quick-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-fast);
}

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

.docs-quick-link i {
    color: var(--primary-color);
}

/* ========================================
   SECTION PAGE
   ======================================== */

.docs-section-header {
    text-align: center;
    margin-bottom: var(--space-10);
    padding-bottom: var(--space-8);
    border-bottom: 1px solid var(--border-color);
}

.docs-section-icon {
    width: 80px;
    height: 80px;
    background: var(--primary-light);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-6);
}

.docs-section-icon i {
    font-size: var(--font-size-3xl);
    color: var(--primary-color);
}

.docs-section-header h1 {
    font-size: var(--font-size-3xl);
    color: var(--text-primary);
    margin-bottom: var(--space-3);
}

.docs-section-header p {
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
    max-width: 600px;
    margin: 0 auto;
}

.docs-page-cards {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.docs-page-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.docs-page-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.docs-page-card h3 {
    color: var(--text-primary);
    margin-bottom: var(--space-1);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
}

.docs-page-card p {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin: 0;
}

.docs-page-card-arrow {
    color: var(--text-quaternary);
    transition: all var(--transition-fast);
}

.docs-page-card:hover .docs-page-card-arrow {
    color: var(--primary-color);
    transform: translateX(4px);
}

/* ========================================
   ARTICLE PAGE
   ======================================== */

.docs-article {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

/* Breadcrumbs */
.docs-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
}

.docs-breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

.docs-breadcrumbs .separator {
    color: var(--text-quaternary);
    font-size: 10px;
}

.docs-breadcrumbs .current {
    color: var(--text-primary);
    font-weight: var(--font-weight-medium);
}

/* Table of Contents - Redesigned for long content */
.docs-toc {
    position: fixed;
    right: var(--space-8);
    top: var(--space-8);
    width: 240px;
    max-height: calc(100vh - var(--space-16));
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    font-size: var(--font-size-sm);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.docs-toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.docs-toc-header h4 {
    color: var(--text-tertiary);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
    font-weight: var(--font-weight-semibold);
}

.docs-toc-toggle {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: var(--space-1);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.docs-toc-toggle:hover {
    color: var(--primary-color);
    background: var(--primary-light);
}

.docs-toc-content {
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--space-3);
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
    max-height: 60vh;
}

.docs-toc-content::-webkit-scrollbar {
    width: 4px;
}

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

.docs-toc-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.docs-toc-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-quaternary);
}

/* Legacy h4 styling for backwards compatibility */
.docs-toc > h4 {
    color: var(--text-tertiary);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
    padding: var(--space-3) var(--space-4);
    font-weight: var(--font-weight-semibold);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

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

.docs-toc li {
    margin-bottom: 0;
}

/* H2 level items - always visible */
.docs-toc > .toc > ul > li > a,
.docs-toc > ul > li > a,
.docs-toc-content > .toc > ul > li > a {
    display: flex;
    align-items: center;
    padding: var(--space-2) var(--space-2);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    line-height: var(--line-height-tight);
    border-radius: var(--radius-sm);
    font-weight: var(--font-weight-medium);
    border-left: 2px solid transparent;
}

.docs-toc > .toc > ul > li > a:hover,
.docs-toc > ul > li > a:hover,
.docs-toc-content > .toc > ul > li > a:hover {
    color: var(--primary-color);
    background: var(--primary-light);
}

/* H3 level items - nested, collapsible */
.docs-toc .toc ul ul,
.docs-toc-content .toc ul ul {
    padding-left: var(--space-3);
    margin-top: var(--space-1);
    border-left: 1px solid var(--border-color);
    margin-left: var(--space-2);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.docs-toc .toc ul ul.expanded,
.docs-toc-content .toc ul ul.expanded {
    max-height: 1000px;
}

.docs-toc .toc ul ul li a,
.docs-toc-content .toc ul ul li a {
    display: block;
    padding: var(--space-1) var(--space-2);
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: var(--font-size-xs);
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
    font-weight: var(--font-weight-normal);
}

.docs-toc .toc ul ul li a:hover,
.docs-toc-content .toc ul ul li a:hover {
    color: var(--primary-color);
    background: var(--primary-light);
}

/* Expand indicator for items with children */
.docs-toc-item-has-children > a::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 8px;
    margin-left: auto;
    padding-left: var(--space-2);
    color: var(--text-quaternary);
    transition: transform 0.2s ease;
}

.docs-toc-item-has-children.expanded > a::after {
    transform: rotate(180deg);
}

/* Progress indicator at bottom */
.docs-toc-progress {
    padding: var(--space-2) var(--space-4);
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

.docs-toc-progress-bar {
    flex: 1;
    height: 3px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.docs-toc-progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.1s ease-out;
}

/* Collapsed state */
.docs-toc.collapsed {
    width: auto;
}

.docs-toc.collapsed .docs-toc-content,
.docs-toc.collapsed .docs-toc-progress,
.docs-toc.collapsed > .toc {
    display: none;
}

.docs-toc.collapsed .docs-toc-header h4 {
    display: none;
}

.docs-toc.collapsed .docs-toc-toggle i::before {
    content: '\f0c9';
}

/* ========================================
   CONTENT STYLING
   ======================================== */

.docs-content {
    line-height: var(--line-height-relaxed);
}

.docs-content > h1:first-child {
    font-size: var(--font-size-3xl);
    color: var(--text-primary);
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-color);
    font-weight: var(--font-weight-bold);
}

.docs-content h2 {
    font-size: var(--font-size-2xl);
    color: var(--primary-color);
    margin-top: var(--space-10);
    margin-bottom: var(--space-4);
    font-weight: var(--font-weight-semibold);
    scroll-margin-top: var(--space-6);
}

.docs-content h3 {
    font-size: var(--font-size-xl);
    color: var(--primary-color);
    margin-top: var(--space-8);
    margin-bottom: var(--space-3);
    font-weight: var(--font-weight-semibold);
    scroll-margin-top: var(--space-6);
}

.docs-content h4,
.docs-content h5,
.docs-content h6 {
    color: var(--primary-color);
    margin-top: var(--space-6);
    margin-bottom: var(--space-2);
    font-weight: var(--font-weight-semibold);
    scroll-margin-top: var(--space-6);
}

.docs-content p {
    margin-bottom: var(--space-4);
    color: var(--text-primary);
}

.docs-content a {
    color: var(--link-color);
    text-decoration: none;
}

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

.docs-content ul,
.docs-content ol {
    margin-bottom: var(--space-4);
    padding-left: var(--space-6);
}

.docs-content li {
    margin-bottom: var(--space-2);
    color: var(--text-primary);
}

.docs-content li::marker {
    color: var(--primary-color);
}

/* Header permalinks */
.docs-content .header-link {
    margin-left: var(--space-2);
    color: var(--text-quaternary);
    text-decoration: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
    font-size: 0.7em;
    vertical-align: middle;
}

/* Replace pilcrow with link icon using Font Awesome */
.docs-content .header-link::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f0c1"; /* fa-link icon */
}

/* Hide the default pilcrow text */
.docs-content .header-link {
    font-size: 0;
}

.docs-content .header-link::before {
    font-size: var(--font-size-sm);
}

.docs-content h2:hover .header-link,
.docs-content h3:hover .header-link,
.docs-content h4:hover .header-link {
    opacity: 1;
}

.docs-content .header-link:hover {
    color: var(--primary-color);
}

/* Code Blocks */
.docs-content code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: var(--font-family-mono);
    font-size: 0.875em;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.docs-content pre {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    overflow-x: auto;
    margin: var(--space-4) 0;
}

.docs-content pre code {
    background: none;
    padding: 0;
    border: none;
    font-size: var(--font-size-sm);
}

/* Tables */
.docs-content table,
.docs-content .docs-table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-6) 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.docs-content th,
.docs-content .quick_menu_table_header td {
    background: var(--primary-color);
    color: var(--white);
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
}

.docs-content td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-color);
    font-size: var(--font-size-sm);
}

.docs-content tr:nth-child(even) {
    background: var(--primary-light);
}

.docs-content tr:hover {
    background: var(--primary-overlay-light);
}

.docs-content td img {
    max-width: 70px;
    height: auto;
}

/* Images */
.docs-content img,
.docs-content .docs-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    margin: var(--space-4) 0;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.docs-content .pure-img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* Pure CSS Grid adjustments */
.docs-content .pure-g {
    display: flex;
    justify-content: center;
    margin: var(--space-6) 0;
}

.docs-content .pure-u-1,
.docs-content .pure-u-md-1-3 {
    padding: var(--space-2);
}

/* Video Container */
.docs-content .video-container,
.docs-content .docs-video-container {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: var(--space-6) auto;
    padding-top: 56.25%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: var(--bg-tertiary);
}

.docs-content .video-container iframe,
.docs-content .docs-video-container iframe,
.docs-content .responsive-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Image tables */
.docs-content .image-table,
.docs-content .image-table-qr {
    width: 100%;
    border: none;
    background: transparent;
}

.docs-content .image-cell,
.docs-content .image-cell-qr {
    text-align: center;
    padding: var(--space-4);
    border: none;
    background: transparent;
}

.docs-content .image-cell img,
.docs-content .image-cell-qr img {
    max-height: 300px;
    width: auto;
    max-width: 100%;
    cursor: pointer;
    margin: 0 auto;
    display: block;
}

.docs-content .image-cell p,
.docs-content .image-cell-qr p {
    font-weight: var(--font-weight-semibold);
    color: var(--primary-color);
    margin-top: var(--space-2);
}

.docs-content .image-cell-qr .title {
    font-weight: var(--font-weight-semibold);
    color: var(--primary-color);
}

/* Notes/Warnings */
.docs-content .note,
.docs-content blockquote {
    background: var(--info-light);
    border-left: 4px solid var(--info);
    padding: var(--space-4);
    margin: var(--space-4) 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.docs-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Navigation Footer */
.docs-nav-footer {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-12);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border-color);
}

.docs-nav-prev,
.docs-nav-next {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-size: var(--font-size-sm);
}

.docs-nav-prev:hover,
.docs-nav-next:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

/* ========================================
   RESPONSIVE
   ======================================== */

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

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

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

    .docs-main {
        margin-left: 0;
        padding: var(--space-4);
    }

    .docs-sidebar-toggle {
        display: flex;
    }

    .docs-hero {
        padding: var(--space-8) var(--space-4);
    }

    .docs-hero h1 {
        font-size: var(--font-size-2xl);
    }

    .docs-hero p {
        font-size: var(--font-size-base);
    }

    .docs-cards {
        grid-template-columns: 1fr;
    }

    .docs-content > h1:first-child {
        font-size: var(--font-size-2xl);
    }

    .docs-content h2 {
        font-size: var(--font-size-xl);
    }

    .docs-content h3 {
        font-size: var(--font-size-lg);
    }

    .docs-section-header h1 {
        font-size: var(--font-size-2xl);
    }

    .docs-quick-grid {
        flex-direction: column;
    }

    .docs-nav-footer {
        flex-direction: column;
        gap: var(--space-3);
    }

    /* Breadcrumbs mobile styling - use inline display to allow natural wrapping */
    .docs-breadcrumbs {
        display: block;
        font-size: var(--font-size-xs);
        line-height: 1.8;
    }

    .docs-breadcrumbs > a,
    .docs-breadcrumbs > .current {
        display: inline;
    }

    .docs-breadcrumbs .separator {
        font-size: 8px;
        display: inline;
        margin: 0 var(--space-1);
    }

    .docs-content .pure-g {
        flex-direction: column;
    }

    .docs-content .video-container {
        max-width: 100%;
    }

    .docs-content .image-cell,
    .docs-content .image-cell-qr {
        width: 100%;
    }
}

/* ========================================
   PAGE META INFO
   ======================================== */

.docs-page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-color);
}

.docs-reading-time,
.docs-last-updated {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-tertiary);
    font-size: var(--font-size-sm);
}

.docs-reading-time i,
.docs-last-updated i {
    color: var(--primary-color);
}

/* ========================================
   CODE COPY BUTTON
   ======================================== */

.docs-code-wrapper {
    position: relative;
}

.docs-copy-btn {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    padding: var(--space-2);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    cursor: pointer;
    opacity: 0;
    transition: all var(--transition-fast);
    z-index: 1;
}

.docs-code-wrapper:hover .docs-copy-btn {
    opacity: 1;
}

.docs-copy-btn:hover {
    background: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.docs-copy-btn.copied {
    background: var(--success-light, rgba(16, 185, 129, 0.1));
    color: var(--success, #10b981);
    border-color: var(--success, #10b981);
}

/* ========================================
   SCROLL TO TOP BUTTON
   ======================================== */

.docs-scroll-top {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--primary-color);
    color: var(--white);
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-fast);
    z-index: var(--z-fixed);
    display: flex;
    align-items: center;
    justify-content: center;
}

.docs-scroll-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.docs-scroll-top:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .docs-scroll-top {
        bottom: calc(var(--space-6) + 60px);
    }
}

/* ========================================
   ENHANCED NAV FOOTER
   ======================================== */

.docs-nav-footer {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    margin-top: var(--space-12);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border-color);
}

.docs-nav-prev,
.docs-nav-next {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    min-width: 200px;
    max-width: 45%;
}

.docs-nav-prev:hover,
.docs-nav-next:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.docs-nav-prev i,
.docs-nav-next i {
    color: var(--primary-color);
    font-size: var(--font-size-lg);
}

.docs-nav-link-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.docs-nav-label {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.docs-nav-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
}

.docs-nav-next {
    margin-left: auto;
    text-align: right;
}

.docs-nav-next .docs-nav-link-content {
    align-items: flex-end;
}

/* ========================================
   TOC ACTIVE STATE
   ======================================== */

.docs-toc a.active {
    color: var(--primary-color);
    font-weight: var(--font-weight-medium);
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .docs-sidebar,
    .docs-sidebar-toggle,
    .docs-toc,
    .docs-overlay,
    .docs-nav-footer,
    .docs-scroll-top,
    .docs-copy-btn,
    .docs-progress-bar,
    .docs-search {
        display: none !important;
    }

    .docs-main {
        margin-left: 0;
        padding: 0;
    }

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

    .docs-content img {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ==========================================================================
   Space & version switchers
   ========================================================================== */

.docs-space-switcher,
.docs-version-switcher {
    margin-bottom: var(--space-4);
}

.docs-space-switcher label,
.docs-version-switcher label {
    display: block;
    margin-bottom: var(--space-1);
    color: var(--text-tertiary);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.docs-select {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.docs-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-overlay-light);
}

/* ==========================================================================
   Draft preview banner
   ========================================================================== */

.docs-draft-banner {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
    padding: var(--space-3) var(--space-4);
    background: var(--warning-overlay, rgba(234, 179, 8, 0.12));
    border: 1px solid var(--warning-color, #eab308);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

/* ==========================================================================
   Empty states
   ========================================================================== */

.docs-empty {
    padding: var(--space-6);
    color: var(--text-tertiary);
    font-size: var(--font-size-sm);
    text-align: center;
}

/* ==========================================================================
   Version indicator & outdated-version warning
   ========================================================================== */

.docs-version-current {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.docs-version-warning {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
    padding: var(--space-3) var(--space-4);
    background: var(--warning-overlay, rgba(234, 179, 8, 0.12));
    border: 1px solid var(--warning-color, #eab308);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

.docs-version-warning span {
    flex: 1 1 auto;
}

.docs-version-warning a {
    color: var(--primary-color);
    font-weight: 600;
    white-space: nowrap;
}
