/* Documentation Page Styles */

body.docs-container-page {
    background: #fff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main.docs-container {
    flex: 1;
}

.docs-container {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 2rem;
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto 50px;
    width: 100%;
}

.docs-sidebar {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    background: transparent;
    border: none;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 transparent;
}

.docs-sidebar::-webkit-scrollbar {
    width: 6px;
}

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

.docs-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.docs-sidebar::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.docs-search {
    margin-bottom: 1.25rem;
}

/* Mobile menu toggle button */
.mobile-docs-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    align-items: center;
    justify-content: center;
}

.mobile-docs-toggle:hover {
    background: #0056b3;
    transform: scale(1.05);
}

.mobile-docs-toggle i {
    font-size: 24px;
}

.mobile-docs-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-docs-overlay.active {
    opacity: 1;
}

.docs-sidebar-header {
    display: none;
}

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

.search-input-wrapper i {
    position: absolute;
    left: 0.75rem;
    color: #9ca3af;
    font-size: 1rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.625rem 0.75rem 0.625rem 2.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.8125rem;
    transition: all 0.2s ease;
    background: #fff;
    font-weight: 400;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.search-input::placeholder {
    color: #999;
    font-weight: 400;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1);
    background: #fff;
}

.search-results {
    margin-top: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.search-result-item {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    font-size: 0.875rem;
    text-decoration: none;
    color: #374151;
    display: block;
    transition: all 0.15s ease;
}

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

.search-result-item:hover {
    background: #f0f7ff;
    color: #007bff;
}

.search-result-item strong {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.search-result-item .desc {
    font-size: 0.85rem;
    color: #666;
}

.docs-nav {
    margin-top: 0;
}

.nav-category {
    margin-bottom: 1.5rem;
}

.nav-category:last-child {
    margin-bottom: 0;
}

.nav-category h4 {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6b7280;
    margin: 0 0 0.5rem 0;
    letter-spacing: 0.05em;
    padding: 0.375rem 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.nav-category h4:hover {
    background: #f3f4f6;
    color: #374151;
}

.nav-category h4::after {
    content: '▼';
    font-size: 0.625rem;
    transition: transform 0.2s ease;
    opacity: 0.6;
}

.nav-category.collapsed h4::after {
    transform: rotate(-90deg);
}

.nav-category.collapsed ul {
    display: none;
}

.nav-category ul {
    list-style: none;
    padding: 0;
    margin: 0;
    background: transparent;
    border-radius: 0;
    overflow: visible;
    border: none;
}

.nav-item {
    margin: 0;
}

.docs-sidebar .nav-item a {
    display: block;
    padding: 0.5rem 0.625rem;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.15s ease;
    font-size: 0.8125rem;
    line-height: 1.4;
    font-weight: 400;
    position: relative;
}

.docs-sidebar .nav-item a:hover {
    background: #f3f4f6;
    color: #1f2937;
    padding-left: 0.875rem;
}

.docs-sidebar .nav-item.active a {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 500;
    padding-left: 0.875rem;
}

.docs-sidebar .nav-item.active a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: #2563eb;
    border-radius: 2px;
}

.docs-content {
    grid-column: 2;
    min-height: 60vh;
}

.breadcrumb-nav {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.breadcrumb-nav a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.breadcrumb-nav a:hover {
    text-decoration: underline;
    color: #0056b3;
}

.breadcrumb-nav + .article-header {
    padding-top: 0;
}

.article-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.article-header h1 {
    margin: 0 0 0.75rem 0;
    font-size: 2.75rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
}

.article-meta {
    font-size: 0.9rem;
    color: #999;
    margin: 0;
    font-weight: 500;
}

.table-of-contents {
    background: linear-gradient(135deg, #f9f9f9 0%, #fafbfc 100%);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2.5rem;
    border-left: 4px solid #007bff;
    height: fit-content;
}

.table-of-contents h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.table-of-contents ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.table-of-contents li {
    margin-bottom: 0.5rem;
}

.table-of-contents a {
    color: #007bff;
    text-decoration: none;
    font-size: 0.95rem;
    display: inline-block;
    transition: all 0.2s;
}

.table-of-contents a:hover {
    text-decoration: underline;
    color: #0056b3;
}

.article-body {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #333;
}

.article-body h2 {
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    border-top: 2px solid #f0f0f0;
    padding-top: 1.5rem;
}

.article-body h2:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.article-body h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    font-weight: 600;
    color: #333;
}

.article-body h4 {
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #555;
}

.article-body p {
    margin-bottom: 1.25rem;
}

.article-body ul,
.article-body ol {
    margin-bottom: 1.5rem;
    margin-left: 2rem;
    padding-left: 0;
}

.article-body li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

.article-body code {
    background: #f5f5f5;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: 'Monaco', 'Courier New', monospace;
    color: #d63384;
}

.article-body pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1.5rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.article-body pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.article-body a {
    color: #007bff;
    text-decoration: none;
    transition: all 0.2s;
}

.article-body a:hover {
    text-decoration: underline;
    color: #0056b3;
}

.docs-feedback {
    margin-top: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f0f7ff 0%, #fafbfc 100%);
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.docs-feedback p {
    margin-bottom: 1rem;
    font-weight: 500;
    color: #333;
    font-size: 1rem;
}

.feedback-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.feedback-btn {
    padding: 0.65rem 1.25rem;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s;
}

.feedback-btn:hover {
    border-color: #007bff;
    color: #007bff;
    background: #f0f7ff;
}

.feedback-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 100px;
    display: none;
    margin-bottom: 0.5rem;
}

.feedback-textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.docs-related {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #f0f0f0;
}

.docs-related h4 {
    margin-top: 0;
    margin-bottom: 1.25rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

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

.docs-related li {
    margin-bottom: 0.75rem;
}

.docs-related a {
    color: #007bff;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.docs-related a:hover {
    text-decoration: underline;
    color: #0056b3;
}

.docs-quick-links {
    position: sticky;
    top: 100px;
    height: fit-content;
    max-height: calc(100vh - 120px);
    grid-column: 3;
}

.quick-link-card {
    padding: 1.5rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    transition: all 0.3s;
}

.quick-link-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
}

.quick-link-card h5 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.quick-link-card p {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
}

.quick-link-card .btn {
    display: block;
    text-align: center;
    width: 100%;
    padding: 0.65rem 1rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
}

.quick-link-card .btn:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.quick-link-card .btn-outline {
    background: white;
    color: #007bff;
    border: 1px solid #007bff;
}

.quick-link-card .btn-outline:hover {
    background: #f0f7ff;
}

@media (max-width: 1200px) {
    .docs-container {
        grid-template-columns: 250px 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    .docs-quick-links {
        display: none;
    }
}

/* Feature Cards Grid */
.docs-feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.docs-feature-card {
    padding: 1.5rem;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.docs-feature-card h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.docs-feature-card p {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.docs-feature-card a {
    color: #007bff;
    font-weight: 600;
    text-decoration: none;
}

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

.docs-feature-card.featured-green {
    border-left-color: #28a745;
}

.docs-feature-card.featured-yellow {
    border-left-color: #ffc107;
}

.docs-feature-card.featured-teal {
    border-left-color: #17a2b8;
}

.docs-feature-card.featured-purple {
    border-left-color: #6f42c1;
}

.docs-feature-card.featured-red {
    border-left-color: #dc3545;
}

/* Popular Topics List */
.docs-topics-list {
    columns: 2;
    gap: 2rem;
}

.docs-topics-list li {
    margin-bottom: 0.5rem;
}

.docs-topics-list a {
    color: #007bff;
    text-decoration: none;
}

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

/* Quick Links in Sidebar */
.quick-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quick-links-list li {
    margin-bottom: 0.5rem;
}

.quick-links-list a {
    color: #007bff;
    text-decoration: none;
}

.quick-links-list a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .docs-container {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    
    .docs-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: white;
        z-index: 999;
        overflow-y: auto;
        padding: 1.5rem;
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
        transition: left 0.3s ease;
    }
    
    .docs-sidebar.mobile-open {
        left: 0;
    }
    
    .docs-sidebar-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
        border-bottom: 2px solid #f0f0f0;
    }
    
    .docs-sidebar-header h3 {
        margin: 0;
        font-size: 1.1rem;
        font-weight: 600;
        color: #1a1a1a;
    }
    
    .mobile-close-sidebar {
        background: none;
        border: none;
        color: #666;
        cursor: pointer;
        padding: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 4px;
        transition: all 0.2s;
    }
    
    .mobile-close-sidebar:hover {
        background: #f3f4f6;
        color: #1a1a1a;
    }
    
    .mobile-docs-toggle {
        display: flex;
    }
    
    .mobile-docs-overlay {
        display: block;
    }
    
    .docs-search {
        display: block !important;
        margin-bottom: 1.25rem;
    }
    
    .search-input-wrapper {
        display: flex !important;
    }
    
    .search-input {
        display: block !important;
        width: 100%;
    }
    
    .docs-quick-links {
        display: none;
    }
    
    .article-header h1 {
        font-size: 1.75rem;
    }
    
    .article-body {
        font-size: 1rem;
    }
    
    .article-body h2 {
        font-size: 1.5rem;
    }
    
    .docs-feature-cards {
        grid-template-columns: 1fr;
    }
    
    .docs-topics-list {
        columns: 1;
    }
}
