/**
 * Styles pour l'administration de Auto Repair for Wordfence Security
 * @author Mohamed Aggoubi - Weglob
 */

.wfar-container {
    max-width: 1200px;
}

.wfar-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    margin: 20px 0;
    padding: 20px;
}

.wfar-card h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.wfar-card h3 {
    margin-top: 20px;
    color: #2271b1;
}

/* Statuts */
.wfar-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 13px;
}

.wfar-status.active {
    background: #d7f2d4;
    color: #1d6f42;
    border: 1px solid #8bc68a;
}

.wfar-status.inactive {
    background: #f0f0f1;
    color: #646970;
    border: 1px solid #c3c4c7;
}

/* Badges d'action */
.wfar-action-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.wfar-action-repair {
    background: #d7f2d4;
    color: #1d6f42;
}

.wfar-action-delete {
    background: #fcf0f1;
    color: #b32d2e;
}

.wfar-action-skip {
    background: #f0f6fc;
    color: #0a4b78;
}

.wfar-action-error {
    background: #fcf0f1;
    color: #b32d2e;
}

.wfar-action-summary {
    background: #f0f6fc;
    color: #0a4b78;
}

/* Badges de statut */
.wfar-status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.wfar-status-success {
    background: #d7f2d4;
    color: #1d6f42;
}

.wfar-status-error {
    background: #fcf0f1;
    color: #b32d2e;
}

.wfar-status-skipped {
    background: #f0f0f1;
    color: #646970;
}

/* Tableau des logs */
.wfar-logs-table-wrapper {
    overflow-x: auto;
}

.wfar-logs-table-wrapper table {
    margin-top: 10px;
}

.wfar-logs-table-wrapper th {
    font-weight: 600;
}

.wfar-logs-table-wrapper td code {
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    word-break: break-all;
}

/* Résultats d'exécution manuelle */
#wfar-manual-result {
    padding: 12px;
    border-radius: 4px;
    margin-top: 15px;
}

#wfar-manual-result.success {
    background: #d7f2d4;
    border: 1px solid #8bc68a;
    color: #1d6f42;
}

#wfar-manual-result.error {
    background: #fcf0f1;
    border: 1px solid #f0a0a0;
    color: #b32d2e;
}

#wfar-manual-result.running {
    background: #f0f6fc;
    border: 1px solid #8bb8e8;
    color: #0a4b78;
}

#wfar-manual-result h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
}

#wfar-manual-result ul {
    margin: 5px 0;
    padding-left: 20px;
}

#wfar-manual-result .spinner {
    float: none;
    margin: 0 5px 0 0;
}

/* Carte d'information */
.wfar-info {
    background: #f0f6fc;
    border-color: #8bb8e8;
}

.wfar-info p {
    line-height: 1.8;
}

.wfar-info ul,
.wfar-info ol {
    line-height: 1.8;
}

/* Boutons */
#wfar-manual-run.running {
    opacity: 0.6;
    cursor: not-allowed;
}

#wfar-manual-run.running:before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: wfar-spin 0.6s linear infinite;
}

@keyframes wfar-spin {
    to { transform: rotate(360deg); }
}

/* Formulaire */
.form-table th {
    width: 250px;
}

.form-table td p.description {
    margin-top: 5px;
    font-style: italic;
}

textarea.large-text.code {
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
}

/* Responsive */
@media screen and (max-width: 782px) {
    .wfar-container {
        margin: 10px;
    }
    
    .wfar-card {
        padding: 15px;
    }
    
    .form-table th {
        width: auto;
    }
    
    .wfar-logs-table-wrapper {
        overflow-x: scroll;
    }
}

/* Alertes de sécurité */
.wfar-card table tr td p.description strong {
    font-weight: 600;
}

/* Animation de chargement */
.wfar-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #2271b1;
    border-top-color: transparent;
    border-radius: 50%;
    animation: wfar-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-left: 8px;
}

/* Notice personnalisée */
.wfar-notice {
    padding: 12px;
    margin: 15px 0;
    border-left: 4px solid;
    background: #fff;
}

.wfar-notice.warning {
    border-color: #dba617;
    background: #fcf8e3;
}

.wfar-notice.info {
    border-color: #2271b1;
    background: #f0f6fc;
}

.wfar-notice p {
    margin: 0.5em 0;
}

/* Amélioration du tableau */
.wp-list-table tbody tr:hover {
    background-color: #f6f7f7;
}

/* Code dans les messages */
.wfar-logs-table-wrapper td {
    font-size: 13px;
}

/* Bouton de nettoyage des logs */
form[method="post"] input[type="submit"][name="wfar_clean_logs"] {
    margin-left: 10px;
}
