/* Chatbot Container Styles */
.chatbot-container {
    position: fixed;
    bottom: 100px;
    left: 30px;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    z-index: 999;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.chatbot-container.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Chatbot Header */
.chatbot-header {
    background: var(--bg-tesoro-amarillo);
    color: white;
    padding: 15px 20px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-avatar-small {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-icon-small {
    width: 35px;
    height: 35px;
}

.btn-minimize {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-minimize:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chatbot Messages */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.message {
    display: flex;
    gap: 10px;
    animation: messageSlide 0.3s ease-out;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.bot {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tesoro-rojo-claro);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message-avatar svg {
    width: 20px;
    height: 20px;
}

.message.user .message-avatar {
    background: var(--bg-tesoro-amarillo);
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 14px;
}

.message.bot .message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
}

.message.user .message-content {
    background: var(--bg-tesoro-rojo-claro);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-10px);
    }
}

/* Chatbot Input */
.chatbot-input {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.chatbot-input input {
    flex: 1;
    border: 1px solid #dee2e6;
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 14px;
}

.chatbot-input input:focus {
    outline: none;
    border-color: var(--bg-tesoro-amarillo);
    box-shadow: 0 0 0 3px var(--bg-tesoro-amarillo-claro);
}

.btn-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tesoro-amarillo);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    top: 10%;
}

.btn-send:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 119, 190, 0.4);
}

.btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Quick Options */
.chatbot-options {
    padding: 10px 20px 15px;
    background: white;
    border-radius: 0 0 20px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.chatbot-options.show {
    max-height: 200px;
}

.option-btn {
    padding: 8px 16px;
    border: 1px solid var(--bg-tesoro-amarillo);
    background: white;
    color: var(--bg-tesoro-amarillo);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.option-btn:hover {
    background: var(--bg-tesoro-rojo-claro);
    color: white;
    transform: translateY(-2px);
}

/* Floating Button */
.floating-btn {
    position: fixed;
    bottom: 20px;
    left: 30px;
    width: 70px;
    height: 70px;
    background: #fdad03;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--bg-tesoro-amarillo-claro);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 1000;
    animation: float 3s ease-in-out infinite;
}

.floating-btn:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 6px 20px var(--bg-tesoro-rojo-claro);
}

.floating-btn:active {
    transform: scale(0.95);
}

.avatar-icon {
    width: 50px;
    height: 50px;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Wave Animation */
.wave {
    animation: wave-motion 2s ease-in-out infinite;
}

.wave1 {
    animation-delay: 0s;
}

.wave2 {
    animation-delay: 0.3s;
}

@keyframes wave-motion {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

/* Pulse Ring */
.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid var(--bg-tesoro-amarillo-claro);
    border-radius: 50%;
    animation: pulse 2s ease-out infinite;
    opacity: 0;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Float Animation */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .chatbot-container {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
        height: 500px;
    }

    .floating-btn {
        width: 60px;
        height: 60px;
    }

    .avatar-icon {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .chatbot-container {
        width: calc(100% - 20px);
        right: 10px;
        left: 10px;
        bottom: 90px;
        height: 450px;
    }

    .floating-btn {
        width: 55px;
        height: 55px;
        bottom: 15px;
        right: 15px;
    }

    .avatar-icon {
        width: 35px;
        height: 35px;
    }

    .message-content {
        max-width: 80%;
        font-size: 13px;
    }
}