/* Styles spéciaux pour les éléments de web-api avec le thème index.html */

/* Method display avec glassmorphism */
.method-display {
    padding: 12px 15px;
    background: rgba(59, 130, 246, 0.2) !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #93c5fd !important;
    backdrop-filter: blur(5px);
}

/* Styles pour le panneau de documentation dynamique */
#endpoint-documentation {
    color: white;
    font-family: 'Montserrat', sans-serif;
}

.doc-placeholder {
    text-align: center;
    padding: 30px;
}

.doc-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.doc-route-title {
    color: #93c5fd;
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    margin: 0;
    background: rgba(59, 130, 246, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.doc-method-section {
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.doc-method-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.method-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.8em;
    font-family: 'Courier New', monospace;
}

.method-get { background: rgba(34, 197, 94, 0.2); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.4); }
.method-post { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4); }
.method-put { background: rgba(251, 146, 60, 0.2); color: #fb923c; border: 1px solid rgba(251, 146, 60, 0.4); }
.method-delete { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.method-patch { background: rgba(168, 85, 247, 0.2); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.4); }

.method-summary {
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

.doc-description {
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

.doc-tags {
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
}

.doc-tag {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8em;
    margin-left: 5px;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.doc-parameters h4,
.doc-request-body h4,
.doc-responses h4 {
    color: #e5e7eb;
    margin: 0 0 10px 0;
    font-size: 1em;
    font-weight: 600;
}

.parameters-list,
.responses-list {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.param-item {
    margin-bottom: 12px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    border-left: 3px solid rgba(59, 130, 246, 0.5);
}

.param-item:last-child {
    margin-bottom: 0;
}

.param-name {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.param-name code {
    background: rgba(0, 0, 0, 0.3);
    color: #93c5fd;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.param-required {
    color: #f87171;
    font-weight: bold;
}

.param-location {
    background: rgba(75, 85, 99, 0.3);
    color: #d1d5db;
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 0.7em;
    font-weight: normal;
}

.param-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.param-type {
    color: #fbbf24;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
}

.param-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85em;
    line-height: 1.3;
}

.response-item {
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.response-item:last-child {
    margin-bottom: 0;
}

.response-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.status-code {
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 0.9em;
}

.status-success { background: rgba(34, 197, 94, 0.35); color: #4ade80; }
.status-redirect { background: rgba(251, 146, 60, 0.35); color: #fb923c; }
.status-client-error { background: rgba(239, 68, 68, 0.35); color: #f87171; }
.status-server-error { background: rgba(185, 28, 28, 0.35); color: #fca5a5; }
.status-default { background: rgba(107, 114, 128, 0.35); color: #9ca3af; }

.response-description {
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

.response-content {
    margin-top: 8px;
    padding-left: 15px;
}

.response-content-type {
    margin-bottom: 8px;
}

.response-content-type em {
    color: #fbbf24;
    font-family: 'Courier New', monospace;
    font-style: normal;
    font-size: 0.85em;
}

.schema-info {
    margin-top: 6px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    color: #e5e7eb;
}

.schema-object {
    color: #d1d5db;
}

.schema-props {
    margin-left: 15px;
    margin: 8px 0 8px 15px;
}

.schema-prop {
    margin-bottom: 4px;
}

.schema-prop code {
    color: #93c5fd;
    background: none;
    padding: 0;
}

.content-types,
.doc-request-body {
    margin-bottom: 15px;
}

.content-type {
    margin-bottom: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.content-type strong {
    color: #fbbf24;
    font-family: 'Courier New', monospace;
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

/* Boutons d'export avec glassmorphism */
#export-buttons-container button,
#export-buttons-container-inline button,
.export-buttons-mini button {
    background: rgba(55, 65, 81, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif !important;
}

#export-buttons-container button:hover,
#export-buttons-container-inline button:hover,
.export-buttons-mini button:hover {
    background: rgba(75, 85, 99, 0.5) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Bouton de copie URL */
.copy-url-btn {
    background: transparent !important;
    color: rgba(255, 255, 255, 0.7) !important;
    border: none !important;
    padding: 0 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.copy-url-btn:hover {
    background: transparent !important;
    color: white !important;
    opacity: 1;
    transform: none !important;
    box-shadow: none !important;
}

/* Styles pour l'affichage du temps de réponse */
.response-time-display {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 8px 12px;
}

.time-value {
    color: white !important;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.time-unit {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Icône d'authentification */
.auth-icon, .auth-icon-floating {
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5)) !important;
    color: white !important;
}

/* Wrapper pour réponse JSON */
.response-wrapper {
    position: relative;
    margin: 15px 0;
}

/* Status avec temps */
.status-with-time {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 10px;
    backdrop-filter: blur(5px);
    margin: 15px 0;
}

.status-left {
    flex: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.response-right-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

/* Placeholder de chargement */
.loading-placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 10px;
    backdrop-filter: blur(5px);
    font-family: 'Montserrat', sans-serif !important;
}

/* Panneau droit avec layout flex vertical adapté */
.right-panel {
    display: flex !important;
    flex-direction: column !important;
    overflow-y: hidden !important;
}

.right-panel h2 {
    flex-shrink: 0;
    margin-top: 0;
    margin-bottom: 20px;
}

/* Zone de réponse avec scroll */
#responses {
    flex-grow: 1;
    overflow-y: auto;
    padding-bottom: 10px;
    min-height: 200px;
}

/* Barre d'export entre URL et réponse */
#export-buttons-container,
#export-buttons-container-inline {
    flex-shrink: 0;
    height: 46px;
    margin: 10px 0;
    display: flex;
    gap: 10px;
    min-height: 46px;
}

/* Légende des paramètres */
.param-legend {
    margin: 15px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 10px;
    backdrop-filter: blur(5px);
    font-size: 0.85em;
    font-family: 'Montserrat', sans-serif !important;
}

.legend-title {
    display: block;
    margin-bottom: 10px;
    color: #ffd700 !important;
    font-weight: 600 !important;
    font-family: 'Montserrat', sans-serif !important;
}

.legend-item {
    margin: 8px 0;
    color: rgba(255, 255, 255, 0.8) !important;
    font-family: 'Montserrat', sans-serif !important;
}

/* Paramètres colorés */
.param-required {
    color: #fca5a5 !important;
}

.param-optional {
    color: #93c5fd !important;
}

.param-placeholder.required {
    background-color: rgba(252, 165, 165, 0.2) !important;
    border: 1px solid rgba(252, 165, 165, 0.4) !important;
    color: #fca5a5 !important;
}

.param-placeholder.optional {
    background-color: rgba(147, 197, 253, 0.2) !important;
    border: 1px solid rgba(147, 197, 253, 0.4) !important;
    color: #93c5fd !important;
}

/* Bouton Test Auto */
.test-auto-btn {
    background: rgba(124, 58, 237, 0.8) !important;
    border: 1px solid rgba(167, 139, 250, 0.6) !important;
    color: white !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    padding: 10px 20px !important;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif !important;
    cursor: pointer;
}

.test-auto-btn:hover {
    background: rgba(139, 92, 246, 0.9) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

/* Bouton Tests Qualité */
.quality-tests-btn {
    background: rgba(245, 158, 11, 0.8) !important;
    border: 1px solid rgba(251, 191, 36, 0.6) !important;
    color: white !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    padding: 10px 20px !important;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif !important;
    cursor: pointer;
}

.quality-tests-btn:hover {
    background: rgba(251, 191, 36, 0.9) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

/* Bouton Exécuter avec style cohérent */
.execute-btn {
    background: rgba(34, 197, 94, 0.8) !important;
    border: 1px solid rgba(74, 222, 128, 0.6) !important;
    color: white !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    padding: 10px 20px !important;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif !important;
    cursor: pointer;
}

.execute-btn:hover {
    background: rgba(34, 197, 94, 0.9) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

/* Groupe de boutons */
.button-group {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    margin-top: 15px !important;
}

.form-group.button-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.form-group button {
    height: fit-content;
}

/* ===== PANNEAU DOCUMENTATION DYNAMIQUE ===== */

/* Conteneur principal de la documentation */
#endpoint-documentation {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 10px;
    padding: 20px;
    backdrop-filter: blur(10px);
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Montserrat', sans-serif;
}

/* Titre de l'endpoint */
.doc-endpoint-title {
    color: #93c5fd !important;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.doc-method-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
}

.doc-method-badge.get { background: rgba(34, 197, 94, 0.8); }
.doc-method-badge.post { background: rgba(59, 130, 246, 0.8); }
.doc-method-badge.put { background: rgba(245, 158, 11, 0.8); }
.doc-method-badge.delete { background: rgba(239, 68, 68, 0.8); }
.doc-method-badge.patch { background: rgba(139, 92, 246, 0.8); }

/* Description de l'endpoint */
.doc-description {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 14px;
}

/* Sections de documentation */
.doc-section {
    margin-bottom: 20px;
}

.doc-section h4 {
    color: #ffd700 !important;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Paramètres */
.doc-param {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
}

.doc-param-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.doc-param-name {
    font-family: 'Courier New', monospace;
    color: #93c5fd;
    font-weight: 600;
    font-size: 13px;
}

.doc-param-type {
    background: rgba(156, 163, 175, 0.3);
    color: rgba(255, 255, 255, 0.7);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-family: 'Courier New', monospace;
}

.doc-param-required {
    background: rgba(239, 68, 68, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.doc-param-optional {
    background: rgba(34, 197, 94, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.doc-param-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    line-height: 1.4;
    margin-top: 5px;
}

/* Réponses */
.doc-response {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
}

.doc-response-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.doc-status-code {
    background: rgba(34, 197, 94, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 12px;
}

.doc-status-code.error {
    background: rgba(239, 68, 68, 0.8);
}

.doc-response-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    line-height: 1.4;
}

/* Exemple de code */
.doc-example {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 6px;
    padding: 12px;
    margin-top: 10px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #e2e8f0;
    white-space: pre-wrap;
    overflow-x: auto;
}

/* Animation de chargement */
.doc-loading {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.6);
}

.doc-loading::after {
    content: "...";
    animation: docLoading 1.5s infinite;
}

@keyframes docLoading {
    0%, 33% { content: "..."; }
    34%, 66% { content: "...."; }
    67%, 100% { content: "....."; }
}

/* Responsive pour petits écrans */
@media (max-width: 768px) {
    .status-with-time {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .response-time-display {
        align-self: flex-end;
    }
    
    .response-right-section {
        gap: 10px;
    }
    
    #endpoint-documentation {
        padding: 15px;
    }
    
    .doc-param-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .doc-response-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Positionnement des boutons principaux */
.button-group {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    margin-top: 15px !important;
}

/* Ligne dédiée aux boutons de gestion (réservés aux gestionnaires) */
.button-group-admin {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    margin-top: 5px !important;
}

/* Bouton Refresh spécial - plus petit et réservé aux utilisateurs avec droits de gestion */
.refresh-btn {
    background: linear-gradient(45deg, #059669, #10b981) !important;
    padding: 8px 16px !important;
    font-size: 12px !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    border-radius: 6px !important;
}

.refresh-btn:hover {
    background: linear-gradient(45deg, #047857, #059669) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3) !important;
}

/* Bouton Me - pour tester /users/me */
.me-btn {
    background: linear-gradient(45deg, #3b82f6, #6366f1) !important;
    padding: 8px 16px !important;
    font-size: 12px !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    border-radius: 6px !important;
}

.me-btn:hover {
    background: linear-gradient(45deg, #2563eb, #4f46e5) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3) !important;
}

/* Bouton Test Wordpress */
.wp-test-btn {
    background: rgba(107, 114, 128, 0.8) !important;
    border: 1px solid rgba(156, 163, 175, 0.6) !important;
    color: white !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    padding: 10px 20px !important;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif !important;
    cursor: pointer;
}

.wp-test-btn:hover {
    background: rgba(107, 114, 128, 0.9) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.4);
}

/* Ajustement de la taille de la police pour les boutons de test pour éviter les sauts de ligne */
.test-auto-btn,
.quality-tests-btn,
.wp-test-btn {
    font-size: 13px !important; /* Réduction de la taille de la police */
    white-space: nowrap; /* Empêche le texte de passer à la ligne */
}
