/* ============================================================
   CHATBOT FLOTANTE - ESTILOS
   ============================================================ */

/* Botón flotante del chatbot */
.chatbot-toggle {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #003D7B, #002952);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,61,123,0.3);
    transition: all 0.3s ease;
    z-index: 999;
    border: none;
    color: white;
    font-size: 28px;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0,61,123,0.4);
}

/* Ventana del chat */
.chatbot-window {
    position: fixed;
    bottom: 170px;
    right: 20px;
    width: 380px;
    max-height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    border: 1px solid #e0e0e0;
}

.chatbot-window.active {
    display: flex;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cabecera del chat */
.chatbot-header {
    background: linear-gradient(135deg, #003D7B, #002952);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-header-info .avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.chatbot-header-info .info h4 {
    font-size: 0.95rem;
    margin: 0;
    font-weight: 600;
}

.chatbot-header-info .info p {
    font-size: 0.7rem;
    margin: 0;
    opacity: 0.8;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.chatbot-close:hover {
    opacity: 1;
}

/* Cuerpo del chat - mensajes */
.chatbot-body {
    flex: 1;
    padding: 15px 20px;
    overflow-y: auto;
    max-height: 350px;
    background: #f8f9fa;
}

.chatbot-body::-webkit-scrollbar {
    width: 4px;
}

.chatbot-body::-webkit-scrollbar-thumb {
    background: #003D7B;
    border-radius: 10px;
}

/* Mensajes */
.message {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.message.bot .avatar {
    background: #003D7B;
    color: white;
}

.message.user .avatar {
    background: #e9ecef;
    color: #555;
}

.message .bubble {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.bot .bubble {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.message.user .bubble {
    background: #003D7B;
    color: white;
    border-bottom-right-radius: 4px;
    margin-left: auto;
}

.message .bubble .quick-reply {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 14px;
    background: rgba(0,61,123,0.1);
    color: #003D7B;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
    border: 1px solid rgba(0,61,123,0.2);
}

.message .bubble .quick-reply:hover {
    background: #003D7B;
    color: white;
}

/* Indicador de escritura */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 15px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #bbb;
    border-radius: 50%;
    animation: typing 1.4s infinite both;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Footer del chat - input */
.chatbot-footer {
    padding: 10px 15px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    background: white;
    flex-shrink: 0;
}

.chatbot-footer input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.3s;
}

.chatbot-footer input:focus {
    border-color: #003D7B;
}

.chatbot-footer button {
    padding: 10px 18px;
    background: #003D7B;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.3s;
}

.chatbot-footer button:hover {
    background: #002952;
}

/* Responsive */
@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 40px);
        right: 20px;
        bottom: 150px;
        max-height: 450px;
    }
    
    .chatbot-toggle {
        width: 50px;
        height: 50px;
        font-size: 22px;
        bottom: 90px;
        right: 15px;
    }
}