﻿#chat-avatar {
    position: fixed;
    bottom: 110px;
    right: 20px;
    cursor: pointer;
    z-index: 1000;
    display: none; /* oculto al inicio */
    opacity: 0;
    transition: opacity 1s ease-in;
}
    #chat-avatar.show {
        display: block;
        opacity: 1;
    }

    #chat-avatar img {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        box-shadow: 0 0 10px rgba(0,0,0,0.3);
    }

#chat-box {
    position: fixed;
    bottom: 160px;
    right: 20px;
    width: 300px;
    height: 400px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    display: none; /* oculto al inicio */
    flex-direction: column;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: translateY(20px); /* empieza un poco abajo */
}

    #chat-box.show {
        display: flex;
        opacity: 1;
        transform: translateY(0); /* sube suavemente */
    }


#chat-header {
    background: #E5812E;
    color: #fff;
    padding: 10px;
    font-weight: bold;
    border-radius: 8px 8px 0 0;
}

#chat-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    font-size: 14px;
}

#chat-input-area {
    display: flex;
    border-top: 1px solid #ccc;
}

#chat-input {
    flex: 1;
    border: none;
    padding: 10px;
}

    #chat-input:focus {
        outline: none;
    }

#chat-input-area button {
    background: #E5812E;
    color: #fff;
    border: none;
    padding: 10px;
    cursor: pointer;
}

.animated-avatar {
    width: 120px;
    height: auto;
    opacity: 0; /* oculto al inicio */
    animation: fadeIn 2s ease forwards, float 3s ease-in-out infinite, wave 6s ease-in-out infinite, blink 4s linear infinite, shadowPulse 5s ease-in-out infinite;
    transform-origin: center bottom;
}

/* Fade-in inicial */
@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Movimiento de “flotar” */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Movimiento de “saludo” (rotación ligera) */
@keyframes wave {
    0%, 100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(5deg);
    }

    50% {
        transform: rotate(-5deg);
    }

    75% {
        transform: rotate(3deg);
    }
}

/* Simulación de parpadeo */
@keyframes blink {
    0%, 90%, 100% {
        filter: brightness(1);
    }

    95% {
        filter: brightness(0.7);
    }
}

/* Sombra dinámica para efecto 3D */
@keyframes shadowPulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0,0,0,0.3);
    }

    50% {
        box-shadow: 0 0 25px rgba(0,0,0,0.6);
    }
}
