/* Bot 3D Animado - Estilos y Animaciones */
#bot3d-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    width: 90px;
    height: 135px;
    pointer-events: all;
    transition: transform 0.3s ease, opacity 0.3s ease, display 0.3s ease;
    user-select: none;
    display: none; /* Oculto inicialmente */
    opacity: 0;
}

#bot3d-container.active {
    pointer-events: all;
    display: block;
    opacity: 1;
}

#bot3d-container.minimized {
    width: 50px;
    height: 50px;
    opacity: 0.7;
}

#bot3d-container.minimized:hover {
    opacity: 1;
}

/* Botón minimizar */
.bot-minimize-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 10003;
    transition: all 0.2s ease;
}

.bot-minimize-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.bot3d-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    cursor: grab;
    transition: transform 0.2s ease, filter 0.2s ease;
    animation: bot-pulse 3s ease-in-out infinite;
}

@keyframes bot-pulse {
    0%, 100% {
        filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3)) drop-shadow(0 0 10px rgba(102, 126, 234, 0.3));
    }
    50% {
        filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3)) drop-shadow(0 0 20px rgba(102, 126, 234, 0.6));
    }
}

.bot3d-svg:hover {
    transform: scale(1.08);
    filter: drop-shadow(0 6px 12px rgba(102, 126, 234, 0.7)) drop-shadow(0 0 25px rgba(102, 126, 234, 0.8));
    cursor: grab;
}

.bot3d-svg:active {
    cursor: grabbing;
}

/* Animaciones del Bot */
@keyframes bot-walk {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-5px) rotate(-2deg);
    }
    50% {
        transform: translateY(-8px) rotate(0deg);
    }
    75% {
        transform: translateY(-5px) rotate(2deg);
    }
}

@keyframes bot-idle {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

@keyframes bot-talk {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes bot-point {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-10deg);
    }
    50% {
        transform: rotate(0deg);
    }
    75% {
        transform: rotate(10deg);
    }
}

@keyframes leg-walk-left {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(15deg);
    }
}

@keyframes leg-walk-right {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(-15deg);
    }
}

@keyframes arm-swing-left {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(20deg);
    }
}

@keyframes arm-swing-right {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(-20deg);
    }
}

@keyframes head-nod {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(5deg);
    }
}

/* Estados del Bot */
.bot3d-svg.walking {
    animation: bot-walk 0.6s ease-in-out infinite;
}

.bot3d-svg.walking .leg-left {
    animation: leg-walk-left 0.6s ease-in-out infinite;
    transform-origin: top center;
}

.bot3d-svg.walking .leg-right {
    animation: leg-walk-right 0.6s ease-in-out infinite;
    transform-origin: top center;
}

.bot3d-svg.walking .arm-left {
    animation: arm-swing-left 0.6s ease-in-out infinite;
    transform-origin: top center;
}

.bot3d-svg.walking .arm-right {
    animation: arm-swing-right 0.6s ease-in-out infinite;
    transform-origin: top center;
}

.bot3d-svg.idle {
    animation: bot-idle 2s ease-in-out infinite;
}

.bot3d-svg.talking {
    animation: bot-talk 0.5s ease-in-out infinite;
}

.bot3d-svg.talking .head {
    animation: head-nod 0.5s ease-in-out infinite;
    transform-origin: center bottom;
}

.bot3d-svg.pointing {
    animation: bot-point 1s ease-in-out infinite;
}

.bot3d-svg.pointing .arm-right {
    animation: arm-point 1s ease-in-out infinite;
    transform-origin: top center;
}

@keyframes arm-point {
    0%, 100% {
        transform: rotate(-45deg);
    }
    50% {
        transform: rotate(-60deg);
    }
}

/* Globito de Comentario */
.bot-speech-bubble {
    position: absolute;
    bottom: 200px;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3), 0 0 30px rgba(102, 126, 234, 0.4);
    max-width: 300px;
    min-width: 200px;
    font-size: 14px;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    transition: all 0.3s ease;
    pointer-events: all;
    z-index: 10001;
    animation: bubble-glow 2s ease-in-out infinite;
}

@keyframes bubble-glow {
    0%, 100% {
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3), 0 0 30px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3), 0 0 40px rgba(102, 126, 234, 0.6);
    }
}

.bot-speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 30px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #667eea;
}

.bot-speech-bubble.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.bot-speech-bubble .bubble-close {
    position: absolute;
    top: 5px;
    right: 10px;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    transition: background 0.2s;
}

.bot-speech-bubble .bubble-close:hover {
    background: rgba(255, 255, 255, 0.5);
}

.bot-speech-bubble .bubble-link {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: bold;
    transition: background 0.2s;
}

.bot-speech-bubble .bubble-link:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Botón de interacción */
.bot-interact-btn {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    pointer-events: all;
    z-index: 10002;
}

.bot-interact-btn:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.bot-interact-btn:active {
    transform: translateX(-50%) translateY(0);
}

/* Indicador de guía */
.bot-guide-indicator {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid #667eea;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.2);
    animation: pulse-guide 1.5s ease-in-out infinite;
    pointer-events: none;
    z-index: 9999;
}

.bot-guide-indicator.enhanced {
    width: 50px;
    height: 50px;
    border: 3px solid white;
    background: rgba(102, 126, 234, 0.9);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.8);
    animation: pulse-guide-enhanced 1s ease-in-out infinite;
}

@keyframes pulse-guide {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

@keyframes pulse-guide-enhanced {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.9;
    }
}

/* Hint de clic */
.bot-click-hint {
    animation: bounce-hint 1s ease-in-out infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    #bot3d-container {
        width: 70px;
        height: 105px;
        bottom: 10px;
        right: 10px;
    }
    
    .bot-speech-bubble {
        max-width: 250px;
        font-size: 12px;
        bottom: 120px;
    }
    
    #bot3d-container.minimized {
        width: 45px;
        height: 45px;
    }
}

