/* ===================================
   WhatsApp Chat con IA - Estilos
   =================================== */

/* Contenedor principal */
#wa-wrap {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Botón flotante */
#wa-fab {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
}

#wa-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

#wa-wrap.open #wa-fab {
    display: none;
}

/* Panel del chat */
#wa-panel {
    display: none;
    flex-direction: column;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

#wa-wrap.open #wa-panel {
    display: flex;
}

/* Header del chat */
#wa-header {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

#wa-header svg {
    flex-shrink: 0;
}

#wa-header span {
    flex: 1;
}

#wa-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#wa-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Área de mensajes */
#wa-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #ECE5DD;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Mensajes */
.msg {
    display: flex;
    animation: slideIn 0.3s ease;
}

.msg.user {
    justify-content: flex-end;
}

.msg.bot {
    justify-content: flex-start;
}

.bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 8px;
    word-wrap: break-word;
    line-height: 1.4;
}

.msg.user .bubble {
    background: #DCF8C6;
    color: #000;
    border-bottom-right-radius: 2px;
}

.msg.bot .bubble {
    background: white;
    color: #000;
    border-bottom-left-radius: 2px;
}

/* Indicador de escritura */
#wa-typing {
    display: flex;
    justify-content: flex-start;
}

#wa-typing .bubble {
    background: white;
    padding: 12px 16px;
    display: flex;
    gap: 4px;
}

#wa-typing .bubble span {
    width: 8px;
    height: 8px;
    background: #90949c;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

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

/* Botón de acción */
.action {
    background: white;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    animation: slideIn 0.3s ease;
}

.action strong {
    display: block;
    color: #25D366;
    font-size: 16px;
    margin-bottom: 8px;
}

.action p {
    margin: 8px 0;
    color: #666;
}

.action a {
    display: inline-block;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 12px;
    transition: transform 0.2s;
}

.action a:hover {
    transform: scale(1.05);
}

/* Área de input */
#wa-input-area {
    display: flex;
    padding: 12px;
    background: #F0F0F0;
    gap: 8px;
}

#wa-text {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: 24px;
    outline: none;
    font-size: 14px;
    background: white;
}

#wa-text:disabled {
    background: #E0E0E0;
    cursor: not-allowed;
}

#wa-send {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#wa-send:hover:not(:disabled) {
    transform: scale(1.1);
}

#wa-send:disabled {
    background: #CCC;
    cursor: not-allowed;
}

/* Animaciones */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 480px) {
    #wa-panel {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
    }
    
    #wa-wrap {
        bottom: 10px;
        right: 10px;
    }
}

/* Scrollbar personalizada */
#wa-messages::-webkit-scrollbar {
    width: 6px;
}

#wa-messages::-webkit-scrollbar-track {
    background: transparent;
}

#wa-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

#wa-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

