/**
 * Styles pour la gestion de la documentation (basé sur users table)
 */

/* Override du layout pour la section documentation - largeur maximale */
#documentation-section.active .documentation-table-container {
    margin-left: 0; /* Pas de marge négative, alignement normal */
    margin-right: 0;
    width: 100%; /* Utiliser toute la largeur du conteneur parent */
    max-width: none; /* Supprimer les limites de largeur */
}

@media (max-width: 1200px) {
    #documentation-section.active .documentation-table-container {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }
}

@media (max-width: 1024px) {
    #documentation-section.active .documentation-table-container {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }
}

@media (max-width: 768px) {
    #documentation-section.active .documentation-table-container {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }
}

/* Contrôles de documentation */
.documentation-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
    flex-wrap: wrap;
}

.search-container {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.filter-input {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 14px 18px;
    color: var(--text-primary);
    font-size: 0.95rem;
    width: 100%;
    transition: all 0.3s ease;
    font-weight: 400;
}

.filter-input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.filter-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.documentation-stats {
    background: rgba(34, 197, 94, 0.15);
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 150px;
    max-width: 100%;
    width: auto;
    overflow-wrap: break-word;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.1);
    text-align: center;
    flex-shrink: 0;
}

/* Layout de gestion de la documentation */
.documentation-table-container {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    min-height: 400px;
}

/* Ajustement spécifique pour l'accordéon des sections */
#documentation-sections {
    min-height: auto; /* Remplacer la hauteur minimale par auto */
    margin-bottom: 20px; /* Ajouter un espace en dessous */
    transition: min-height 0.3s ease;
}

/* État développé de l'accordéon */
#documentation-sections.expanded {
    min-height: 200px; /* Hauteur minimale lorsqu'il est développé */
}

/* Style pour les flèches de l'accordéon */
.accordion-arrow {
    float: right;
    font-size: 1rem;
    margin-right: 10px;
    transition: transform 0.3s ease;
}

/* Tableau de documentation */
.documentation-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: fixed;
}

.documentation-table th {
    background: rgba(139, 92, 246, 0.15);
    color: var(--text-primary);
    padding: 18px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(139, 92, 246, 0.3);
    position: sticky;
    top: 0;
    z-index: 10;
}

.documentation-table th:first-child { /* Méthode (empty header) */
    width: 70px; /* Reduced width */
    text-align: center; /* Align header text to the center */
    padding: 18px 0; /* Symmetrical horizontal padding */
}

.documentation-table th:nth-child(2) { /* Endpoint */
    width: 272px; /* Réduit de 15% par rapport à 320px */
    max-width: 20vw;
    min-width: 100px;
}

.documentation-table th:nth-child(3) { /* Résumé */
    width: auto;
}

.documentation-table th:nth-child(4),
.documentation-table th:nth-child(5),
.documentation-table td:nth-child(4),
.documentation-table td:nth-child(5) {
    width: 155px;
    min-width: 120px;
    max-width: 180px;
}

.documentation-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.documentation-table tbody td:first-child { /* Method column cell */
    text-align: center; /* Align icon and text to the center */
    padding: 16px 0; /* Symmetrical horizontal padding */
}

.documentation-table tbody tr {
    transition: all 0.2s ease;
}

/* Optimized clickable row styling to prevent forced reflows */
.documentation-table tbody tr.documentation-row-clickable {
    cursor: pointer;
}

.documentation-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.06);
    /* transform: translateY(-1px); /* Optionnel: léger effet de soulèvement */
}

/* Remove rule for .documentation-table tbody td:nth-child(2) as it's no longer needed 
   and was causing an empty ruleset error. Endpoint column will use default td alignment. */

/* Remove styles for .auto-text as it's replaced by .auto-icon */
/* .auto-text {
    color: red;
} */

/* Styles pour les méthodes HTTP */
.method-badge {
    font-size: 0.9rem;
    font-weight: bold; /* Ensure text is bold */
    padding: 0.2em 0.4em; /* Léger padding pour ne pas coller au texte */
    border-radius: 4px; /* Coins légèrement arrondis */
    display: inline-block; /* Permet d'appliquer padding et margin correctement */
    line-height: 1.2; /* Hauteur de ligne pour un meilleur espacement vertical */
    text-transform: uppercase; /* Méthodes en majuscules pour la clarté */
}

