/* CONTENEDOR GENERAL */
#canitec-chat {
    width: 340px;
    height: 520px;
    background: #f9fafb;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: fixed;
    bottom: 80px;
    right: 24px;
    z-index: 9998;
}

/* HEADER */
#chat-header {
    background: #ffffff;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    font-size: 14px;
}

/* BODY */
#chat-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* MENSAJE BOT */
.bot-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
}

.bot-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
    font-size: 14px;
}

.bot-message {
    background: #ffffff;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    max-width: 80%;
    /* animation: fadeInUp 0.3s ease; */
}

/* OPCIONES */
.chat-option {
    background: #ffffff;
    padding: 12px;
    border-radius: 12px;
    margin-top: 8px;
    cursor: pointer;
    font-size: 13px;
    border: 1px solid #eee;
    transition: all 0.2s ease;
    font-weight: 500; /* 👈 normaliza peso */
    text-decoration: none; /* 👈 quita subrayado de <a> */
    color: inherit; /* 👈 usa el mismo color que el resto */
    display: block; /* 👈 hace que <a> se comporte como botón */
}

.chat-option:hover {
    background: #2563eb;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.3);
}

/* INPUTS */
.chat-input {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 13px;
    outline: none;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.chat-input:focus {
    border: 1px solid #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* BOTON FINAL */
#enviarLead {
    background: #2563eb;
    color: #fff;
    text-align: center;
    font-weight: 600;
}

#enviarLead:hover {
    background: #1d4ed8;
}

/* TYPING */
.typing span {
    height: 6px;
    width: 6px;
    background: #999;
    border-radius: 50%;
    display: inline-block;
    margin-right: 3px;
    animation: blink 1.4s infinite;
}

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

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

/* ANIMACION MENSAJES */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* CONTENEDOR INTERNO PARA ANIMACIONES */
.chat-screen {
    width: 100%;
    height: 100%;
}

/* ANIMACIONES */
.slide-out {
    animation: slideOut 0.25s ease forwards;
}

.slide-in {
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* BOTÓN FLOTANTE */
#canitec-chat-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #2563eb;
    color: #fff;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    z-index: 9999;
    transition: all 0.25s ease;
}

#canitec-chat-button:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.2);
}

/* PROGRESS */
.chat-progress {
    margin-bottom: 12px;
}

.chat-progress-text {
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
}

.chat-progress-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.chat-progress-fill {
    height: 100%;
    background: #2563eb;
    width: 0%;
    transition: width 0.3s ease;
}

/* REGRESAR */

.chat-option.back {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 12px;
    padding: 6px;
    box-shadow: none;
}

.chat-option.back:hover {
    color: #2563eb;
    background: transparent;
}