/* ==========================================================================
   TCSI API Documentation Page Styles
   ========================================================================== */

/* Container */
.tcsi-api-docs-container {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #334155;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.api-hero {
    background: #ffffff;
    color: #0f172a;
    padding: 80px 0;
    text-align: center;
}

.api-title {
    font-size: 3.5rem;
    margin: 0 0 20px 0;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.api-subtitle {
    font-size: 1.25rem;
    margin: 0 0 16px 0;
    color: #334155;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.api-description {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 32px;
    line-height: 1.8;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

.api-badges {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.api-badge {
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.badge-free {
    background: #dc2626;
}

.badge-rest {
    background: #0f172a;
}

.badge-json {
    background: #64748b;
}

.badge-secure {
    background: #334155;
}

.api-cta .btn {
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
}

.api-hero .btn-primary {
    background: #0f172a;
    color: #ffffff;
    border: 2px solid #0f172a;
}

.api-hero .btn-primary:hover {
    background: #1e293b;
    border-color: #1e293b;
    color: #ffffff;
}

/* ==========================================================================
   Stats Section
   ========================================================================== */

.api-stats {
    padding: 60px 0;
    background: #f8fafc;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    text-align: center;
}

.stat-item {
    background: #ffffff;
    padding: 32px 20px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.stat-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

/* ==========================================================================
   Documentation Section
   ========================================================================== */

.api-documentation {
    padding: 80px 0;
}

.section-title {
    color: #0f172a;
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 48px;
    letter-spacing: -0.02em;
}

.doc-section {
    background: #ffffff;
    padding: 40px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    margin-bottom: 32px;
}

.doc-section h3 {
    color: #0f172a;
    margin-bottom: 20px;
    font-size: 1.125rem;
    font-weight: 700;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

.doc-section p {
    color: #334155;
    line-height: 1.7;
}

.doc-section ul,
.doc-section ol {
    color: #334155;
    line-height: 1.8;
}

/* Base Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.info-item {
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    font-size: 0.95rem;
}

.info-item strong {
    color: #0f172a;
}

.info-item code {
    background: #0f172a;
    color: #e2e8f0;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

/* ==========================================================================
   Authentication
   ========================================================================== */

.auth-methods {
    display: grid;
    gap: 24px;
}

.auth-method h4 {
    color: #0f172a;
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: 600;
}

/* ==========================================================================
   Code Examples
   ========================================================================== */

.code-example {
    background: #0f172a;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 12px 0;
}

.code-example pre {
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.code-example code {
    font-family: 'JetBrains Mono', monospace;
    color: #e2e8f0;
}

/* ==========================================================================
   Endpoints
   ========================================================================== */

.endpoints-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.endpoint {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.endpoint:hover {
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.endpoint-header {
    background: #f8fafc;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.method {
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.method-get {
    background: #16a34a;
}

.endpoint-path {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
}

.endpoint-body {
    padding: 20px;
}

.endpoint-body p {
    margin: 0 0 12px 0;
}

.endpoint-params {
    margin-top: 12px;
}

.endpoint-params strong {
    color: #0f172a;
    font-size: 0.9rem;
}

.endpoint-params ul {
    margin: 12px 0;
    padding-left: 20px;
}

.endpoint-params li {
    margin: 8px 0;
    color: #334155;
}

.endpoint-params code {
    background: #f1f5f9;
    color: #0f172a;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 600;
}

.endpoint-example {
    margin-top: 12px;
}

.endpoint-example strong {
    font-size: 0.9rem;
    color: #64748b;
}

/* ==========================================================================
   Score Categories
   ========================================================================== */

.score-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.score-category {
    flex: 1 1 160px;
    text-align: center;
    padding: 20px 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease;
}

.score-category:hover {
    transform: translateY(-2px);
}

.category-excellent {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.category-very-good {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.category-good {
    background: #fefce8;
    border-color: #fde68a;
    color: #854d0e;
}

.category-fair {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.category-poor {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.score-range {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.score-label {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 1rem;
}

.score-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    opacity: 0.6;
}

/* ==========================================================================
   Error Codes
   ========================================================================== */

.error-codes {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.error-code {
    display: grid;
    grid-template-columns: 60px 180px 1fr;
    gap: 16px;
    align-items: center;
    padding: 16px 20px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.error-status {
    font-weight: 800;
    font-size: 1rem;
    font-family: 'JetBrains Mono', monospace;
}

/* Color-code error statuses */
.error-code:nth-child(1) .error-status { color: #dc2626; } /* 401 */
.error-code:nth-child(2) .error-status { color: #ea580c; } /* 403 */
.error-code:nth-child(3) .error-status { color: #ca8a04; } /* 404 */
.error-code:nth-child(4) .error-status { color: #9333ea; } /* 429 */
.error-code:nth-child(5) .error-status { color: #dc2626; } /* 500 */

.error-name {
    font-weight: 600;
    color: #0f172a;
}

.error-desc {
    color: #64748b;
}

/* ==========================================================================
   Usage Examples
   ========================================================================== */

.usage-examples {
    display: grid;
    gap: 28px;
}

.example-item h4 {
    color: #0f172a;
    margin-bottom: 12px;
    font-size: 1.05rem;
    font-weight: 600;
}

/* ==========================================================================
   Terms
   ========================================================================== */

.terms-content ol {
    padding-left: 24px;
}

.terms-content li {
    margin: 12px 0;
    line-height: 1.8;
    color: #334155;
}

.terms-content li strong {
    color: #0f172a;
}

/* ==========================================================================
   CTA Section
   ========================================================================== */

.cta-section {
    text-align: center;
    background: #0f172a !important;
    color: #ffffff;
    border: none !important;
}

.cta-section h3 {
    color: #ffffff !important;
    border-bottom-color: rgba(255, 255, 255, 0.15) !important;
}

.cta-section p {
    color: #94a3b8 !important;
    font-size: 1.05rem;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.cta-section .btn-primary {
    background: #ffffff;
    color: #0f172a;
    border: 2px solid #ffffff;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
}

.cta-section .btn-primary:hover {
    background: #f1f5f9;
    border-color: #f1f5f9;
    color: #0f172a;
}

.btn-outline {
    background: transparent;
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: #ffffff;
    color: #0f172a;
    border-color: #ffffff;
}

/* ==========================================================================
   Response Example
   ========================================================================== */

.response-example {
    margin-top: 16px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .api-title {
        font-size: 2.5rem;
    }

    .api-subtitle {
        font-size: 1.1rem;
    }

    .api-hero {
        padding: 60px 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .score-categories {
        flex-direction: column;
    }

    .score-category {
        flex: 1 1 auto;
    }

    .error-code {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 8px;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .doc-section {
        padding: 24px;
    }

    .section-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .api-hero {
        padding: 48px 0;
    }

    .api-title {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-item {
        padding: 24px 16px;
    }

    .doc-section {
        padding: 20px;
    }

    .endpoint-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
