/* ERP Connector API Documentation Styles */
/* Prefixed with si-oerp-api-doc- to avoid CSS conflicts */

:root {
    --primary: #0B0D0D;
    --primary-dark: #4338ca;
    --success: #10b981;
    --warning: #7f550b;
    --danger: #dc4344;
    --bg-page: #fafafa;
    --bg-light: #ffffff;
    --bg-code: #1e1e1e;
    --border: #e5e7eb;
    --text-dark: #111827;
    --text-medium: #6b7280;
    --text-light: #9ca3af;
}


/* Header */
.si-oerp-api-doc-header {
    background: var(--bg-light);
    border-bottom: 1px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 1000;
    
}

.si-oerp-api-doc-header ul{
	list-style-type:none;
	padding-left:0;
	padding-bottom:5px!important;
}

.si-oerp-api-doc-header-content {
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
	flex-direction: column;
	font-family: "corporate-s", sans-serif;
}

.si-oerp-api-doc-logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.si-oerp-api-doc-nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.si-oerp-api-doc-nav-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    transition: color 0.2s;
}

.si-oerp-api-doc-nav-links a:before{
content: "\35";
	font-family: ETmodules !important;
    speak: none;
}


.si-oerp-api-doc-nav-links a:hover {
   color:#458482;
}

/* Main Layout */
.si-oerp-api-doc-container {
    margin: 0 auto;
	
}

/* Hero */
.si-oerp-api-doc-hero {
    margin-bottom: 3rem;
}

.si-oerp-api-doc-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.si-oerp-api-doc-hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-medium);
    margin-bottom: 2rem;
    max-width: 800px;
}

.si-oerp-api-doc-endpoint-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', Consolas, monospace;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.si-oerp-api-doc-method-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.si-oerp-api-doc-method-get { background: #d4edda; color: #155724; }
.si-oerp-api-doc-method-post { background: #fff3cd; color: #856404; }
.si-oerp-api-doc-method-put { background: #cbebef; color: #004085; }

/* Content Sections */
.si-oerp-api-doc-content-section {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(11, 13, 13, 0.05);
}

.si-oerp-api-doc-content-section h2 {
    font-size: 1.75rem!important;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--primary);
	position:relative;
	display:inline-flex;
	z-index:2;
}

.si-oerp-api-doc-content-section h2:before{
	width:100%;
    height: 6px;
    content: "";
    left: 0;
    bottom: 4px;
    display: block;
    background: #B8D3D1;
    position: absolute;
	z-index:-1;
    border-radius: 3px;
}

.si-oerp-api-doc-content-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.si-oerp-api-doc-content-section p {
    color: var(--text-medium);
    margin-bottom: 1rem;
}

/* Support Matrix */
.si-oerp-api-doc-support-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
    margin: 1.5rem 0;
}

.si-oerp-api-doc-support-table th,
.si-oerp-api-doc-support-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.si-oerp-api-doc-support-table th {
    background: var(--bg-page);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-dark);
}

.si-oerp-api-doc-support-table td {
    font-size: 0.875rem;
    background: var(--bg-light);
}

.si-oerp-api-doc-support-table tr:last-child td {
    border-bottom: none;
}

.si-oerp-api-doc-support-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.5rem;
}

.si-oerp-api-doc-support-yes {
background: #d1eadd; 
color: #3c7f5c;
}

.si-oerp-api-doc-support-no {
    background: #fbdcd0;
    color: #dc4344;
}

.si-oerp-api-doc-erp-code {
    font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', Consolas, monospace;
    font-size: 0.8125rem;
    color: var(--text-medium);
    background: var(--bg-page);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

/* Code Blocks */
.si-oerp-api-doc-code-container {
    margin: 1.5rem 0;
}

.si-oerp-api-doc-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #2d2d2d;
    border-radius: 0.5rem 0.5rem 0 0;
    border-bottom: 1px solid #404040;
}

