/* wp-ai-for-elementor.css */

/* Style général pour tous les boutons (hérite des styles Elementor si présents) */
.wp-ai-button,
.ai-copy-button {
    all: unset; /* Supprime les styles par défaut */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--wp-ai-button-padding, 10px 15px); /* Valeur par défaut si aucun padding hérité */
    font-size: inherit;
    background-color: inherit;
    color: inherit;
    border: inherit;
    border-radius: inherit;
    font-family: inherit;
    font-weight: inherit;
    text-transform: inherit;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}


/* Effet hover identique pour les deux boutons */
.wp-ai-button:hover,
.ai-copy-button:hover {
    background-color: inherit;
    transform: var(--wp-ai-button-hover-effect, none);
}

/* Effet clic */
.wp-ai-button:active,
.ai-copy-button:active {
    transform: none;
}

/* Effet focus */
.wp-ai-button:focus,
.ai-copy-button:focus {
    outline: none;
    box-shadow: inherit;
}
.ai-copy-button {
    padding: 2 4 2 4;
}

/* Style du formulaire */
.wp-ai-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

/* Style des champs de formulaire */
.wp-ai-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.wp-ai-field label {
    font-weight: inherit;
    font-size: inherit;
    margin-bottom: 5px;
    color: inherit;
    font-family: inherit;
}

.wp-ai-field input[type="text"],
.wp-ai-field textarea,
.wp-ai-field select {
    width: 100%;
    padding: 10px; /* Ajout d'une valeur par défaut */
    font-size: 16px; /* Ajout d'une valeur par défaut */
    border: 1px solid #ccc; /* Ajout d'une bordure visible */
    border-radius: 5px; /* Ajout d'un arrondi standard */
    box-sizing: border-box;
    font-family: inherit;
    color: inherit;
    background-color: #fff; /* Ajout d'une couleur de fond par défaut */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.wp-ai-field input[type="text"]:focus,
.wp-ai-field textarea:focus,
.wp-ai-field select:focus {
    border-color: #0073aa; /* Ajout d'une couleur de focus */
    box-shadow: 0 0 5px rgba(0, 115, 170, 0.5); /* Effet visuel au focus */
    outline: none;
}

/* Style pour les champs multiselect */
.wp-ai-field select[multiple] {
    height: auto;
    min-height: inherit;
}

/* Style pour le champ d'upload de fichiers */
.wp-ai-field input[type="file"] {
    border: inherit;
    padding: inherit;
    font-size: inherit;
    font-family: inherit;
}

/* Espacement entre les champs et le bouton */
.wp-ai-form .wp-ai-field + .wp-ai-button {
    margin-top: 20px;
}

/* Spinner de chargement */
.ai-response-container.loading {
    position: relative;
    min-height: 50px;
}

.ai-spinner {
    display: block;
    width: 40px;
    height: 40px;
    margin: 10px auto;
    border: 4px solid rgba(0, 0, 0, 0.2);
    border-top-color: inherit;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Styles pour la réponse de l'IA */
.ai-response-container {
    display: none; /* Masquer la réponse par défaut */
    padding: 15px;
    background-color: #e0e0e0; /* Ajuste la couleur du conteneur */
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    margin-top: 20px;
    white-space: pre-wrap;
    transition: all 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 500px; /* Hauteur doublée */
    overflow: hidden;
}

/* Affichage de la réponse après réception */
.ai-response-container.visible {
    display: flex;
}

/* Conteneur de la réponse + bouton copier */
.response-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 10px;
}

/* Zone de texte pour afficher la réponse */
.ai-response-textarea {
    flex-grow: 1;
    width: 100%;
    height: 100%;
    min-height: 250px; /* Hauteur doublée */
    max-height: 500px; /* Ajustable */
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    resize: vertical;
    background-color: white;
}
/* STYLE DES LABELS - HÉRITAGE DES STYLES GLOBAUX */
.wp-ai-field label {
    font-weight: inherit;
    font-size: inherit;
    color: inherit;
    font-family: inherit;
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

/* STYLE DES PLACEHOLDERS - UTILISATION DES STYLES GLOBAUX */
.wp-ai-field input::placeholder,
.wp-ai-field textarea::placeholder {
    font-size: inherit;
    font-family: inherit;
    color: inherit;
    opacity: 0.7; /* Ajuste l'opacité pour plus de lisibilité */
}

/* PLACEHOLDER AU FOCUS */
.wp-ai-field input:focus::placeholder,
.wp-ai-field textarea:focus::placeholder {
    opacity: 0.5; /* Diminue légèrement la visibilité au focus */
}

/* PLACEHOLDER COULEUR AUTOMATIQUE D'ADAPTATION AU THÈME */
.wp-ai-field input::placeholder,
.wp-ai-field textarea::placeholder {
    color: var(--wp-ai-placeholder-color, #888); /* Hérite ou prend une couleur par défaut */
}

/* BORDURE & STYLE DES CHAMPS AU FOCUS */
.wp-ai-field input[type="text"]:focus,
.wp-ai-field textarea:focus {
    border-color: var(--wp-ai-field-focus-border, #0073aa);
    box-shadow: 0 0 5px rgba(0, 115, 170, 0.5);
}

/* ASSURE L'HÉRITAGE DES CHAMPS MULTISELECT */
.wp-ai-field select[multiple] {
    min-height: inherit;
}

/* STYLE DU CHAMP UPLOAD */
.wp-ai-field input[type="file"] {
    border: inherit;
    padding: inherit;
    font-size: inherit;
    font-family: inherit;
}
