/* Base styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
}

/* API Documentation Layout */
.api-documentation {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
}

/* Sidebar Navigation */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e9ecef;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    text-align: center;
}

.sidebar-header .header-link {
    display: block;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.sidebar-header .header-link:hover {
    opacity: 0.8;
}

.sidebar-header .logo {
    max-width: 180px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-menu li {
    border-bottom: 1px solid #f1f3f4;
}

.nav-menu a {
    display: block;
    padding: 12px 20px;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
}

.nav-menu a:hover {
    background-color: #e3f2fd;
    color: #1976d2;
}

.nav-menu a.active {
    background-color: #1976d2;
    color: white;
    border-left: 4px solid #1565c0;
}

.nav-menu .submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #f8f9fa;
}

.nav-menu .submenu li {
    border-bottom: 1px solid #e9ecef;
}

.nav-menu .submenu a {
    padding: 8px 20px 8px 40px;
    font-size: 13px;
    color: #6c757d;
}

.nav-menu .submenu a:hover {
    background-color: #e3f2fd;
    color: #1976d2;
}

.nav-menu .submenu a.active {
    background-color: #bbdefb;
    color: #1565c0;
    border-left: 4px solid #1976d2;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 20px;
    transition: margin-left 0.3s ease;
    overflow-x: hidden;
    max-width: calc(100vw - 280px);
}

.container {
    background: white;
    padding: 70px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 100vw;
    margin: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}



/* Responsive Design */
/* Collapse sidebar and free space for content on medium screens and below */
@media (max-width: 1100px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        max-width: 100vw;
    }

    .container {
        width: 100%;
        padding: 20px;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
}

/* Up to 700px, keep the container fully fluid */
@media (max-width: 700px) {
    .container {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
}

/* When the sidebar is open on smaller screens, push content instead of overlaying it */
@media (max-width: 1100px) {
    .sidebar.open~.main-content {
        margin-left: 280px;
        max-width: calc(100vw - 280px);
    }
}

/* Extra small screens: reduce padding to maximize content width */
@media (max-width: 480px) {
    .container {
        padding: 16px;
        width: 100%;
        max-width: 100vw;
        margin: 0;
        border-radius: 0;
    }

    .main-content {
        padding: 10px;
    }
}

/* Ensure container fits on very small screens */
@media (max-width: 320px) {
    .container {
        padding: 12px;
        width: 100%;
        max-width: 100vw;
    }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: #1976d2;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
}

@media (max-width: 1100px) {
    .mobile-menu-toggle {
        display: block;
    }
}

/* Headers */
h1 {
    color: #2c3e50;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 30px;
}

h2 {
    color: #34495e;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 8px;
    margin-top: 40px;
    margin-bottom: 20px;
}

h3 {
    color: #2c3e50;
    margin-top: 30px;
    margin-bottom: 15px;
}

/* Code blocks */
pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
}

code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

:not(pre)>code {
    display: inline-block;
    background: #f1f3f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: #2c3e50;
}

/* HTTP Method badges */
.method {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    margin-right: 10px;
    color: white;
}

.get {
    background: #3498db;
}

.post {
    background: #27ae60;
}

.put {
    background: #f39c12;
}

.delete {
    background: #e74c3c;
}

/* Endpoints */
.endpoint {
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

/* Parameters */
.parameters {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
}

/* Required fields */
.required {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
}

/* Response sections */
.response {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
}

/* Notes */
blockquote {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
}

/* Table of Contents */
.toc {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

/* Links */
a {
    color: #3498db;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Status codes */
.status-code {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    margin-right: 10px;
}

/* Error responses */
.error-response {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
}

.error-status {
    display: inline-block;
    background: #dc3545;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    margin-right: 10px;
}

/* Anchor link navigation styles */
html {
    scroll-behavior: smooth;
}

/* Ensure headers have proper spacing for anchor links */
h2,
h3,
h4 {
    scroll-margin-top: 20px;
}

/* Style for active anchor links */
.toc a:target {
    background-color: #e3f2fd;
    padding: 2px 4px;
    border-radius: 3px;
}

/* Products Table Styles */
.products-table-wrapper {
    margin: 20px 0;
    overflow-x: auto;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.products-table thead {
    background: #2c3e50;
    color: white;
}

.products-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.products-table th:nth-child(1) {
    width: 25%;
}

.products-table th:nth-child(2) {
    width: 15%;
}

.products-table th:nth-child(3) {
    width: 60%;
}

.products-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.products-table tbody tr:hover {
    background-color: #f8f9fa;
}

.products-table tbody tr:last-child {
    border-bottom: none;
}

.products-table td {
    padding: 15px;
    vertical-align: top;
    font-size: 14px;
    line-height: 1.5;
}

.products-table td:first-child {
    font-weight: 600;
    color: #2c3e50;
}

/* API Endpoints Section */
.api-endpoints {
    margin-bottom: 40px;
}

.endpoint-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.endpoint-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s ease;
}

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

.endpoint-card.active {
    border-color: #1976d2;
    background: #e3f2fd;
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.2);
}

.endpoint-card {
    cursor: pointer;
}

.endpoint-card h3 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 18px;
}

.endpoint-url {
    margin: 12px 0;
}

.endpoint-url code {
    background: #2d3748;
    color: #e2e8f0;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    display: block;
    word-break: break-all;
}

.endpoint-card p {
    color: #6c757d;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Responsive endpoint grid */
@media (max-width: 768px) {
    .endpoint-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .endpoint-card {
        padding: 16px;
    }
}

/* Module Badge Styles */
.module-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    text-align: center;
    min-width: 50px;
}

.module-badge.kyb {
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

.module-badge.aml {
    background: linear-gradient(135deg, #27ae60, #229954);
    box-shadow: 0 2px 4px rgba(39, 174, 96, 0.3);
}

/* Responsive table */
@media (max-width: 768px) {
    .products-table-wrapper {
        margin: 15px -10px;
    }

    .products-table {
        font-size: 13px;
    }

    .products-table th,
    .products-table td {
        padding: 10px 8px;
    }

    .products-table th:nth-child(1) {
        width: 30%;
    }

    .products-table th:nth-child(2) {
        width: 20%;
    }

    .products-table th:nth-child(3) {
        width: 50%;
    }
}