/**
 * Multi-Customization Module Styles
 */

/* Wrapper de chaque formulaire (sans card) */
.customization-form-wrapper {
    margin-bottom: 30px;
    padding-bottom: 0;
    border-bottom: 1px solid #e5e5e5;
}

.customization-form-wrapper:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Contenu du formulaire */
.customization-form-content {
    padding: 0;
}

.customization-form-content .product-customization {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
}

/* Titre avec numéro et bouton supprimer */
.multicustomization-title {
    display: flex !important;
    align-items: center !important;
    gap: 10px;
}

/* Header fallback créé par le JS */
.multicustomization-header-fallback {
    margin-bottom: 15px;
    color: #2a6654;
    font-size: 18px;
    font-weight: 600;
}

.multicustomization-title .form-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    background: #2a6654;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
}

.multicustomization-title .btn-remove-form {
    width: 28px;
    height: 28px;
    border: 1px solid #dc3545;
    background: transparent;
    color: #dc3545;
    border-radius: 4px;
    font-size: 26px;
    line-height: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    margin-left: auto;
}

.multicustomization-title .btn-remove-form:hover {
    background: #dc3545;
    color: #fff;
}

/* Conteneur des actions (boutons en bas) */
.multicustomization-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 15px;
    border-top: 1px solid #e5e5e5;
}

/* Bouton Ajouter - style discret (link) */
#add-customization-btn,
.add-customization-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    padding: 5px 0;
    transition: color 0.2s ease;
    text-decoration: underline;
}

#add-customization-btn:hover,
.add-customization-btn:hover {
    color: #2a6654;
}

/* Bouton Valider */
#multicustomization-validate {
    margin-left: auto;
}

/* Animations */
.form-appear {
    animation: fadeIn 0.3s ease forwards;
}

.form-disappear {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Spinner de chargement */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

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

/* Styles d'erreur de validation */
.field-error {
    border-color: #dc3545 !important;
    background-color: #fff5f5 !important;
}

.error-message {
    margin-bottom: 15px;
    padding: 10px 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    border-radius: 4px;
    font-size: 14px;
}

/* Message de succès */
.multicustomization-success {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    border-radius: 4px;
    margin-top: 15px;
    animation: fadeIn 0.3s ease;
    width: 100%;
}

.multicustomization-success .success-icon {
    font-size: 18px;
    font-weight: bold;
}

.multicustomization-success .success-text {
    font-weight: 500;
}

/* Masquer le wrapper externe si présent */
#multicustomization-wrapper,
#multicustomization-enabled {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .multicustomization-actions {
        flex-direction: column;
        align-items: stretch;
    }

    #add-customization-btn,
    .add-customization-btn {
        text-align: center;
    }

    #multicustomization-validate {
        margin-left: 0;
        width: 100%;
    }

    .multicustomization-title {
        flex-wrap: wrap;
    }

    .multicustomization-title .btn-remove-form {
        margin-left: 0;
    }
}
