@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(182, 44, 56, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(182, 44, 56, 0.6);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(182, 44, 56, 0.4);
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

@keyframes tooltipFadeIn {
    0% {
        opacity: 0;
        transform: translateX(10px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes tooltipBounce {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(-5px);
    }
}

.chat-button-animate {
    animation: pulse 2s infinite, bounce 3s infinite;
}

.tooltip-animate {
    animation: tooltipFadeIn 0.5s ease-out, tooltipBounce 2s infinite 1s;
}


/* Chat Bot Modal */
.chat-bot-container {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 1000 !important;
    font-family: Arial, sans-serif;
    display: block !important;
}

.chat-bot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    transition: all 0.3s ease;
    color: white !important;
    font-size: 24px;
    position: fixed !important;
}

.chat-bot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.chat-bot-toggle.open {
    background: #e74c3c;
}

.chat-bot-modal {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

.chat-bot-modal.show {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-bot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    font-weight: bold;
}

.bot-info h3 {
    margin: 0;
    font-size: 16px;
}

.bot-info p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.chat-bot-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.chat-message {
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease-in;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-bot {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.message-user {
    display: flex;
    justify-content: flex-end;
}

.message-content {
    max-width: 80%;
    padding: 12px 15px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
}

.message-bot .message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.message-user .message-content {
    background: #667eea;
    color: white;
    border-bottom-right-radius: 5px;
}

.chat-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.chat-option {
    background: white;
    border: 2px solid #B62C38;
    color: #B62C38;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    text-align: center;
    font-size: 13px;
    transition: all 0.2s ease;
}

.chat-option:hover {
    background: #B62C38;
    color: white;
}

.chat-bot-input {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    background: white;
}

.chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    outline: none;
}

.chat-input:focus {
    border-color: #667eea;
}

.send-btn {
    background: #667eea;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.send-btn:hover {
    background: #5a6fd8;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #999;
    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);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .chat-bot-modal {
        width: 300px;
        height: 450px;
    }

    .chat-bot-container {
        bottom: 15px;
        right: 15px;
    }
}
/* Contenedor del chat - Asegurar alineación correcta */
#chatBody {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0 !important;
}

/* Added for chatbot.js compatibility */
.options-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.option-btn {
    background: white;
    border: 1px solid #B62C38;
    color: #B62C38;
    padding: 8px 12px;
    border-radius: 15px;
    cursor: pointer;
    width: 80%;
    transition: all 0.2s ease;
    margin-bottom: 5px;
}

.option-btn:hover {
    background: #B62C38;
    color: white;
}

/* Mensajes del usuario/paciente - Siempre rojo */
.user-message {
    align-self: flex-end !important;
    background: #B62C38 !important;
    color: white !important;
    padding: 10px 15px !important;
    border-radius: 15px !important;
    border-bottom-right-radius: 2px !important;
    margin-bottom: 10px !important;
    max-width: 80% !important;
    word-wrap: break-word !important;
    box-shadow: 0 2px 5px rgba(182, 44, 56, 0.3) !important;
}

.user-message * {
    color: white !important;
}

/* Mensajes del bot/chat - Siempre blanco con texto oscuro */
.bot-message {
    align-self: flex-start !important;
    background: white !important;
    color: #333 !important;
    padding: 10px 15px !important;
    border-radius: 15px !important;
    border-bottom-left-radius: 2px !important;
    margin-bottom: 10px !important;
    max-width: 80% !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    word-wrap: break-word !important;
}

.bot-message * {
    color: #333 !important;
}

.bot-message i {
    color: #B62C38 !important;
}

/* Mensajes de admin - Fondo blanco con texto negro y borde de color */
.admin-message {
    align-self: flex-start !important;
    background: white !important;
    color: #333 !important;
    border-radius: 15px !important;
    border-bottom-left-radius: 2px !important;
    margin-bottom: 10px !important;
    max-width: 80% !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    word-wrap: break-word !important;
    border-left: 4px solid #B62C38 !important;
    border-top: 1px solid rgba(182, 44, 56, 0.2) !important;
    border-right: 1px solid rgba(182, 44, 56, 0.2) !important;
    border-bottom: 1px solid rgba(182, 44, 56, 0.2) !important;
}

.admin-message * {
    color: #333 !important;
}

.admin-header {
    background: #f5f5f5 !important;
    padding: 8px 15px !important;
    border-bottom: 1px solid rgba(182, 44, 56, 0.2) !important;
    border-top-left-radius: 11px !important;
    border-top-right-radius: 11px !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    color: #333 !important;
}

.admin-header i {
    color: #B62C38 !important;
}

.admin-content {
    padding: 10px 15px !important;
    font-weight: 400 !important;
    color: #333 !important;
}

.bot-message.highlighted {
    background: linear-gradient(135deg, #B62C38 0%, #8B1F2B 100%) !important;
    color: white !important;
    font-weight: 600 !important;
    border: 2px solid #7A1E25 !important;
    box-shadow: 0 4px 12px rgba(182, 44, 56, 0.4) !important;
    padding: 15px 18px !important;
    font-size: 15px !important;
    animation: pulseHighlight 2s ease-in-out infinite !important;
}

.bot-message.highlighted * {
    color: white !important;
}

@keyframes pulseHighlight {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(182, 44, 56, 0.4);
    }
    50% {
        box-shadow: 0 6px 18px rgba(182, 44, 56, 0.6);
    }
}
