/* Documentation Page Styles */

@media only screen and (min-width: 769px) {

    /* Docs page body detection and layout adjustments */
    body:has(.docs-container) .header {
        margin-left: 300px;
        /* Offset by sidebar width */
        width: calc(100% - 300px);
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid #e1e5e9;
        transition: all 0.3s ease;
    }

    body:has(.docs-container) .footer {
        margin-left: 300px;
        /* Offset by sidebar width */
        width: calc(100% - 300px);
        background: #2c3e50;
        border-radius: 0;
        /* Remove border radius for flush layout */
    }

    body:has(.docs-container) .main {
        padding: 0;
        /* Remove default main padding since docs handles its own */
        background: transparent;
    }

    /* Fallback for browsers that don't support :has() */
    .docs-page .header {
        margin-left: 300px;
        width: calc(100% - 300px);
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid #e1e5e9;
        transition: all 0.3s ease;
    }

    .docs-page .footer {
        margin-left: 300px;
        width: calc(100% - 300px);
        background: #2c3e50;
        border-radius: 0;
    }

    .docs-page .main {
        padding: 0;
        background: transparent;
    }
}

.docs-container {
    display: flex;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
    background: #fafafa;
}

/* Sidebar Navigation */
.docs-sidebar {
    width: 300px;
    background: #fff;
    border-right: 1px solid #e1e5e9;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

.sidebar-header {
    padding: 2rem 1.5rem 1rem;
    border-bottom: 1px solid #e1e5e9;
    background: #f8f9fa;
}

.sidebar-header h2 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 600;
}

.search-container {
    position: relative;
}

#docs-search {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #fff;
    transition: border-color 0.2s;
}

#docs-search:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.25rem;
}

.sidebar-content {
    padding: 1rem 0;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section h3 {
    padding: 0 1.5rem;
    margin: 0 0 0.5rem 0;
    color: #495057;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-section li {
    margin: 0;
}

.nav-section a {
    display: block;
    padding: 0.5rem 1.5rem;
    color: #6c757d;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-section a:hover {
    color: #007bff;
    background: #f8f9fa;
    border-left-color: #007bff;
}

.nav-section a.active {
    color: #007bff;
    background: #e3f2fd;
    border-left-color: #007bff;
    font-weight: 500;
}

/* Main Content */
.docs-main {
    flex: 1;
    margin-left: 300px;
    padding: 2rem 3rem 2rem 2rem;
    max-width: calc(100% - 300px);
}

.docs-content {
    max-width: 900px;
}

.docs-section {
    margin-bottom: 4rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e1e5e9;
}

.docs-section:last-child {
    border-bottom: none;
}

.docs-section h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    line-height: 1.2;
}

.docs-section h2 {
    color: #2c3e50;
    font-size: 2rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    padding-top: 1rem;
}

.docs-section h3 {
    color: #34495e;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
}

.docs-section h4 {
    color: #34495e;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem 0;
}

.docs-section p {
    color: #5a6c7d;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.lead {
    font-size: 1.2rem;
    color: #495057;
    margin-bottom: 2rem;
    font-weight: 400;
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e1e5e9;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: #2c3e50;
    font-size: 1.2rem;
    margin: 0 0 0.75rem 0;
}

.feature-card p {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #007bff;
    display: block;
}

.stat-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Step Container */
.step-container {
    margin: 2rem 0;
}

.step {
    display: flex;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e1e5e9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.step-number {
    width: 40px;
    height: 40px;
    background: #007bff;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-right: 1.5rem;
}

.step-content {
    overflow: hidden;
}

.step-content h3 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
}