.method-GET {
    color: #059669; /* Darker green for better contrast */
}

.method-POST {
    color: #2563eb; /* Darker blue for better contrast */
}

.method-PUT {
    color: #f59e0b;
}

.method-DELETE {
    color: #ef4444;
}

.method-PATCH {
    color: #8b5cf6;
}

/* Style for "auto" text "A" */
.auto-icon {
    color: #F08080; /* LightCoral */
    font-weight: bold;
    margin-right: 4px; /* Reduced space */
    vertical-align: middle; /* Align with method text */
    /* Removed background, border-radius, width, height, line-height, text-align, specific font-size */
}

/* Styles pour les endpoints */
.endpoint-path {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: rgba(255, 255, 255, 0.12); /* Slightly more prominent background */
    padding: 6px 10px; /* Increased padding */
    border-radius: 6px; /* Slightly larger radius */
    font-size: 0.9rem; /* Increased font size */
    color: var(--text-primary); /* More prominent color */
    font-weight: 600; /* Bolder font weight */
}

/* Résumé de l'endpoint */
.endpoint-summary {
    max-width: none; /* Utiliser tout l'espace disponible */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
    font-weight: 400;
    text-shadow: none; /* Supprime toute ombre de texte */
}

.summary-auto-generated {
    color: red;
}

/* Actions du header */
.content-actions {
    display: flex;
    gap: 12px;
}

.btn-primary {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

/* État de chargement */
.documentation-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.documentation-loading::before {
    content: "🔄";
    display: block;
    font-size: 2rem;
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Message vide */
.documentation-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.documentation-empty::before {
    content: "📚";
    display: block;
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Modal d'édition de documentation */
#editDocumentationModal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

#editDocumentationModal.show {
    display: block;
}

.modal-content {
    background: rgba(255, 255, 255, 0.06);
    margin: 5% auto;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    position: relative;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: rgba(255, 140, 0, 0.35);
    padding: 20px 25px;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    position: relative;
    border: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    border: none;
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

/* Styles pour les pastilles de méthode dans le titre de la modal */
.modal-method-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    color: white;
    flex-shrink: 0;
}

.modal-method-GET {
    background-color: #059669; /* Vert pour GET */
}

.modal-method-POST {
    background-color: #2563eb; /* Bleu pour POST */
}

.close-button {
    position: absolute;
    top: 20px;
    right: 25px;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0.8;
}

.close-button:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-body {
    padding: 25px;
    background: rgba(37, 99, 235, 0.15);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn {
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    min-width: 100px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: white;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Styles spécifiques pour les champs du modal */
#editDocumentationModal input[type="text"],
#editDocumentationModal textarea {
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 8px !important;
    padding: 12px 15px !important;
    color: var(--text-primary) !important;
    font-size: 0.95rem !important;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
    transition: all 0.3s ease !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

#editDocumentationModal input[type="text"]:focus,
#editDocumentationModal textarea:focus {
    outline: none !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    background: rgba(255, 255, 255, 0.18) !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25), 0 4px 15px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-1px) !important;
}

#editDocumentationModal input[type="text"]:read-only {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    cursor: not-allowed !important;
    color: rgba(255, 255, 255, 0.7) !important;
    opacity: 0.8 !important;
    font-style: italic !important;
}

#editDocumentationModal input[type="text"]::placeholder,
#editDocumentationModal textarea::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
    opacity: 1 !important;
    font-style: italic !important;
}

#editDocumentationModal textarea {
    resize: vertical !important;
    min-height: 80px !important;
    line-height: 1.5 !important;
}

#editDocumentationModal input[type="checkbox"] {
    margin-right: 10px !important;
    vertical-align: middle !important;
    transform: scale(1.2) !important;
    accent-color: var(--secondary-color) !important;
}

