/* Documentation Page Specific Styles */

.docs-container {
    display: flex;
    min-height: calc(100vh - 80px);
    position: relative;
}

/* Documentation Sidebar */
.docs-sidebar {
    width: 280px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
    padding: 2rem 0;
}

.docs-nav {
    padding: 0 1.5rem;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-section h4 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-600);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.nav-section ul {
    list-style: none;
}

.nav-section li {
    margin-bottom: 0.5rem;
}

.nav-section a {
    color: var(--gray-700);
    text-decoration: none;
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.nav-section a:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.nav-section a.active {
    background: var(--primary);
    color: var(--white);
    font-weight: 500;
}

/* Documentation Content */
.docs-content {
    flex: 1;
    max-width: 900px;
    padding: 3rem;
    background: var(--white);
}

.doc-section {
    margin-bottom: 4rem;
    scroll-margin-top: 100px;
}

.doc-section h1 {
    font-size: 2.5rem;
    color: var(--dark);
    margin-bottom: 1rem;
}

.doc-section h2 {
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray-200);
}

.doc-section h3 {
    font-size: 1.5rem;
    color: var(--dark);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.doc-section h4 {
    font-size: 1.125rem;
    color: var(--dark);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.doc-section p {
    line-height: 1.7;
    color: var(--gray-700);
    margin-bottom: 1rem;
}

.doc-section ul, .doc-section ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.doc-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: var(--gray-700);
}

/* Version Badge */
.version-badge {
    display: inline-block;
    background: var(--success);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* Lead Text */
.lead {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--gray-600);
    margin-bottom: 2rem;
}

/* Info Box */
.info-box {
    background: var(--gray-100);
    border-left: 4px solid var(--primary);
    padding: 1.5rem;
    border-radius: 6px;
    margin: 2rem 0;
}

.info-box h4 {
    margin-top: 0;
    color: var(--primary);
}

/* Code Blocks */
.code-block {
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
    background: #1a1a2e;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.code-header {
    background: #16213e;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.code-header span {
    color: var(--secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    font-weight: 600;
}

.copy-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--gray-400);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--secondary);
    color: var(--secondary);
}

.code-block pre {
    margin: 0;
    padding: 1.5rem;
    overflow-x: auto;
}

.code-block code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #e0e0e0;
}

/* Inline Code */
p code, li code, td code {
    background: var(--gray-100);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: var(--danger);
}

/* Tables */
.api-table, .metrics-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.api-table th, .metrics-table th {
    background: var(--gray-100);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
    border-bottom: 2px solid var(--gray-300);
}

.api-table td, .metrics-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.api-table tr:hover, .metrics-table tr:hover {
    background: var(--gray-50);
}

/* Component Cards */
.component-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s;
}

.component-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.component-card h4 {
    color: var(--primary);
    margin-top: 0;
}

/* Requirements List */
.requirements-list {
    background: var(--gray-100);
    border-radius: 6px;
    padding: 1.5rem 2rem;
    margin: 1.5rem 0;
}

.requirements-list li {
    position: relative;
    padding-left: 1.5rem;
}

.requirements-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

/* Security Layers */
.security-layers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.layer {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1.5rem;
    border-top: 4px solid var(--primary);
}

.layer h4 {
    color: var(--primary);
    margin-top: 0;
    margin-bottom: 1rem;
}

/* Best Practice Boxes */
.best-practice {
    background: var(--gray-100);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.best-practice h4 {
    color: var(--dark);
    margin-top: 0;
}

/* Performance Tips */
.performance-tip {
    background: linear-gradient(135deg, #e3f2fd, #e8f5e9);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.performance-tip h4 {
    color: var(--primary);
    margin-top: 0;
}

/* Troubleshooting Items */
.troubleshooting-item {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.troubleshooting-item h4 {
    color: var(--danger);
    margin-top: 0;
}

.troubleshooting-item p strong {
    color: var(--dark);
}

/* FAQ Items */
.faq-item {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.faq-item h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

/* Support Grid */
.support-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.support-card {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s;
}

.support-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.support-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.support-contact {
    color: var(--primary);
    font-weight: 600;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-5px);
}

/* Documentation Footer */
.docs-footer {
    background: var(--dark);
    color: var(--white);
    padding: 1.5rem 0;
    text-align: center;
    margin-top: 4rem;
}

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

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

/* Architecture Diagram */
.architecture-diagram {
    margin: 2rem 0;
    padding: 2rem;
    background: var(--gray-100);
    border-radius: 8px;
    text-align: center;
}

.architecture-diagram img {
    max-width: 100%;
    height: auto;
}

/* Responsive */
@media (max-width: 1024px) {
    .docs-sidebar {
        width: 240px;
    }
}

@media (max-width: 768px) {
    .docs-container {
        flex-direction: column;
    }

    .docs-sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
    }

    .docs-content {
        padding: 2rem 1.5rem;
    }

    .security-layers,
    .support-grid {
        grid-template-columns: 1fr;
    }
}