/* Customer Theme - Green */
:root {
    --primary-color: #2e7d32;
    --primary-light: #4caf50;
    --primary-dark: #1b5e20;
    --accent-color: #81c784;
    --success-color: #2e7d32;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --text-primary: #2e7d32;
    --background-secondary: #f1f8e9;
    --border-color: #c8e6c9;
}

/* Theme-specific overrides */
.customer-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
}

.customer-badge {
    background: var(--accent-color);
    color: var(--primary-dark);
}

/* Badge styles */
.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.welcome-section {
    background: var(--background-secondary);
    border-left: 4px solid var(--primary-color);
    padding: 2rem;
    margin: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.welcome-section h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.welcome-section h2 i {
    color: var(--primary-color);
    font-size: 1.25rem;
}

.welcome-note {
    font-size: 1rem;
    line-height: 1.6;
    color: #444;
    margin: 0;
}

.credentials-section {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.credentials-section .form-group {
    margin-bottom: 0;
}

.credentials-section label {
    color: var(--primary-color);
    font-weight: 600;
}

.credentials-section input {
    border: 2px solid var(--border-color);
    border-radius: 4px;
    padding: 8px 12px;
}

.credentials-section input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/* Two-column layout for main content - TRUE 50/50 SPLIT */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Documentation container */
.docs-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* API Testing Panel */
.test-panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.test-panel .form-group {
    margin-bottom: 15px;
}

.test-panel label {
    display: block;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 5px;
}

.test-panel select,
.test-panel input,
.test-panel textarea {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.test-panel select:focus,
.test-panel input:focus,
.test-panel textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.button-group {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #666;
    color: white;
}

.btn-secondary:hover {
    background: #555;
    transform: translateY(-1px);
}

.test-result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid #ddd;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.test-result.visible {
    opacity: 1;
    max-height: 1000px;
}

.test-result-success {
    background: #e8f5e8;
    border-left-color: var(--success-color);
}

.test-result-error {
    background: #ffebee;
    border-left-color: var(--error-color);
}

.test-result-info {
    background: #e3f2fd;
    border-left-color: #2196f3;
}

.test-result-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 10px;
}

.test-result-body {
    padding: 1rem !important;
    background: #f8f9fa !important;
    border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
    color: #000 !important;
}

.test-result-body pre {
    background: #f5f5f5 !important;
    padding: 10px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    overflow-x: auto !important;
    color: #000 !important;
    margin: 0 !important;
    font-family: 'Monaco', 'Menlo', monospace !important;
    white-space: pre-wrap !important;
    word-break: break-word !important;
}

.test-result-body h4 {
    color: var(--primary-color);
    margin: 15px 0 5px 0;
}

/* Simple Pagination Styles */
.pagination-summary {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px 15px;
    margin-bottom: 15px;
    font-size: 14px;
}

.pagination-summary strong {
    color: var(--primary-color);
}

.item-count {
    color: #666;
    margin-left: 10px;
}

.json-response {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    max-height: none;
    overflow: visible;
}

.json-response pre {
    margin: 0;
    padding: 15px;
    font-size: 12px;
    line-height: 1.4;
    overflow-x: auto;
    color: #000 !important;
    background: white !important;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
}

.json-response pre code {
    color: #000 !important;
    background: transparent !important;
}

.pagination-controls {
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    padding: 15px 0;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
    border-radius: 0 0 4px 4px;
}

.page-btn {
    background: var(--primary-color) !important;
    color: white !important;
    border: none !important;
    padding: 10px 16px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    transition: background-color 0.2s !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.page-btn:hover {
    background: var(--primary-dark) !important;
    transform: translateY(-1px);
}

.page-info {
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 10px;
}

/* Section styling */
.doc-section {
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.section-header {
    padding: 15px 20px;
    background: var(--background-secondary);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.2s ease;
}

.section-header:hover {
    background: #e8f5e8;
}

.section-header.collapsed .section-toggle {
    transform: rotate(-90deg);
}

.section-header div {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 16px;
}

.section-toggle {
    color: var(--primary-color);
    transition: transform 0.2s ease;
}

.section-content {
    padding: 20px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.section-content.expanded {
    max-height: none;
}

/* Endpoint grid and cards */
.endpoint-grid {
    display: grid;
    gap: 15px;
}

.endpoint-card {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    background: white;
}

.endpoint-header {
    padding: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.2s ease;
}

.endpoint-header:hover {
    background: #f9f9f9;
}

.endpoint-method {
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
    color: white;
    margin-right: 10px;
}

.method-GET {
    background: #4caf50;
}

.method-POST {
    background: #2196f3;
}

.method-PUT {
    background: #ff9800;
}

.method-DELETE {
    background: #f44336;
}

.method-PATCH {
    background: #9c27b0;
}

.endpoint-path {
    font-family: monospace;
    color: var(--primary-color);
    font-weight: 600;
}

.endpoint-description {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

.endpoint-details {
    padding: 0 15px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.endpoint-details.expanded {
    padding: 15px;
    max-height: none;
    border-top: 1px solid var(--border-color);
}

.endpoint-details h4 {
    color: var(--primary-color);
    margin: 15px 0 5px 0;
    font-size: 14px;
}

.endpoint-details h4:first-child {
    margin-top: 0;
}

.json-example,
.code-block {
    background: #f5f5f5;
    border-radius: 4px;
    margin: 10px 0;
}

.json-example pre,
.code-block pre {
    margin: 0;
    padding: 15px;
    overflow-x: auto;
    font-size: 13px;
    color: #000 !important;
}

.json-example code,
.code-block code {
    color: #000 !important;
}

.auth-info {
    background: var(--background-secondary);
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
}

/* Responsive design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .test-panel {
        position: relative;
        top: auto;
        order: -1;
    }

    .credentials-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .credentials-section {
        padding: 15px;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        justify-content: center;
    }
}

/* Shared Pagination Styles */
.paginated-response {
    margin: 1rem 0;
    padding: 0 1rem;
}

.pagination-summary {
    background: linear-gradient(135deg, var(--background-secondary) 0%, rgba(129, 199, 132, 0.1) 100%);
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 16px;
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.summary-details {
    opacity: 0.8;
    font-size: 0.85rem;
}

.data-cards {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.data-card {
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
    border-left: 4px solid var(--primary-color);
}

.data-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f5f5f5;
}

.card-header strong {
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 600;
}

.status-badge {
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-details {
    display: grid;
    gap: 6px;
}

.detail-row {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    gap: 8px;
}

.detail-row span:first-child {
    font-weight: 600;
    min-width: 85px;
    color: #555;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.detail-row code {
    background: #f8f9fa;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: 'Consolas', monospace;
    color: #333;
    border: 1px solid #e9ecef;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 24px 0 16px;
    padding: 16px 0;
    border-top: 1px solid #f0f0f0;
}

.page-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    min-width: 80px;
}

.page-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

.page-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.page-info {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0 8px;
}

.raw-json-toggle {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    text-align: center;
}

.toggle-btn {
    background: var(--accent-color);
    color: var(--primary-dark);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    background: #66bb6a;
    transform: translateY(-1px);
}

.raw-json {
    margin-top: 16px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.raw-json pre {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.4;
}