/* Styles pour le panneau accordéon des sections */
.accordion-panel {
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.accordion-header {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    padding: 18px 16px;
    width: 100%;
    text-align: left;
    border: none;
    font-weight: normal;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.accordion-header.open {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.accordion-title {
    flex-grow: 1;
}

.accordion-icon {
    font-size: 1.2rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.accordion-header.open .accordion-icon {
    transform: rotate(45deg);
}

.accordion-content {
    padding: 0; /* Remove padding if table is direct child */
    border-top: none;
    /* max-height: 0; /* For accordion animation - managed by JS */
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out; /* For animation */
}

/* Style pour le tableau à l'intérieur de l'accordéon (similaire à .documentation-table) */
.accordion-content .documentation-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: fixed;
    border-top: none; /* Remove top border if header is present */
}

.accordion-content .documentation-table th {
    background: rgba(139, 92, 246, 0.1); /* Slightly lighter than main table header */
    color: var(--text-primary);
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    /* position: sticky; /* Potentially problematic inside accordion */
    /* top: 0; */
    /* z-index: 5; */
}

.accordion-content .documentation-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.accordion-content .documentation-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.06);
}

.accordion-content .documentation-table th:first-child, 
.accordion-content .documentation-table td:first-child {
    width: 250px; /* Adjust as needed for section name */
}

.accordion-content .documentation-table th:nth-child(2), 
.accordion-content .documentation-table td:nth-child(2) {
    width: auto; /* Description takes remaining space */
}

.accordion-content .documentation-table th:last-child, 
.accordion-content .documentation-table td:last-child {
    width: 100px; /* Actions column */
    text-align: center;
}

/* Sélecteur d'endpoint pour les restrictions */
.restrictions-endpoint-selector {
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(139, 92, 246, 0.08);
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.restrictions-endpoint-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.restrictions-endpoint-selector .form-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--glass-background);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.restrictions-endpoint-selector .form-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.restrictions-endpoint-selector .form-select option {
    background: #ffffff;
    color: #1f2d3a;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        width: 100%;
    }
}

/* Styles pour les restrictions */
.restriction-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

.restriction-badge.open {
    background-color: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.restriction-badge.innovortex {
    background-color: rgba(249, 115, 22, 0.1);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.restriction-badge.restricted {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.restriction-badge.unknown {
    background-color: rgba(156, 163, 175, 0.1);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

/* Styles pour le tableau des restrictions */
#restrictions-list .documentation-table tbody tr:hover {
    background-color: rgba(139, 92, 246, 0.05);
    cursor: pointer;
}

#restrictions-list .documentation-table tbody tr[title] {
    position: relative;
}

/* Message d'erreur et d'absence de données */
.no-data, .error-message {
    font-style: italic;
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
}

.error-message {
    color: #ef4444 !important;
    background-color: rgba(239, 68, 68, 0.05);
    border-radius: 8px;
}

/* Animation de chargement */
.loading-restrictions {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-secondary);
}

.loading-restrictions::before {
    content: '';
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 2px solid transparent;
    border-top: 2px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Styles pour les dropdowns de restriction inline */
.restriction-dropdown {
    width: 100%;
    padding: 6px 12px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 6px;
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 32px;
}

.restriction-dropdown:hover {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.1);
}

.restriction-dropdown:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.8);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.restriction-dropdown:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: rgba(139, 92, 246, 0.05);
}

/* Options du dropdown avec couleurs */
.restriction-dropdown option[value="open"] {
    color: #16a34a;
}

.restriction-dropdown option[value="innovortex"] {
    color: #ea580c;
}

.restriction-dropdown option[value="restricted"] {
    color: #dc2626;
}

