/* ============================================
   WHATSAPP CHATBOT WIDGET
   ============================================ */

/* === BOTÓN FLOTANTE DE WHATSAPP === */
.whatsapp-float-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.5);
    cursor: pointer;
    z-index: 1050;
    transition: all 0.3s ease;
    animation: pulse-whatsapp 2s infinite;
}

.whatsapp-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.7);
}

.whatsapp-float-btn i {
    font-size: 2rem;
    color: white;
}

.whatsapp-float-btn .notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #FF3B30;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    animation: bounce 1s infinite;
}

@keyframes pulse-whatsapp {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.5);
    }
    50% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.8), 0 0 0 15px rgba(37, 211, 102, 0.1);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* === MODAL DEL CHAT === */
.whatsapp-chat-modal {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    max-height: 390px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1040;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

.whatsapp-chat-modal.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === HEADER DEL CHAT === */
.chat-header {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.chat-header-avatar {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #25D366;
}

.chat-header-info h3 {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.chat-header-info p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    margin: 3px 0 0 0;
}

.chat-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* === CUERPO DEL CHAT === */
.chat-body {
    flex: 1;
    padding: 12px 15px;
    overflow-y: auto;
    background: #ECE5DD;
    max-height: 280px;
}

.chat-message {
    margin-bottom: 8px;
    animation: messageSlide 0.3s ease-out;
}

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

.message-bot {
    display: flex;
    justify-content: flex-start;
}

.message-user {
    display: flex;
    justify-content: flex-end;
}

.message-bubble {
    max-width: 75%;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
}

.message-bot .message-bubble {
    background: white;
    border-bottom-left-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-user .message-bubble {
    background: #DCF8C6;
    border-bottom-right-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-time {
    font-size: 0.7rem;
    color: #999;
    margin-top: 5px;
    text-align: right;
}

/* === OPCIONES DE RESPUESTA === */
.chat-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.option-btn {
    background: white;
    border: 2px solid #25D366;
    color: #25D366;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.option-btn:hover {
    background: #25D366;
    color: white;
    transform: translateX(5px);
}

/* === INPUT DEL CHAT === */
.chat-input-area {
    padding: 15px;
    background: #F0F0F0;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 25px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.chat-input:focus {
    border-color: #25D366;
}

.chat-send-btn {
    width: 45px;
    height: 45px;
    background: #25D366;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-send-btn:hover {
    background: #128C7E;
    transform: scale(1.1);
}

.chat-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* === TYPING INDICATOR === */
.typing-indicator {
    display: none;
    padding: 10px 15px;
    background: white;
    border-radius: 8px;
    width: fit-content;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.typing-indicator.active {
    display: block;
}

.typing-dots {
    display: flex;
    gap: 5px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .whatsapp-chat-modal {
        width: calc(100% - 20px);
        right: 10px;
        bottom: 100px;
    }

    .whatsapp-float-btn {
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .whatsapp-chat-modal {
        max-height: 500px;
    }

    .chat-body {
        max-height: 300px;
    }
}
