/* ============================================================
   CENTROBOT - Rediseño visual con glassmorphism
   Paleta: tonos claros, azul suave (#e6f0ff), turquesa (#40E0D0)
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

#centrobot-widget {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 1000;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

/* ----- Botón flotante (EFECTO WHASAPP) ----- */
#centrobot-toggle {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #0033cc;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 51, 204, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid rgba(0, 51, 204, 0.1);
}

#centrobot-toggle i {
    font-size: 30px;
}

#centrobot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 25px rgba(0, 191, 255, 0.5);
}

/* ----- Globo de bienvenida ----- */
.centrobot-bubble {
    position: absolute;
    bottom: 75px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    color: #1E2A3A;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid rgba(0, 51, 204, 0.15);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: opacity 0.3s ease;
    pointer-events: none;
    font-family: 'Inter', sans-serif;
}

.centrobot-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(255, 255, 255, 0.9);
}

/* ----- Ventana del chat (glassmorphism) CON TRAZO SUTIL ----- */
#centrobot-chat {
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 380px;
    max-width: 85vw;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    overflow: hidden;
    display: none;
    flex-direction: column;
    border: 1px solid rgba(0, 51, 204, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
    animation: chatOpen 0.25s ease forwards;
}

@keyframes chatOpen {
    0% { opacity: 0; transform: scale(0.85); }
    100% { opacity: 1; transform: scale(1); }
}

/* ===== ELIMINADO EL FONDO CUADRICULADO ===== */
/* Ya no existe #centrobot-chat::before */

/* ----- Encabezado (avatar) ----- */
.centrobot-header {
    background: linear-gradient(135deg, #f0f7ff, #e6f0ff);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(0, 51, 204, 0.05);
    position: relative;
    z-index: 1;
}

.centrobot-header .header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0033cc;
    font-size: 24px;
    box-shadow: 0 2px 10px rgba(0, 51, 204, 0.1);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.centrobot-header .header-avatar.typing {
    animation: avatarTyping 0.8s ease-in-out infinite alternate;
}

@keyframes avatarTyping {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.05) rotate(-5deg); }
}

.centrobot-header .header-text {
    flex: 1;
}

.centrobot-header .header-title {
    font-weight: 700;
    font-size: 1rem;
    color: #1E2A3A;
}

.centrobot-header .header-subtitle {
    font-size: 0.7rem;
    color: #5A6C7E;
    display: flex;
    align-items: center;
    gap: 4px;
}

.centrobot-header .header-subtitle .status-dot {
    width: 6px;
    height: 6px;
    background: #2ECC71;
    border-radius: 50%;
    display: inline-block;
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* ----- Área de mensajes ----- */
.centrobot-messages {
    height: 350px;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 1;
    scroll-behavior: smooth;
}

.centrobot-messages::-webkit-scrollbar {
    width: 4px;
}

.centrobot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.centrobot-messages::-webkit-scrollbar-thumb {
    background: #0033cc;
    border-radius: 10px;
}

/* ----- Burbuja del bot (clara) CON MÁS SOMBRA ----- */
.centrobot-message-bot {
    align-self: flex-start;
    background: #ffffff;
    color: #1E2A3A;
    padding: 10px 14px;
    border-radius: 16px 16px 16px 4px;
    max-width: 85%;
    font-size: 0.9rem;
    line-height: 1.5;
    border-left: 3px solid #40E0D0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    word-wrap: break-word;
    position: relative;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.centrobot-message-bot a {
    color: #0033cc;
    text-decoration: underline;
}

/* ----- Burbuja del usuario (clara) CON MÁS SOMBRA ----- */
.centrobot-message-user {
    align-self: flex-end;
    background: #e6f0ff;
    color: #1E2A3A;
    padding: 10px 14px;
    border-radius: 16px 16px 4px 16px;
    max-width: 85%;
    font-size: 0.9rem;
    line-height: 1.5;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    word-wrap: break-word;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* ----- Indicador de escritura (claro) ----- */
.centrobot-loading {
    align-self: flex-start;
    background: #f0f7ff;
    color: #5A6C7E;
    padding: 8px 14px;
    border-radius: 16px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 6px;
    border-left: 2px solid #40E0D0;
}

.centrobot-loading .dots {
    display: flex;
    gap: 4px;
}

.centrobot-loading .dots span {
    width: 6px;
    height: 6px;
    background: #0033cc;
    border-radius: 50%;
    animation: dotJump 1.2s ease-in-out infinite;
}

.centrobot-loading .dots span:nth-child(2) { animation-delay: 0.2s; }
.centrobot-loading .dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotJump {
    0% { transform: translateY(0); opacity: 0.3; }
    50% { transform: translateY(-6px); opacity: 1; }
    100% { transform: translateY(0); opacity: 0.3; }
}

/* ----- Botones rápidos (claro) ----- */
.centrobot-quick-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 51, 204, 0.05);
}

.centrobot-quick-btn {
    background: #f0f7ff;
    border: 1px solid rgba(0, 51, 204, 0.1);
    color: #0033cc;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.centrobot-quick-btn:hover {
    background: #0033cc;
    color: white;
    border-color: #0033cc;
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(0, 51, 204, 0.2);
}

/* ----- Entrada de texto (clara) ----- */
.centrobot-input {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid rgba(0, 51, 204, 0.05);
    position: relative;
    z-index: 1;
}

.centrobot-input input {
    flex: 1;
    background: #f8faff;
    border: 1px solid rgba(0, 51, 204, 0.1);
    border-radius: 30px;
    padding: 10px 16px;
    color: #1E2A3A;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.centrobot-input input::placeholder {
    color: rgba(30, 42, 58, 0.4);
}

.centrobot-input input:focus {
    border-color: #0033cc;
    box-shadow: 0 0 15px rgba(0, 51, 204, 0.1);
}

/* ===== IDENTIFICADOR ÚNICO PARA EL BOTÓN DE ENVIAR ===== */
#centrobot-send-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #0033cc;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#centrobot-send-btn:hover {
    background: #1E90FF;
    box-shadow: 0 0 20px rgba(0, 51, 204, 0.2);
    transform: scale(1.05);
}

#centrobot-send-btn:active {
    transform: scale(0.95);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    #centrobot-widget {
        bottom: 20px;
        left: 20px;
    }
    #centrobot-chat {
        width: 300px;
        bottom: 70px;
    }
    #centrobot-toggle {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }
    .centrobot-bubble {
        font-size: 0.7rem;
        padding: 6px 12px;
        bottom: 65px;
    }
    .centrobot-messages {
        height: 280px;
    }
    .centrobot-input {
        padding: 8px 12px;
    }
    .centrobot-input input {
        font-size: 0.8rem;
        padding: 8px 12px;
    }
    #centrobot-send-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    #centrobot-chat {
        width: 280px;
    }
    .centrobot-messages {
        height: 250px;
    }
}