/* Widget WhatsApp Styles */

/* Botón flotante */
#wsp-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.wsp-floating-button {
    background: #25D366;
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    text-decoration: none;
    min-width: 60px;
    justify-content: center;
}

.wsp-floating-button:hover {
    /* background: #128C7E; */
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.5);
}

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

.wsp-floating-button svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Modal */
.wsp-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.wsp-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: wspModalSlideIn 0.3s ease-out;
    overflow: hidden;
}

@keyframes wspModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.wsp-modal-header {
    background: #075e54;
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.wsp-assistant-icon {
    width: 40px;
    height: 40px;
    background: #fa7027;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.wsp-assistant-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.wsp-assistant-status {
    font-size: 12px;
    opacity: 0.8;
    margin: 0;
}

.wsp-close {
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.3s ease;
    margin-left: auto;
    padding: 5px;
}

.wsp-close:hover {
    opacity: 0.7;
}

/* Chat Area */
.wsp-chat-area {
    background: #e4ddd4;
    padding: 20px;
    padding-bottom: 40px;
    min-height: 80px;
    border-bottom: 1px solid #e9ecef;
}

.wsp-chat-bubble {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 80%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.wsp-chat-bubble::before {
    content: '';
    position: absolute;
    left: -8px;
    bottom: 10px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-right-color: white;
    border-left: none;
    border-top: none;
}

.wsp-chat-time {
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
}

/* Formulario */
.wsp-form {
    padding: 30px;
    background: white;
}

.wsp-form-title {
    text-align: center;
    color: #128C7E;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 25px 0;
}

.wsp-form-group {
    margin-bottom: 20px;
}

.wsp-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.wsp-form-group input,
.wsp-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: #fff;
}

.wsp-form-group input:focus,
.wsp-form-group textarea:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
    transform: translateY(-1px);
}

.wsp-form-group input::placeholder,
.wsp-form-group textarea::placeholder {
    color: #adb5bd;
    font-style: italic;
}

.wsp-form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.wsp-submit-btn {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    position: relative;
    overflow: hidden;
}

.wsp-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.wsp-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.wsp-submit-btn:hover::before {
    left: 100%;
}

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

.wsp-submit-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.wsp-submit-btn:hover svg {
    transform: translateX(2px);
}

/* Estados de carga */
.wsp-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.wsp-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: wspSpin 1s ease-in-out infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .wsp-modal-content {
        margin: 5% auto;
        width: 95%;
        max-width: 350px;
    }
    
    .wsp-form {
        padding: 20px;
    }
    
    .wsp-form-title {
        font-size: 16px;
    }
    
    .wsp-chat-area {
        padding: 15px;
    }
    
    .wsp-chat-bubble {
        max-width: 90%;
        padding: 10px 14px;
    }
    
    .wsp-floating-button {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .wsp-floating-button span {
        display: none;
    }
}

@media (max-width: 480px) {
    #wsp-widget {
        bottom: 15px;
        right: 15px;
    }
    
    .wsp-floating-button {
        width: 56px;
        height: 56px;
        padding: 0;
        border-radius: 50%;
    }
    
    .wsp-modal-content {
        margin: 2% auto;
        width: 98%;
    }
    
    .wsp-form {
        padding: 15px;
    }
    
    .wsp-form-group input,
    .wsp-form-group textarea {
        padding: 12px 14px;
        font-size: 16px; /* Evita zoom en iOS */
    }
}

/* Animaciones adicionales */
.wsp-floating-button {
    animation: wspPulse 2s infinite;
}

@keyframes wspPulse {
    0% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4), 0 0 0 10px rgba(37, 211, 102, 0.1);
    }
    100% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }
}

/* Mensajes de error/éxito */
.wsp-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

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

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