/**
 * Styles pour le formulaire de newsletter phpList
 */

/* Container principal */
.phplist-newsletter-widget,
.phplist-newsletter-shortcode {
    margin: 20px 0;
}

/* Formulaire */
.phplist-newsletter-form {
    max-width: 100%;
}

/* Champs */
.phplist-field {
    margin-bottom: 15px;
}

.phplist-field input[type="text"],
.phplist-field input[type="email"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.phplist-field input[type="text"]:focus,
.phplist-field input[type="email"]:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

.phplist-field input.error {
    border-color: #dc3545;
}

/* Bouton submit */
.phplist-submit {
    width: 100%;
    padding: 12px 20px;
    background-color: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.phplist-submit:hover {
    background-color: #005a87;
    transform: translateY(-1px);
}

.phplist-submit:active {
    transform: translateY(0);
}

.phplist-submit:disabled,
.phplist-submit.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Animation de chargement */
.phplist-submit.loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: phplist-spin 0.8s linear infinite;
}

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

/* Messages */
.phplist-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
    display: none;
}

.phplist-message.show {
    display: block;
    animation: phplist-fadeIn 0.3s;
}

.phplist-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.phplist-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

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

/* Listes de choix */
.phplist-lists {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background-color: #f9f9f9;
}

.phplist-lists label {
    display: block;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    padding: 5px;
    border-radius: 3px;
}

.phplist-lists label:hover {
    background-color: #e9ecef;
}

.phplist-lists input[type="checkbox"] {
    margin-right: 8px;
}

/* Privacy checkbox */
.phplist-privacy {
    margin: 15px 0;
}

.phplist-privacy label {
    display: flex;
    align-items: flex-start;
    font-size: 13px;
    color: #666;
    cursor: pointer;
}

.phplist-privacy input[type="checkbox"] {
    margin-right: 8px;
    margin-top: 2px;
    flex-shrink: 0;
}

.phplist-privacy small {
    line-height: 1.4;
}

/* Styles spécifiques pour différents designs */

/* Style minimal */
.phplist-style-minimal .phplist-field input {
    border: none;
    border-bottom: 2px solid #ddd;
    border-radius: 0;
    padding-left: 0;
    padding-right: 0;
}

.phplist-style-minimal .phplist-field input:focus {
    border-bottom-color: #007cba;
    box-shadow: none;
}

.phplist-style-minimal .phplist-submit {
    background-color: transparent;
    color: #007cba;
    border: 2px solid #007cba;
}

.phplist-style-minimal .phplist-submit:hover {
    background-color: #007cba;
    color: white;
}

/* Style arrondi */
.phplist-style-rounded .phplist-field input,
.phplist-style-rounded .phplist-submit {
    border-radius: 25px;
    padding-left: 20px;
    padding-right: 20px;
}

/* Style inline */
.phplist-style-inline .phplist-newsletter-form {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.phplist-style-inline .phplist-field {
    flex: 1;
    margin-bottom: 0;
}

.phplist-style-inline .phplist-submit {
    width: auto;
    white-space: nowrap;
}

.phplist-style-inline .phplist-message {
    position: absolute;
    width: 100%;
    margin-top: 45px;
}

.phplist-style-inline .phplist-privacy {
    width: 100%;
    margin-top: 10px;
}

/* Style dark */
.phplist-style-dark {
    background-color: #2c3e50;
    padding: 25px;
    border-radius: 8px;
}

.phplist-style-dark .phplist-field input {
    background-color: #34495e;
    border-color: #34495e;
    color: white;
}

.phplist-style-dark .phplist-field input::placeholder {
    color: #95a5a6;
}

.phplist-style-dark .phplist-field input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 1px #3498db;
}

.phplist-style-dark .phplist-submit {
    background-color: #3498db;
    border: none;
}

.phplist-style-dark .phplist-submit:hover {
    background-color: #2980b9;
}

.phplist-style-dark .phplist-privacy label {
    color: #ecf0f1;
}

/* Responsive */
@media (max-width: 480px) {
    .phplist-style-inline .phplist-newsletter-form {
        flex-direction: column;
    }
    
    .phplist-style-inline .phplist-field {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .phplist-style-inline .phplist-submit {
        width: 100%;
    }
    
    .phplist-style-inline .phplist-message {
        position: static;
        margin-top: 15px;
    }
}

/* Widget WordPress sidebar */
.widget .phplist-newsletter-widget .phplist-field input {
    width: 100%;
}

.widget .phplist-newsletter-widget .phplist-submit {
    width: 100%;
}

/* Animations supplémentaires */
.phplist-shake {
    animation: phplist-shake 0.5s;
}

@keyframes phplist-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Accessibilité */
.phplist-field input:focus-visible,
.phplist-submit:focus-visible {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Mode sombre automatique */
@media (prefers-color-scheme: dark) {
    .phplist-newsletter-widget,
    .phplist-newsletter-shortcode {
        color: #e0e0e0;
    }
    
    .phplist-field input {
        background-color: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .phplist-field input::placeholder {
        color: #999;
    }
    
    .phplist-lists {
        background-color: #2a2a2a;
        border-color: #444;
    }
}
