/**
 * Main Documentation System Styles - Docusaurus-inspired
 */

/* Layout */
.docs-container {
    display: flex;
    min-height: 100vh;
    background-color: var(--docs-bg-primary);
}

/* Header - Docusaurus Style */
.docs-header {
    background-color: var(--docs-header-bg);
    border-bottom: 1px solid var(--docs-header-border);
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--docs-shadow-sm);
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .docs-header {
    background-color: rgba(24, 25, 32, 0.8);
}

.docs-header-content {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.docs-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--docs-text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
}

.docs-logo:hover {
    color: var(--docs-accent-color);
    text-decoration: none;
}

.docs-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Sidebar - Docusaurus Style */
.docs-sidebar {
    width: 300px;
    background-color: var(--docs-sidebar-bg);
    border-right: 1px solid var(--docs-sidebar-border);
    padding: 1rem 0;
    overflow-y: auto;
    overflow-x: hidden;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.docs-sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.docs-sidebar-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.docs-sidebar-nav-item {
    margin: 0;
}

.docs-sidebar-nav-link {
    display: block;
    padding: 0.5rem 1.5rem;
    color: var(--docs-text-secondary);
    border-radius: 0;
    transition: all 0.15s ease;
    font-size: 0.875rem;
    border-left: 3px solid transparent;
    text-decoration: none;
}

.docs-sidebar-nav-link:hover {
    background-color: var(--docs-sidebar-hover);
    color: var(--docs-text-primary);
    text-decoration: none;
    border-left-color: var(--docs-border-color);
}

.docs-sidebar-nav-link.active {
    background-color: var(--docs-sidebar-hover);
    color: var(--docs-accent-color);
    font-weight: 600;
    border-left-color: var(--docs-accent-color);
}

.docs-sidebar-nav-link.active:hover {
    color: var(--docs-accent-hover);
    border-left-color: var(--docs-accent-hover);
}

.docs-sidebar-category {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    padding: 0 1.5rem;
}

.docs-sidebar-category:first-child {
    margin-top: 0.5rem;
}

.docs-sidebar-category-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--docs-text-muted);
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
}

/* Main Content - Docusaurus Style */
.docs-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.docs-main-content {
    flex: 1;
    padding: 2rem 3rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.docs-content {
    line-height: 1.7;
    font-size: 1rem;
    color: var(--docs-text-secondary);
}

.docs-content h1 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--docs-border-color);
    color: var(--docs-text-primary);
}

.docs-content h2 {
    margin-top: 3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--docs-border-color);
    color: var(--docs-text-primary);
}

.docs-content h2:first-of-type {
    margin-top: 2rem;
}

.docs-content h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--docs-text-primary);
}

.docs-content h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--docs-text-primary);
}

.docs-content p {
    margin-bottom: 1.25rem;
}

.docs-content ul,
.docs-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.docs-content li {
    margin-bottom: 0.5rem;
    color: var(--docs-text-secondary);
    line-height: 1.7;
}

.docs-content li {
    margin-bottom: 0.25rem;
}

.docs-content blockquote {
    border-left: 4px solid var(--docs-accent-color);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: var(--docs-text-secondary);
    font-style: italic;
    background-color: var(--docs-bg-secondary);
    padding: 1rem 1.5rem;
    border-radius: 0 6px 6px 0;
}

.docs-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    display: block;
    overflow-x: auto;
}

.docs-content table th,
.docs-content table td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--docs-border-color);
    text-align: left;
}

.docs-content table th {
    background-color: var(--docs-bg-secondary);
    font-weight: 600;
    color: var(--docs-text-primary);
}

.docs-content table tr:nth-child(even) {
    background-color: var(--docs-bg-secondary);
}

.docs-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 1.5rem 0;
}

.docs-content hr {
    border: none;
    border-top: 1px solid var(--docs-border-color);
    margin: 2rem 0;
}

/* Search - Expandable Style */
.docs-search {
    position: relative;
    display: flex;
    align-items: center;
}

.docs-search-toggle {
    background: none;
    border: 1px solid var(--docs-border-color);
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--docs-text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    transition: all 0.2s ease;
    background-color: var(--docs-bg-secondary);
}

.docs-search-toggle:hover {
    background-color: var(--docs-bg-tertiary);
    border-color: var(--docs-accent-color);
    color: var(--docs-accent-color);
}