/* Effet de réussite pour la sauvegarde */
.restriction-dropdown.success {
    border-color: #16a34a;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}

/* Effet d'erreur pour la sauvegarde */
.restriction-dropdown.error {
    border-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

/* Styles pour les badges d'édition */
.editable-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

.editable-badge.editable {
    background-color: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.editable-badge.non-editable {
    background-color: rgba(156, 163, 175, 0.1);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

/* Styles pour les dropdowns de restriction_editable inline */
.editable-dropdown {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 4px;
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 6px center;
    background-repeat: no-repeat;
    background-size: 12px;
    padding-right: 24px;
}

.editable-dropdown:hover {
    border-color: rgba(34, 197, 94, 0.5);
    box-shadow: 0 1px 3px rgba(34, 197, 94, 0.1);
}

.editable-dropdown:focus {
    outline: none;
    border-color: rgba(34, 197, 94, 0.8);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.1);
}

.editable-dropdown:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: rgba(34, 197, 94, 0.05);
}

/* Options du dropdown avec couleurs */
.editable-dropdown option[value="true"] {
    color: #16a34a;
}

.editable-dropdown option[value="false"] {
    color: #dc2626;
}

/* Effet de réussite pour la sauvegarde */
.editable-dropdown.success {
    border-color: #16a34a;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}

/* Effet d'erreur pour la sauvegarde */
.editable-dropdown.error {
    border-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

/* Modal d'édition des sections */
#editSectionModal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

#editSectionModal.show {
    display: block;
}

.modal-content {
    background: rgba(255, 255, 255, 0.06);
    margin: 5% auto;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    position: relative;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: rgba(255, 140, 0, 0.35);
    padding: 20px 25px;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    position: relative;
    border: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    border: none;
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

/* Styles pour les pastilles de méthode dans le titre de la modal */
.modal-method-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    color: white;
    flex-shrink: 0;
}

.modal-method-GET {
    background-color: #059669; /* Vert pour GET */
}

.modal-method-POST {
    background-color: #2563eb; /* Bleu pour POST */
}

.close-button {
    position: absolute;
    top: 20px;
    right: 25px;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0.8;
}

.close-button:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-body {
    padding: 25px;
    background: rgba(37, 99, 235, 0.15);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn {
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    min-width: 100px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: white;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Styles spécifiques pour les champs du modal */
#editDocumentationModal input[type="text"],
#editDocumentationModal textarea {
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 8px !important;
    padding: 12px 15px !important;
    color: var(--text-primary) !important;
    font-size: 0.95rem !important;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
    transition: all 0.3s ease !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

#editDocumentationModal input[type="text"]:focus,
#editDocumentationModal textarea:focus {
    outline: none !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    background: rgba(255, 255, 255, 0.18) !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25), 0 4px 15px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-1px) !important;
}

#editDocumentationModal input[type="text"]:read-only {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    cursor: not-allowed !important;
    color: rgba(255, 255, 255, 0.7) !important;
    opacity: 0.8 !important;
    font-style: italic !important;
}

#editDocumentationModal input[type="text"]::placeholder,
#editDocumentationModal textarea::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
    opacity: 1 !important;
    font-style: italic !important;
}

#editDocumentationModal textarea {
    resize: vertical !important;
    min-height: 80px !important;
    line-height: 1.5 !important;
}

#editDocumentationModal input[type="checkbox"] {
    margin-right: 10px !important;
    vertical-align: middle !important;
    transform: scale(1.2) !important;
    accent-color: var(--secondary-color) !important;
}

/* Styles pour le panneau accordéon des sections */
.accordion-panel {
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.accordion-header {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    padding: 18px 16px;
    width: 100%;
    text-align: left;
    border: none;
    font-weight: normal;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.accordion-header.open {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.accordion-title {
    flex-grow: 1;
}

.accordion-icon {
    font-size: 1.2rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.accordion-header.open .accordion-icon {
    transform: rotate(45deg);
}

.accordion-content {
    padding: 0; /* Remove padding if table is direct child */
    border-top: none;
    /* max-height: 0; /* For accordion animation - managed by JS */
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out; /* For animation */
}

/* Style pour le tableau à l'intérieur de l'accordéon (similaire à .documentation-table) */
.accordion-content .documentation-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: fixed;
    border-top: none; /* Remove top border if header is present */
}

.accordion-content .documentation-table th {
    background: rgba(139, 92, 246, 0.1); /* Slightly lighter than main table header */
    color: var(--text-primary);
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    /* position: sticky; /* Potentially problematic inside accordion */
    /* top: 0; */
    /* z-index: 5; */
}

.accordion-content .documentation-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.accordion-content .documentation-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.06);
}

.accordion-content .documentation-table th:first-child, 
.accordion-content .documentation-table td:first-child {
    width: 250px; /* Adjust as needed for section name */
}

.accordion-content .documentation-table th:nth-child(2), 
.accordion-content .documentation-table td:nth-child(2) {
    width: auto; /* Description takes remaining space */
}

.accordion-content .documentation-table th:last-child, 
.accordion-content .documentation-table td:last-child {
    width: 100px; /* Actions column */
    text-align: center;
}

/* Sélecteur d'endpoint pour les restrictions */
.restrictions-endpoint-selector {
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(139, 92, 246, 0.08);
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.restrictions-endpoint-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.restrictions-endpoint-selector .form-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--glass-background);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.restrictions-endpoint-selector .form-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.restrictions-endpoint-selector .form-select option {
    background: var(--background-dark);
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        width: 100%;
    }
}