.step-content p {
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-primary {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.btn-primary:hover {
    background: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: #007bff;
    border-color: #007bff;
}

.btn-outline:hover {
    background: #007bff;
    color: white;
}

/* Dashboard Guide */
.dashboard-guide {
    display: grid;
    gap: 1rem;
    margin: 2rem 0;
}

.guide-item {
    padding: 1.5rem;
    background: #fff;
    border-radius: 8px;
    border-left: 4px solid #007bff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.guide-item h3 {
    margin: 0 0 0.75rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.guide-item p {
    margin: 0;
    color: #6c757d;
}

/* Format Grid */
.format-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.format-category {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.format-category h4 {
    color: #2c3e50;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e1e5e9;
}

.format-category ul {
    margin: 0;
    padding-left: 1.5rem;
}

.format-category li {
    margin-bottom: 0.5rem;
    color: #5a6c7d;
}

.format-category strong {
    color: #2c3e50;
}

/* Classification Grid */
.classification-grid {
    display: grid;
    gap: 1.5rem;
    margin: 2rem 0;
}

.classification-item {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.classification-item h4 {
    color: #2c3e50;
    margin: 0 0 0.75rem 0;
}

.classification-item p {
    margin-bottom: 1rem;
}

.example {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    border-left: 3px solid #007bff;
    font-size: 0.9rem;
}

.example strong {
    color: #2c3e50;
}

/* Workflow Steps */
.workflow-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 2rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

.workflow-step {
    flex: 1;
    min-width: 150px;
    text-align: center;
    background: #fff;
    padding: 1.5rem 1rem;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.workflow-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.workflow-step h4 {
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.workflow-step p {
    margin: 0;
    color: #6c757d;
    font-size: 0.85rem;
}

.workflow-arrow {
    color: #007bff;
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
}

/* Code Examples */

pre {
    position: relative;
}

.code-example {
    margin: 1.5rem 0;
}

.code-example h4 {
    color: #2c3e50;
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
}

.copy-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0 10px;
    transition: 0.2s;
}

/* Tables */
.config-table,
.comparison-table,
.error-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.config-table th,
.comparison-table th,
.error-table th {
    background: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
}

.config-table td,
.comparison-table td,
.error-table td {
    padding: 1rem;
    border-bottom: 1px solid #e1e5e9;
    color: #5a6c7d;
}

.config-table tr:last-child td,
.comparison-table tr:last-child td,
.error-table tr:last-child td {
    border-bottom: none;
}

/* Status Grid */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.status-item {
    text-align: center;
    padding: 1.5rem;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Plans Grid */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.plan-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e1e5e9;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.plan-card:hover {
    transform: translateY(-4px);
}

.plan-card.popular {
    border-color: #007bff;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.2);
}

.plan-header {
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
    position: relative;
}

.plan-badge {
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    background: #007bff;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0 0 8px 8px;
    font-size: 0.8rem;
    font-weight: 600;
}

.plan-card h3 {
    color: #2c3e50;
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
}

.plan-price {
    margin-bottom: 0.5rem;
}

.plan-price .amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
}

.plan-price .period {
    color: #6c757d;
    font-size: 1rem;
}

.plan-savings {
    color: #28a745;
    font-size: 0.9rem;
    font-weight: 500;
}

.plan-features {
    padding: 0 1.5rem 1.5rem;
}

.plan-features h4 {
    color: #2c3e50;
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
}

.plan-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.plan-features li {
    padding: 0.5rem 0;
    color: #5a6c7d;
    border-bottom: 1px solid #f1f3f4;
}

.plan-features li:last-child {
    border-bottom: none;
}

.plan-ideal {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e1e5e9;
    font-size: 0.9rem;
    color: #5a6c7d;
    height: 100%;
}

/* Credit Info */
.credit-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.credit-cost,
.credit-tracking {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.credit-cost h4,
.credit-tracking h4 {
    color: #2c3e50;
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
}

.credit-cost ul,
.credit-tracking ul {
    margin: 0;
    padding-left: 1.5rem;
}

.credit-cost li,
.credit-tracking li {
    margin-bottom: 0.5rem;
    color: #5a6c7d;
}

/* Credit Sources */
.credit-sources {
    display: grid;
    gap: 1.5rem;
    margin: 2rem 0;
}

.source-item {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #007bff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.source-item h4 {
    color: #2c3e50;
    margin: 0 0 0.75rem 0;
}

.source-item ul {
    margin: 0.75rem 0 0 0;
    padding-left: 1.5rem;
}

.source-item li {
    margin-bottom: 0.25rem;
    color: #5a6c7d;
}

/* Management Tips */
.management-tips {
    margin: 2rem 0;
}

.tip {
    background: #e8f4fd;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.tip h4 {
    color: #2c3e50;
    margin: 0 0 1rem 0;
}

.tip ul {
    margin: 0;
    padding-left: 1.5rem;
}

.tip li {
    margin-bottom: 0.5rem;
    color: #5a6c7d;
}

/* WCAG Principles */
.wcag-principles {
    display: grid;
    gap: 1.5rem;
    margin: 2rem 0;
}

.principle {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.principle h4 {
    color: #2c3e50;
    margin: 0 0 0.75rem 0;
}

.principle p {
    margin-bottom: 0.75rem;
}

.compliance-check {
    background: #d4edda;
    color: #155724;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Best Practices */
.best-practices {
    display: grid;
    gap: 1.5rem;
    margin: 2rem 0;
}

.practice {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.practice h4 {
    color: #2c3e50;
    margin: 0 0 1rem 0;
}

.practice ul {
    margin: 0 0 1rem 0;
    padding-left: 1.5rem;
}

.practice li {
    margin-bottom: 0.5rem;
    color: #5a6c7d;
}

/* Testing Tools */
.testing-tools h4 {
    color: #2c3e50;
    margin: 1.5rem 0 1rem 0;
}

.testing-tools ul {
    margin: 0 0 1.5rem 0;
    padding-left: 1.5rem;
}

.testing-tools li {
    margin-bottom: 0.5rem;
    color: #5a6c7d;
}

.testing-tools strong {
    color: #2c3e50;
}

/* API Overview */
.api-overview {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #007bff;
    margin: 2rem 0;
}

.api-details {
    display: grid;
    gap: 0.75rem;
}

.api-detail {
    font-size: 0.9rem;
    color: #5a6c7d;
}

.api-detail strong {
    color: #2c3e50;
}

/* Auth Section */
.auth-section {
    margin: 2rem 0;
}

.auth-note {
    background: #fff3cd;
    color: #856404;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* Endpoints */
.endpoint {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    margin: 2rem 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.endpoint h4 {
    background: #f8f9fa;
    color: #2c3e50;
    margin: 0;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e1e5e9;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.endpoint-details {
    padding: 1.5rem;
}

.endpoint-details h5 {
    color: #2c3e50;
    margin: 1.5rem 0 0.75rem 0;
    font-size: 1rem;
}

.endpoint-details h5:first-child {
    margin-top: 0;
}

/* Error Handling */
.error-handling {
    margin: 2rem 0;
}

.error-codes {
    margin: 1.5rem 0;
}

.error-codes h4 {
    color: #2c3e50;
    margin: 0 0 1rem 0;
}

/* Troubleshooting */
.troubleshooting-grid {
    display: grid;
    gap: 2rem;
    margin: 2rem 0;
}

.issue {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.issue h3 {
    background: #f8f9fa;
    color: #2c3e50;
    margin: 0;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e1e5e9;
}

.symptoms,
.solutions {
    padding: 1.5rem;
    border-bottom: 1px solid #e1e5e9;
}

.symptoms:last-child,
.solutions:last-child {
    border-bottom: none;
}

.symptoms h4,
.solutions h4 {
    color: #2c3e50;
    margin: 0 0 1rem 0;
    font-size: 1rem;
}

.symptoms ul,
.solutions ol {
    margin: 0;
    padding-left: 1.5rem;
}

.symptoms li,
.solutions li {
    margin-bottom: 0.5rem;
    color: #5a6c7d;
}

.code-fix {
    padding: 1.5rem;
    background: #f8f9fa;
}

.code-fix h4 {
    color: #2c3e50;
    margin: 0 0 1rem 0;
    font-size: 1rem;
}

/* Help Section */
.help-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.help-option {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.help-option h4 {
    color: #2c3e50;
    margin: 0 0 1rem 0;
}

.help-option p {
    margin-bottom: 0.5rem;
    color: #5a6c7d;
    font-size: 0.9rem;
}

.help-option strong {
    color: #2c3e50;
}

/* FAQ */
.faq-grid {
    display: grid;
    gap: 2rem;
    margin: 2rem 0;
}

.faq-category {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.faq-category h3 {
    background: #f8f9fa;
    color: #2c3e50;
    margin: 0;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e1e5e9;
}

.faq-item {
    padding: 1.5rem;
    border-bottom: 1px solid #e1e5e9;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item h4 {
    color: #2c3e50;
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
}

.faq-item p {
    margin: 0;
    color: #5a6c7d;
}

.faq-contact {
    background: #e8f4fd;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    margin: 2rem 0;
}

.faq-contact h3 {
    color: #2c3e50;
    margin: 0 0 1rem 0;
}

.faq-contact p {
    margin-bottom: 1.5rem;
    color: #5a6c7d;
}

.contact-options {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Table of Contents */
.docs-toc {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 250px;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    z-index: 50;
}

.docs-toc h3 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 600;
}

.toc-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-nav li {
    margin-bottom: 0.25rem;
}

.toc-nav a {
    display: block;
    color: #6c757d;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.25rem 0;
    transition: color 0.2s;
}

.toc-nav a:hover {
    color: #007bff;
}

.toc-nav a.active {
    color: #007bff;
    font-weight: 500;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.back-to-top.visible {
    opacity: 1;
}

.back-to-top:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .docs-toc {
        display: none;
    }
}

@media (max-width: 768px) {
    .docs-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .docs-sidebar.open {
        transform: translateX(0);
    }

    .docs-main {
        margin-left: 0;
        max-width: 100%;
        padding: 1rem;
    }

    .docs-content {
        max-width: 100%;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .plans-grid {
        grid-template-columns: 1fr;
    }

    .workflow-steps {
        flex-direction: column;
    }

    .workflow-arrow {
        transform: rotate(90deg);
    }

    .contact-options {
        flex-direction: column;
    }

    .step {
        flex-direction: column;
        text-align: center;
    }

    .step-number {
        margin: 0 0 1rem 0;
        align-self: center;
    }
}

@media (max-width: 480px) {
    .docs-section h1 {
        font-size: 2rem;
    }

    .docs-section h2 {
        font-size: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .sidebar-header {
        padding: 1rem;
    }

    .docs-main {
        padding: 0.5rem;
    }
}

/* Print Styles */
@media print {

    .docs-sidebar,
    .docs-toc,
    .back-to-top {
        display: none;
    }

    .docs-main {
        margin-left: 0;
        max-width: 100%;
    }

    .docs-section {
        page-break-inside: avoid;
    }

}

/* Focus Styles for Accessibility */
a:focus,
button:focus,
input:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .docs-container {
        background: #fff;
    }

    .feature-card,
    .plan-card,
    .guide-item {
        border-width: 2px;
    }

    .btn-primary {
        border-width: 2px;
    }
}

/* Docs page header and footer offset (when sidebar is present) */
.app-header:has(.docs-container) {
    margin-left: 300px;
    width: calc(100% - 300px);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.app-footer:has(.docs-container) {
    margin-left: 300px;
    width: calc(100% - 300px);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

/* Fallback for browsers without :has() support */
.docs-page .header {
    margin-left: 300px;
    width: calc(100% - 300px);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.docs-page .footer {
    margin-left: 300px;
    width: calc(100% - 300px);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

/* Mobile responsive: remove offset on smaller screens */
@media (max-width: 768px) {

    .app-header:has(.docs-container),
    .docs-page .header {
        margin-left: 0;
        width: 100%;
    }

    .app-footer:has(.docs-container),
    .docs-page .footer {
        margin-left: 0;
        width: 100%;
    }
}