.si-oerp-api-doc-code-label {
    color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.si-oerp-api-doc-copy-button {
    padding: 0.375rem 0.75rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.si-oerp-api-doc-copy-button:hover {
    background: rgba(255,255,255,0.2);
}

.si-oerp-api-doc-code-block {
    background: var(--bg-code);
    color: #e5e7eb;
    padding: 1.25rem;
    border-radius: 0 0 0.5rem 0.5rem;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 500px;
    font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
}

.si-oerp-api-doc-code-block pre {
    margin: 0;
}

/* Syntax Highlighting */
.si-oerp-api-doc-json-key { color: #7dd3fc; }
.si-oerp-api-doc-json-string { color: #86efac; }
.si-oerp-api-doc-json-number { color: #fbbf24; }
.si-oerp-api-doc-json-boolean { color: #fb923c; }
.si-oerp-api-doc-json-comment { color: #6b7280; font-style: italic; }

/* Exemples : menu déroulant (remplace la rangée d'onglets qui débordait) */
.si-oerp-api-doc-examples {
    margin-bottom: 1.5rem;
}

.si-oerp-api-doc-examples-toolbar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.si-oerp-api-doc-examples-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-medium);
}

.si-oerp-api-doc-select {
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    background-color: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.5rem 2.1rem 0.5rem 0.85rem;
    max-width: 100%;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    /* chevron inline (aucune ressource externe) — gris neutre lisible en clair */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 0.7rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.si-oerp-api-doc-select:hover {
    border-color: var(--primary);
}

.si-oerp-api-doc-select:focus-visible {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(69, 132, 130, 0.25);
}

.si-oerp-api-doc-select option {
    background-color: var(--bg-light);
    color: var(--text-dark);
}

.si-oerp-api-doc-tab-content {
    display: none;
}

.si-oerp-api-doc-tab-content.active {
    display: block;
}

/* Alert Boxes */
.si-oerp-api-doc-alert {
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid;
}

.si-oerp-api-doc-alert-info {
    background: #ecf7f6;
    border-color: var(--primary);
}


.si-oerp-api-doc-alert.si-oerp-api-doc-alert-info p {
   padding-bottom:0;
}

.si-oerp-api-doc-alert-info .si-oerp-api-doc-alert-title {
    color: var(--primary);;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.si-oerp-api-doc-alert-info p {
    color: #1e40af;
    margin: 0;
}

.si-oerp-api-doc-alert-warning {
    background: #f8eed4;
    border-color: var(--warning);
}

.si-oerp-api-doc-alert-warning .si-oerp-api-doc-alert-title {
    color: var(--warning);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.si-oerp-api-doc-alert-warning p {
    color: #92400e;
    margin: 0;
}

/* Parameters Table */
.si-oerp-api-doc-params-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
    margin: 1.5rem 0;
}

.si-oerp-api-doc-params-table th,
.si-oerp-api-doc-params-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.si-oerp-api-doc-params-table th {
    background: var(--bg-page);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-dark);
}

.si-oerp-api-doc-params-table td {
    font-size: 0.875rem;
}

.si-oerp-api-doc-params-table tr:last-child td {
    border-bottom: none;
}

.si-oerp-api-doc-param-name {
    font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', Consolas, monospace;
    color: var(--primary);
    font-weight: 600;
}

.si-oerp-api-doc-param-type {
    color: var(--text-light);
    font-size: 0.8125rem;
    font-style: italic;
}

.si-oerp-api-doc-param-required {
    color: var(--danger);
    font-weight: 600;
    font-size: 0.75rem;
}

.si-oerp-api-doc-param-optional {
    color: var(--text-light);
    font-size: 0.75rem;
}

/* Matrix Table Styles */
.si-oerp-api-doc-matrix-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
    margin: 1.5rem 0;
    font-size: 0.8rem;
}

.si-oerp-api-doc-matrix-table th,
.si-oerp-api-doc-matrix-table td {
    padding: 0.5rem 0.75rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

.si-oerp-api-doc-matrix-table th:first-child,
.si-oerp-api-doc-matrix-table td:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    background: var(--bg-light);
    z-index: 1;
}

.si-oerp-api-doc-matrix-table th {
    background: var(--bg-page);
    font-weight: 600;
    color: var(--text-dark);
}

.si-oerp-api-doc-matrix-table td {
    background: var(--bg-light);
}

.si-oerp-api-doc-matrix-table tr:last-child td {
    border-bottom: none;
}

.si-oerp-api-doc-matrix-table th:last-child,
.si-oerp-api-doc-matrix-table td:last-child {
    border-right: none;
}

.si-oerp-api-doc-support-cell {
    font-size: 0.7rem;
    font-weight: 600;
    color: #000000;
}

.si-oerp-api-doc-entity-category {
    background: #e8f4f3 !important;
    font-weight: 700;
    color: var(--primary);
}

.si-oerp-api-doc-table-container {
    overflow-x: auto;
}

.si-oerp-api-doc-legend-text {
    margin: 1rem 0;
}

.si-oerp-api-doc-details-list {
    margin-left: 2rem;
    margin-top: 1rem;
    color: var(--text-medium);
}

.si-oerp-api-doc-text-center {
    text-align: center;
}

.si-oerp-api-doc-margin-top {
    margin-top: 1rem;
}

.si-oerp-api-doc-margin-top-1-5 {
    margin-top: 1.5rem;
}

.si-oerp-api-doc-margin-y-1-5 {
    margin: 1.5rem 0;
}

/* Responsive */
@media (max-width: 768px) {
    .si-oerp-api-doc-container {
        padding: 2rem 1rem;
    }

    .si-oerp-api-doc-hero h1 {
        font-size: 2rem;
    }

    .si-oerp-api-doc-support-table {
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   Dark mode — activé quand le site hôte (Docusaurus) pose data-theme="dark"
   sur <html>. Les variables :root sont redéfinies, puis les quelques couleurs
   codées en dur (badges, alertes, surligneur h2) reçoivent leur variante.
   Les blocs de code sont déjà sombres : identiques dans les deux modes.
   ========================================================================== */

[data-theme='dark'] {
    --primary: #e8efed;
    --warning: #d9a94a;
    --bg-page: #1b1b1d;
    --bg-light: #242526;
    --border: #3b3d42;
    --text-dark: #e3e5e8;
    --text-medium: #b4b8bf;
    --text-light: #8d919a;
}

[data-theme='dark'] .si-oerp-api-doc-header {
    border-bottom-color: var(--border);
}

/* Chevron du menu déroulant d'exemples : gris clair au lieu de gris foncé */
[data-theme='dark'] .si-oerp-api-doc-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%23b4b8bf' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Surligneur des h2 : sauge sombre au lieu de sauge pâle */
[data-theme='dark'] .si-oerp-api-doc-content-section h2:before {
    background: #2f4a47;
}

[data-theme='dark'] .si-oerp-api-doc-nav-links a:hover {
    color: #8fc6c0;
}

/* Badges de méthode : fonds teintés translucides, texte pastel lisible */
[data-theme='dark'] .si-oerp-api-doc-method-get { background: rgba(16, 185, 129, 0.16); color: #6ee7b7; }
[data-theme='dark'] .si-oerp-api-doc-method-post { background: rgba(251, 191, 36, 0.14); color: #fcd34d; }
[data-theme='dark'] .si-oerp-api-doc-method-put { background: rgba(125, 211, 252, 0.14); color: #7dd3fc; }

/* Badges de support */
[data-theme='dark'] .si-oerp-api-doc-support-yes { background: rgba(16, 185, 129, 0.16); color: #6ee7b7; }
[data-theme='dark'] .si-oerp-api-doc-support-no { background: rgba(220, 67, 68, 0.16); color: #f0908f; }
[data-theme='dark'] .si-oerp-api-doc-support-cell { color: var(--text-dark); }

/* Alertes */
[data-theme='dark'] .si-oerp-api-doc-alert-info {
    background: rgba(69, 132, 130, 0.14);
    border-color: #8fc6c0;
}
[data-theme='dark'] .si-oerp-api-doc-alert-info .si-oerp-api-doc-alert-title { color: #a9d6d1; }
[data-theme='dark'] .si-oerp-api-doc-alert-info p { color: #c9d6e8; }

[data-theme='dark'] .si-oerp-api-doc-alert-warning {
    background: rgba(217, 169, 74, 0.10);
    border-color: var(--warning);
}
[data-theme='dark'] .si-oerp-api-doc-alert-warning p { color: #e6c98d; }

/* Lignes de catégorie de la matrice */
[data-theme='dark'] .si-oerp-api-doc-entity-category {
    background: #27333a !important;
}