/* Styles pour les restrictions */
.restriction-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

.restriction-badge.open {
    background-color: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.restriction-badge.innovortex {
    background-color: rgba(249, 115, 22, 0.1);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.restriction-badge.restricted {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.restriction-badge.unknown {
    background-color: rgba(156, 163, 175, 0.1);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

/* Styles pour le tableau des restrictions */
#restrictions-list .documentation-table tbody tr:hover {
    background-color: rgba(139, 92, 246, 0.05);
    cursor: pointer;
}

#restrictions-list .documentation-table tbody tr[title] {
    position: relative;
}

/* Message d'erreur et d'absence de données */
.no-data, .error-message {
    font-style: italic;
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
}

.error-message {
    color: #ef4444 !important;
    background-color: rgba(239, 68, 68, 0.05);
    border-radius: 8px;
}

/* Animation de chargement */
.loading-restrictions {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-secondary);
}

.loading-restrictions::before {
    content: '';
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 2px solid transparent;
    border-top: 2px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Styles pour les dropdowns de restriction inline */
.restriction-dropdown {
    width: 100%;
    padding: 6px 12px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 6px;
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 32px;
}

.restriction-dropdown:hover {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.1);
}

.restriction-dropdown:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.8);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.restriction-dropdown:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: rgba(139, 92, 246, 0.05);
}

/* Options du dropdown avec couleurs */
.restriction-dropdown option[value="open"] {
    color: #16a34a;
}

.restriction-dropdown option[value="innovortex"] {
    color: #ea580c;
}

.restriction-dropdown option[value="restricted"] {
    color: #dc2626;
}

/* Effet de réussite pour la sauvegarde */
.restriction-dropdown.success {
    border-color: #16a34a;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}

/* Effet d'erreur pour la sauvegarde */
.restriction-dropdown.error {
    border-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

/* Styles pour les badges d'édition */
.editable-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

.editable-badge.editable {
    background-color: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.editable-badge.non-editable {
    background-color: rgba(156, 163, 175, 0.1);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

/* Styles pour les dropdowns de restriction_editable inline */
.editable-dropdown {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 4px;
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 6px center;
    background-repeat: no-repeat;
    background-size: 12px;
    padding-right: 24px;
}

.editable-dropdown:hover {
    border-color: rgba(34, 197, 94, 0.5);
    box-shadow: 0 1px 3px rgba(34, 197, 94, 0.1);
}

.editable-dropdown:focus {
    outline: none;
    border-color: rgba(34, 197, 94, 0.8);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.1);
}

.editable-dropdown:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: rgba(34, 197, 94, 0.05);
}

/* Options du dropdown avec couleurs */
.editable-dropdown option[value="true"] {
    color: #16a34a;
}

.editable-dropdown option[value="false"] {
    color: #dc2626;
}

/* Effet de réussite pour la sauvegarde */
.editable-dropdown.success {
    border-color: #16a34a;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}

/* Effet d'erreur pour la sauvegarde */
.editable-dropdown.error {
    border-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

/* Styles pour les nouveaux champs de la modal de documentation */
#editDocumentationModal .checkbox-group {
    margin: 15px 0;
}

#editDocumentationModal .checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    transition: color 0.3s ease;
}

#editDocumentationModal .checkbox-group label:hover {
    color: rgba(255, 255, 255, 1);
}

#editDocumentationModal .checkbox-group input[type="checkbox"] {
    margin-right: 12px;
    transform: scale(1.3);
    accent-color: var(--secondary-color);
}

#editDocumentationModal .checkbox-label {
    font-size: 14px;
    font-weight: 500;
}

#editDocumentationModal .help-text {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 5px;
    font-style: italic;
}

#editDocumentationModal #editDocTags {
    font-family: inherit;
    font-size: 14px;
}

#editDocumentationModal #editDocTags::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}
