.chatbot-flotante {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    transition: all 0.3s ease;
}

.robot-icono {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #2c5aa0, #1a3a6b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    animation: flotar 3s ease-in-out infinite;
    overflow: hidden;
    border: 3px solid white;
}

.robot-icono:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.robot-icono.activo {
    transform: scale(1.1);
    background: linear-gradient(135deg, #1a3a6b, #2c5aa0);
}

.robot-imagen {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.robot-icono.activo .robot-imagen {
    transform: scale(1.1);
}

.indicador-notificacion {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #ff4757;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: bold;
    animation: palpitar 2s infinite;
    border: 2px solid white;
}

.chat-container {
    position: absolute;
    bottom: 100px; /* Ajustado para subir el chat más arriba del robot */
    right: 0;
    width: 350px;
    height: 450px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.chat-container.activo {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.chat-header {
    background: linear-gradient(135deg, #2c5aa0, #1a3a6b);
    color: white;
    padding: 15px;
    border-radius: 15px 15px 0 0;
    text-align: center;
    position: relative;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
}

.chat-header small {
    font-size: 11px;
    opacity: 0.8;
}

.cerrar-chat {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.cerrar-chat:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f9f9f9;
}

.message {
    margin: 10px 0;
    padding: 10px;
    border-radius: 10px;
    max-width: 80%;
    word-wrap: break-word;
    animation: aparecer 0.3s ease;
}

.user-message {
    background: #e3f2fd;
    margin-left: auto;
    text-align: right;
}

.bot-message {
    background: white;
    border: 1px solid #ddd;
}

.chat-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid #ddd;
    background: white;
    gap: 8px;
    align-items: center;
}

.chat-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    transition: border 0.3s;
    min-width: 0;
}

.chat-input input:focus {
    border-color: #2c5aa0;
}

.chat-input button {
    padding: 10px 15px;
    background: #2c5aa0;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

.chat-input button:hover {
    background: #1a3a6b;
}

/* Animaciones */
@keyframes flotar {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes palpitar {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

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

/* Estilos para preguntas rápidas */
.quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.quick-question {
    background: #e3f2fd;
    border: 1px solid #2c5aa0;
    border-radius: 15px;
    padding: 5px 10px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-question:hover {
    background: #2c5aa0;
    color: white;
}

.typing-indicator {
    display: flex;
    align-items: center;
    padding: 10px;
    color: #666;
    font-style: italic;
}

.typing-dots {
    display: flex;
    margin-left: 5px;
}

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

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

.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(-5px);
    }
}

/* Selector de idioma con estilo profesional */
.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.idioma-selector {
    padding: 6px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    font-size: 12px;
    cursor: pointer;
    color: #333; /* Texto en negro */
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 30px;
}

.idioma-selector:hover {
    border-color: #2c5aa0;
    box-shadow: 0 2px 8px rgba(44, 90, 160, 0.15);
}

.idioma-selector:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.2);
}

.idioma-selector option {
    color: #333;
    background: white;
}

/* Responsive */
@media (max-width: 480px) {
    .chat-container {
        width: 300px;
        right: -20px;
        bottom: 90px; /* Ajustado para móviles también */
    }

    .robot-icono {
        width: 70px;
        height: 70px;
    }
    
    .chat-input {
        padding: 8px;
    }
    
    .chat-input input {
        padding: 8px;
    }
    
    .chat-input button {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .idioma-selector {
        font-size: 11px;
        padding: 5px 10px;
        padding-right: 28px;
    }
}

.chatbot-flotante {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
}

.chat-container {
    width: 350px;
    height: 500px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    position: absolute;
    bottom: 100px; /* Ajustado para subir el chat más arriba del robot */
    right: 0;
}

.chat-container.activo {
    display: flex;
}

.chat-header {
    background: #007bff;
    color: white;
    padding: 15px;
    border-radius: 10px 10px 0 0;
    position: relative;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f8f9fa;
}

.message {
    margin: 10px 0;
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
}

.bot-message {
    background: white;
    border: 1px solid #e0e0e0;
    margin-right: auto;
}

.user-message {
    background: #007bff;
    color: white;
    margin-left: auto;
}

.quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
}

.quick-question {
    background: #e9ecef;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid #dee2e6;
}

.quick-question:hover {
    background: #dee2e6;
}

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

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

.chat-input button {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
}

.robot-icono {
    width: 120px;
    height: 100px;
    background: #007bff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
}

.robot-imagen {
    width: 70%;
    height: 70%;
    border-radius: 50%;
}

.indicador-notificacion {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.typing-indicator {
    display: flex;
    align-items: center;
    color: #666;
    font-style: italic;
    margin: 10px 0;
}

.typing-dots {
    display: inline-flex;
    margin-left: 5px;
}

.typing-dot {
    width: 4px;
    height: 4px;
    background: #666;
    border-radius: 50%;
    margin: 0 1px;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

@keyframes typing {
    0%, 80%, 100% {
        opacity: 0.3;
    }
    40% {
        opacity: 1;
    }
}

/* Ocultar preguntas en quechua por defecto */
.quick-question.quechua {
    display: none;
}


.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    height: 120px;

    /* Imagen de hospital realista */
    background-image: url("https://images.unsplash.com/photo-1576765607924-bc2df2f35b59");
    background-size: cover;
    background-position: center;

    color: white;
    border-radius: 12px 12px 0 0;
    backdrop-filter: blur(3px);
}


.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    /* Header más grande */
    padding: 25px 30px;
    height: 120px;

    /* Imagen de hospital */
    background-image: url("https://images.unsplash.com/photo-1584432810601-6c7f27d2362b");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    border-radius: 15px 15px 0 0;
    color: white;
    font-family: 'Poppins', sans-serif;
    backdrop-filter: brightness(0.7);
}

.chat-header h2 {
    font-size: 28px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.header-controls .cerrar-chat {
    background: rgba(0,0,0,0.5);
    border: none;
    color: white;
    font-size: 26px;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s ease;
}

.header-controls .cerrar-chat:hover {
    background: rgba(0,0,0,0.7);
    transform: scale(1.05);
}

.icono-bot {
    width: 50px; /* Tamaño reducido del logo */
    height: 50px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

 /* Nube de diálogo profesional - CORREGIDA */
 .nube-dialogo {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 18px 20px;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0, 105, 92, 0.2);
    max-width: 260px;
    width: auto;
    min-width: 120px;
    font-size: 14px;
    line-height: 1.4;
    animation: aparecer 0.6s ease-out;
    z-index: 1001;
    border: 1px solid #e0f2f1;
    color: #004d40;
    display: none;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.nube-dialogo.visible {
    display: block;
}

.nube-dialogo:after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid white;
    filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.1));
}

.nube-dialogo:before {
    content: '';
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 13px solid transparent;
    border-right: 13px solid transparent;
    border-top: 13px solid #e0f2f1;
    z-index: -1;
}

.nube-titulo {
    font-weight: 700;
    color: #00695c;
    margin-bottom: 8px;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.nube-titulo i {
    margin-right: 8px;
    color: #00796b;
}

.nube-contenido {
    font-size: 13px;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@keyframes aparecer {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(15px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

.chatbot-activo .chat-container {
    display: flex;
}

.chatbot-activo .nube-dialogo {
    display: none !important;
}

.chatbot-activo .indicador-notificacion {
    display: none;
}

.footer {
    margin-top: 40px;
    text-align: center;
    color: #00695c;
    font-size: 0.9rem;
}

/* Media Queries para Responsive */
@media (max-width: 900px) {
    .chatbot-container {
        flex-direction: column;
    }
    
    .info-panel {
        order: 2;
    }
    
    .chatbot-flotante {
        order: 1;
        margin-bottom: 30px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header p {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .chat-container {
        height: 450px;
    }
    
    .nube-dialogo {
        max-width: 240px;
        padding: 15px;
        font-size: 13px;
        bottom: 90px;
    }
    
    .nube-titulo {
        font-size: 14px;
    }
    
    .nube-contenido {
        font-size: 12px;
    }
    
    .robot-icono {
        width: 70px;
        height: 70px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.6rem;
    }
    
    .info-panel {
        padding: 15px;
    }
    
    .info-panel h2 {
        font-size: 1.4rem;
    }
    
    .chat-container {
        height: 400px;
    }
    
    .chat-messages {
        padding: 15px;
    }
    
    .message {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .quick-question {
        padding: 8px 12px;
        font-size: 11px;
    }
    
    .nube-dialogo {
        max-width: 220px;
        padding: 12px 14px;
        font-size: 12px;
        bottom: 85px;
    }
    
    .nube-titulo {
        font-size: 13px;
    }
    
    .nube-contenido {
        font-size: 11px;
    }
    
    .robot-icono {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 360px) {
    .nube-dialogo {
        max-width: 200px;
        padding: 10px 12px;
        font-size: 11px;
        bottom: 80px;
    }
    
    .nube-titulo {
        font-size: 12px;
    }
    
    .nube-contenido {
        font-size: 10px;
    }
    
    .container {
        padding: 10px;
    }
}