/* Styles frontend pour WhatsApp Contact Form */

:root {
    --whatsapp-primary-color: #25D366;
    --whatsapp-primary-hover: #1ea952;
    --whatsapp-text-color: #ffffff;
    --whatsapp-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    --whatsapp-shadow-hover: 0 6px 20px rgba(37, 211, 102, 0.4);
    --whatsapp-border-radius: 50px;
    --whatsapp-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Bouton flottant principal */
#whatsapp-contact-button {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Positions */
#whatsapp-contact-button.position-bottom-right {
    bottom: 20px;
    right: 20px;
}

#whatsapp-contact-button.position-bottom-left {
    bottom: 20px;
    left: 20px;
}

#whatsapp-contact-button.position-top-right {
    top: 20px;
    right: 20px;
}

#whatsapp-contact-button.position-top-left {
    top: 20px;
    left: 20px;
}

/* Bouton */
.whatsapp-button {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--whatsapp-primary-color);
    color: var(--whatsapp-text-color);
    border: none;
    border-radius: var(--whatsapp-border-radius);
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--whatsapp-shadow);
    transition: var(--whatsapp-transition);
    outline: none;
    font-family: inherit;
}

.whatsapp-button:hover {
    background: var(--whatsapp-primary-hover);
    box-shadow: var(--whatsapp-shadow-hover);
    transform: translateY(-2px);
}

.whatsapp-button:focus {
    outline: 2px solid var(--whatsapp-primary-color);
    outline-offset: 2px;
}

.whatsapp-button:active {
    transform: translateY(0);
}

/* Tailles */
#whatsapp-contact-button.size-small .whatsapp-button {
    padding: 12px 16px;
    font-size: 14px;
}

#whatsapp-contact-button.size-medium .whatsapp-button {
    padding: 15px 20px;
    font-size: 16px;
}

#whatsapp-contact-button.size-large .whatsapp-button {
    padding: 18px 24px;
    font-size: 18px;
}

/* Icône */
.whatsapp-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.custom-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    object-fit: contain;
}

#whatsapp-contact-button.size-small .whatsapp-icon,
#whatsapp-contact-button.size-small .custom-icon {
    width: 20px;
    height: 20px;
}

#whatsapp-contact-button.size-large .whatsapp-icon,
#whatsapp-contact-button.size-large .custom-icon {
    width: 28px;
    height: 28px;
}

/* Texte du bouton */
.button-text {
    white-space: nowrap;
}

/* Animation d'entrée */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#whatsapp-contact-button {
    animation: slideInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modal */
.whatsapp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
}

/* En-tête de la modal */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: var(--whatsapp-primary-color);
    color: var(--whatsapp-text-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--whatsapp-text-color);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-close svg {
    width: 24px;
    height: 24px;
}

/* Corps de la modal */
.modal-body {
    padding: 24px;
}

/* Formulaire */
#whatsapp-contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group textarea {
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s ease;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--whatsapp-primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Actions du formulaire */
.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.whatsapp-send-button {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--whatsapp-primary-color);
    color: var(--whatsapp-text-color);
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--whatsapp-transition);
    font-family: inherit;
}

.whatsapp-send-button:hover {
    background: var(--whatsapp-primary-hover);
    transform: translateY(-1px);
}

.whatsapp-send-button:active {
    transform: translateY(0);
}

.whatsapp-send-button .whatsapp-icon,
.whatsapp-send-button .custom-icon {
    width: 20px;
    height: 20px;
}

/* Animations de la modal */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.whatsapp-modal {
    animation: modalFadeIn 0.3s ease;
}

.modal-content {
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive */
@media (max-width: 768px) {
    #whatsapp-contact-button.position-bottom-right,
    #whatsapp-contact-button.position-bottom-left {
        bottom: 15px;
    }
    
    #whatsapp-contact-button.position-bottom-right {
        right: 15px;
    }
    
    #whatsapp-contact-button.position-bottom-left {
        left: 15px;
    }
    
    #whatsapp-contact-button.position-top-right,
    #whatsapp-contact-button.position-top-left {
        top: 15px;
    }
    
    #whatsapp-contact-button.position-top-right {
        right: 15px;
    }
    
    #whatsapp-contact-button.position-top-left {
        left: 15px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    /* Masquer le texte sur mobile pour les petits boutons */
    #whatsapp-contact-button.size-small .button-text {
        display: none;
    }
    
    #whatsapp-contact-button.size-small .whatsapp-button {
        border-radius: 50%;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: none;
    }
    
    .modal-body {
        padding: 16px;
    }
}

/* États de chargement */
.whatsapp-send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.whatsapp-send-button.loading {
    position: relative;
    color: transparent;
}

.whatsapp-send-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid var(--whatsapp-text-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Accessibilité */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
    .modal-content {
        background: #1a1a1a;
        color: #fff;
    }
    
    .form-group label {
        color: #fff;
    }
    
    .form-group input,
    .form-group textarea {
        background: #2a2a2a;
        border-color: #444;
        color: #fff;
    }
    
    .form-group input:focus,
    .form-group textarea:focus {
        border-color: var(--whatsapp-primary-color);
    }
}

/* Effets de survol avancés */
.whatsapp-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.whatsapp-button:hover::before {
    transform: translateX(100%);
}

/* Pulse animation pour attirer l'attention */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

.whatsapp-button.pulse {
    animation: pulse 2s infinite;
}

