/* Chatbot Widget Styles */
#ivss-chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}

.ivss-chatbot-toggle-btn {
    width: 90px;
    height: 90px;
    border-radius: 0;
    background: transparent;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0;
    outline: none;
    box-shadow: none;
    animation: bot-heartbeat 2.5s infinite ease-in-out;
}

@keyframes bot-heartbeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.ivss-chatbot-toggle-btn:hover {
    transform: scale(1.1);
    animation: none;
}

.ivss-chatbot-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.1);
    transform-origin: bottom right;
    animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ivss-chatbot-container.d-none {
    display: none !important;
}

@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.ivss-chatbot-header {
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.ivss-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
}

/* Custom Scrollbar for messages */
.ivss-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}
.ivss-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}
.ivss-chatbot-messages::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 10px;
}

.ivss-chatbot-msg {
    max-width: 90%;
    animation: fadeIn 0.3s ease;
}

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

.bot-msg {
    align-self: flex-start;
}

.bot-msg .ivss-chatbot-bubble {
    background: white;
    color: #333;
    border: 1px solid rgba(0,0,0,0.05);
    border-bottom-left-radius: 4px !important;
}

.user-msg {
    align-self: flex-end;
}

.user-msg .ivss-chatbot-bubble {
    background: #dc3545;
    color: white;
    border-bottom-right-radius: 4px !important;
}

.ivss-btn-option {
    font-size: 0.85rem;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.ivss-btn-option:hover {
    background-color: #dc3545;
    color: white !important;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 20px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    border: 1px solid rgba(0,0,0,0.05);
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #dc3545;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

/* Prevenir apilamiento oscuro cuando se abren múltiples modales de Bootstrap */
.modal-backdrop.show ~ .modal-backdrop.show {
    opacity: 0 !important;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}
