/**
 * Styles personnalisés pour modifier la disposition du formulaire
 * Design avec étapes numérotées et lignes de progression
 */

/* Modification du conteneur principal pour utiliser un layout vertical */
.form-builder-form-container {
  flex-direction: column;
  width: 100%;
}

/* Custom CSS for Form Builder public forms */

/* Main form container layout */
.form-builder-form {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
}

/* Navigation section styling - Design inspiré de l'image */
.form-builder-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 2rem;
    padding: 1.5rem 0;
    position: relative;
    background-color: #191e5a; /* Fond bleu foncé comme sur l'image */
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 0.5rem;
}

/* Ligne horizontale qui connecte les étapes */
.form-builder-navigation::before {
    content: "";
    position: absolute;
    top: 35%;
    left: 0;
    right: 0;
    height: 2px;
    background-color: white;
    z-index: 1;
    transform: translateY(-50%);
    width: 63%;
    margin: 0 auto;
}

.form-builder-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    text-align: center;
    width: 33.33%; /* Adapté pour 3 étapes */
}

/* Le numéro d'étape dans un cercle */
.form-builder-nav-item::before {
    content: attr(data-step);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background-color: #8b92bc; /* Gris-bleu pour les étapes inactives */
    color: white;
    border-radius: 50%;
    margin-bottom: 0.75rem;
    font-weight: bold;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

/* Style de l'étape active */
.form-builder-nav-item.active::before {
    background-color: white; /* Cercle blanc pour l'étape active */
    color: #BEA13F; /* Texte en bleu foncé */
    box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.2);
}

.form-builder-nav-item.active {
    color: white;
    font-weight: 600;
}

/* Form content area */
.form-builder-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 20px 0;
    width: 100%;
}

.form-builder-section {
    display: none;
    width: 100%;
}

.form-builder-section.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

/* Ensure all form fields container have the same width */
.form-builder-fields {
    width: 100% !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .form-builder-navigation {
        flex-wrap: wrap;
        padding: 1.5rem 1rem;
    }

    .form-builder-navigation::before {
        display: none; /* Masquer la ligne sur mobile */
    }
    
    .form-builder-nav-item {
        padding: 8px 0;
        font-size: 14px;
        width: 33.33%;
    }

    .form-builder-nav-item::before {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
}

/* Animation for section transitions */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Styles pour les détails d'erreur */
.form-builder-error-details {
    margin: 20px 0;
    padding: 15px;
    background-color: #ffffff;
    border: 1px solid #ffffff;
    border-radius: 5px;
}

.form-builder-error-details h3 {
    margin-top: 0;
    color: #000000;
    font-size: 18px;
}

.form-builder-error-details h4 {
    margin: 15px 0 10px;
    color: #d32f2f;
    font-size: 16px;
}

/* Style pour les erreurs du debug.log */
.form-builder-debug-log-errors {
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    padding: 10px 15px;
    margin: 10px 0 20px;
    border-radius: 4px;
    max-height: 300px;
    overflow-y: auto;
}

.form-builder-debug-log-errors ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

.form-builder-debug-log-errors ul li {
    padding: 8px 5px;
    border-bottom: 1px solid #e0e0e0;
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 13px;
    line-height: 1.4;
}

.form-builder-debug-log-errors ul li:last-child {
    border-bottom: none;
}

.form-builder-debug-log-errors strong {
    color: #555;
}

/* Style pour les erreurs de champ spécifiques */
.form-builder-field-errors {
    background-color: #fef9f9;
    padding: 10px 15px;
    border-left: 3px solid #ff5252;
    margin-bottom: 15px;
}

/* Style pour les erreurs API */
.form-builder-api-errors {
    background-color: #fdeeee;
    padding: 12px 15px;
    border-left: 3px solid #d32f2f;
    margin-bottom: 15px;
}

/* Ajout d'une icône pour les erreurs */
.form-builder-error-item::before {
    content: "\f534"; /* Dashicon pour erreur */
    font-family: dashicons;
    color: #d32f2f;
    margin-right: 8px;
    vertical-align: middle;
}

/* Styles pour les différents types d'erreurs dans les logs */
.form-builder-debug-log-errors .error-error {
    background-color: #ffeeee;
    border-left: 2px solid #d32f2f;
}

.form-builder-debug-log-errors .error-warning {
    background-color: #fff8e1;
    border-left: 2px solid #ff9800;
}

.form-builder-debug-log-errors .error-info {
    background-color: #e1f5fe;
    border-left: 2px solid #03a9f4;
}

.form-builder-debug-log-errors .error-debug {
    background-color: #f5f5f5;
    border-left: 2px solid #9e9e9e;
}

/* Styles pour la correction automatique par IA */
.form-builder-autofix-container {
    display: flex;
    align-items: center;
    margin-top: 15px;
}

#form-builder-autofix-button {
    display: inline-flex;
    align-items: center;
    background-color: #BEA13F;
    color: white;
    border-color: #BEA13F;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#form-builder-autofix-button:hover {
    background-color: #0c0638;
}

#form-builder-autofix-button:disabled {
    background-color: #a0a0a0;
    border-color: #888888;
    cursor: not-allowed;
}

#form-builder-autofix-result {
    background-color: #f0f8ff;
    padding: 10px 15px;
    border-left: 4px solid #4a90e2;
    border-radius: 3px;
    margin: 15px 0;
}

#form-builder-autofix-result p.success {
    color: #2e7d32;
}

#form-builder-autofix-result p.error {
    color: #d32f2f;
} 