.docs-search-icon {
    width: 20px;
    height: 20px;
    color: inherit;
}

.docs-search-expanded {
    display: none;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--docs-bg-primary);
    border: 1px solid var(--docs-border-color);
    border-radius: 6px;
    box-shadow: var(--docs-shadow-lg);
    padding: 0.5rem;
    z-index: 1000;
    align-items: center;
    gap: 0.5rem;
    min-width: 300px;
    animation: docs-search-expand 0.2s ease;
}

.docs-search.expanded .docs-search-expanded {
    display: flex;
}

.docs-search.expanded .docs-search-toggle {
    display: none;
}

.docs-search-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: none;
    background: transparent;
    color: var(--docs-text-primary);
    outline: none;
    min-width: 250px;
}

.docs-search-input::placeholder {
    color: var(--docs-text-muted);
}

.docs-search-close {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--docs-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.docs-search-close:hover {
    background-color: var(--docs-bg-secondary);
    color: var(--docs-text-primary);
}

@keyframes docs-search-expand {
    from {
        opacity: 0;
        transform: translateY(-50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

@media (max-width: 768px) {
    .docs-search-expanded {
        position: fixed;
        left: 1rem;
        right: 1rem;
        top: 4rem;
        transform: none;
        min-width: auto;
        width: calc(100% - 2rem);
    }
    
    .docs-search-input {
        min-width: auto;
    }
}

/* Theme Toggle - Docusaurus Style */
.docs-theme-toggle {
    background: none;
    border: 1px solid var(--docs-border-color);
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--docs-text-secondary);
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--docs-bg-secondary);
}

.docs-theme-toggle:hover {
    background-color: var(--docs-bg-tertiary);
    border-color: var(--docs-accent-color);
    color: var(--docs-accent-color);
}

.docs-theme-toggle svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    transition: all 0.2s ease;
}

.docs-theme-toggle:hover svg {
    stroke-width: 2.5;
}

/* Mobile Menu Toggle */
.docs-mobile-menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--docs-border-color);
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--docs-text-primary);
    font-size: 1.25rem;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    background-color: var(--docs-bg-secondary);
    transition: all 0.2s ease;
}

.docs-mobile-menu-toggle:hover {
    background-color: var(--docs-bg-tertiary);
    border-color: var(--docs-accent-color);
}

/* Responsive */
@media (max-width: 996px) {
    .docs-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: var(--docs-shadow-lg);
    }

    .docs-sidebar.open {
        transform: translateX(0);
    }

    .docs-mobile-menu-toggle {
        display: flex;
    }

    .docs-main-content {
        padding: 1.5rem;
    }

    .docs-search-input {
        width: 200px;
    }

    .docs-header {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 576px) {
    .docs-search-input {
        width: 150px;
    }

    .docs-main-content {
        padding: 1rem;
    }
}

/* Breadcrumbs - Docusaurus Style */
.docs-breadcrumbs {
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--docs-text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.docs-breadcrumbs a {
    color: var(--docs-text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.docs-breadcrumbs a:hover {
    color: var(--docs-link-color);
    text-decoration: underline;
}

.docs-breadcrumbs span {
    color: var(--docs-text-muted);
}

/* Tags - Docusaurus Style */
.docs-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--docs-border-color);
}

.docs-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--docs-bg-secondary);
    border: 1px solid var(--docs-border-color);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--docs-text-secondary);
    transition: all 0.2s ease;
    text-decoration: none;
}

.docs-tag:hover {
    background-color: var(--docs-accent-light);
    border-color: var(--docs-accent-color);
    color: var(--docs-accent-color);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.docs-tags strong {
    margin-right: 0.5rem;
    color: var(--docs-text-primary);
    font-weight: 600;
}

/* Footer - Docusaurus Style */
.docs-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    padding-bottom: 2rem;
    border-top: 1px solid var(--docs-border-color);
    text-align: center;
    color: var(--docs-text-muted);
    font-size: 0.875rem;
    background-color: var(--docs-bg-secondary);
}

/* Overlay for mobile sidebar */
.docs-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.docs-sidebar-overlay.active {
    display: block;
    opacity: 1;
}

@media (min-width: 997px) {
    .docs-sidebar-overlay {
        display: none !important;
    }
}
