/* ============================================================
   ASISTENTE VIRTUAL HREGB — ESTILOS PREMIUM
   ============================================================ */

/* Variables del chat */
:root {
    --chat-brand: #004481;
    --chat-brand-light: #0a5ca6;
    --chat-brand-gradient: linear-gradient(135deg, #004481 0%, #0c599b 100%);
    --chat-bg: rgba(255, 255, 255, 0.95);
    --chat-text: #1e293b;
    --chat-muted: #64748b;
    --chat-border: rgba(15, 23, 42, 0.08);
    --chat-shadow: 0 10px 30px -5px rgba(0, 68, 129, 0.25), 0 4px 12px -2px rgba(0, 0, 0, 0.05);
    --chat-radius: 18px;
    --chat-radius-sm: 10px;
    --chat-font: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Contenedor del Asistente Flotante */
.hregb-bot-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 99999;
    font-family: var(--chat-font);
}

/* Botón disparador (FAB) */
.hregb-bot-fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--chat-brand-gradient);
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: var(--chat-shadow);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.hregb-bot-fab:hover {
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 12px 36px -4px rgba(0, 68, 129, 0.4);
}
.hregb-bot-fab .material-icons-round {
    font-size: 28px;
    transition: transform 0.4s ease;
}
.hregb-bot-fab.active .material-icons-round {
    transform: rotate(90deg);
}

/* Indicador de notificación (Pulso) */
.hregb-bot-pulse {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: #ef4444;
    border: 2.5px solid #ffffff;
    border-radius: 50%;
    animation: botPulse 1.8s infinite;
}

/* Ventana de Chat */
.hregb-bot-card {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 360px;
    height: 520px;
    max-height: calc(100vh - 120px);
    background: var(--chat-bg);
    border: 1px solid var(--chat-border);
    border-radius: var(--chat-radius);
    box-shadow: var(--chat-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.hregb-bot-card.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Cabecera del Chat */
.hregb-bot-header {
    background: var(--chat-brand-gradient);
    padding: 16px 20px;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.hregb-bot-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.hregb-bot-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
}
.hregb-bot-title-text h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1.2;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.hregb-bot-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9) !important;
    margin-top: 3px;
}
.hregb-bot-status span {
    color: rgba(255, 255, 255, 0.9) !important;
}
.hregb-bot-status-dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
}
.hregb-bot-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}
.hregb-bot-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Cuerpo de Mensajes */
.hregb-bot-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
    background: radial-gradient(circle at top right, rgba(0, 68, 129, 0.02), transparent 70%);
}

/* Formato de mensajes individuales */
.hregb-bot-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: var(--chat-radius-sm);
    font-size: 13.2px;
    line-height: 1.5;
    animation: botMessageIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Mensajes del Bot */
.hregb-bot-msg-bot {
    background: #f1f5f9;
    color: var(--chat-text);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.015);
}

/* Mensajes del Usuario */
.hregb-bot-msg-user {
    background: var(--chat-brand);
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
    box-shadow: 0 4px 10px rgba(0, 68, 129, 0.15);
}

/* Menú de Botones de Opciones */
.hregb-bot-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 5px;
    width: 100%;
}
.hregb-bot-btn-option {
    background: #ffffff;
    border: 1.5px solid rgba(0, 68, 129, 0.1);
    color: var(--chat-brand);
    padding: 10px 14px;
    border-radius: var(--chat-radius-sm);
    cursor: pointer;
    font-size: 12.8px;
    font-weight: 600;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}
.hregb-bot-btn-option:hover {
    background: var(--chat-brand-light);
    color: #ffffff;
    border-color: var(--chat-brand-light);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 68, 129, 0.12);
}
.hregb-bot-btn-option .material-icons-round {
    font-size: 16px;
}

/* Caja de Información de Canales de Atención */
.hregb-bot-info-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 12px;
    padding: 14px;
    margin-top: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}
.hregb-bot-info-title {
    font-weight: 750;
    color: var(--chat-brand);
    border-bottom: 1.5px solid rgba(0,68,129,0.06);
    padding-bottom: 6px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
}
.hregb-bot-info-item {
    margin-bottom: 10px;
    font-size: 12.5px;
}
.hregb-bot-info-item:last-child {
    margin-bottom: 0;
}
.hregb-bot-info-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    color: var(--chat-text);
    margin-bottom: 2px;
}
.hregb-bot-info-val {
    color: var(--chat-muted);
    padding-left: 18px;
    line-height: 1.4;
}

/* Enlaces rápidos / CTA dentro de respuestas */
.hregb-bot-link-cta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #ffffff !important;
    background: var(--chat-brand) !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 6px;
    margin-top: 10px;
    transition: all 0.2s ease;
}
.hregb-bot-link-cta:hover {
    background: var(--chat-brand-light) !important;
    color: #ffffff !important;
}

/* Pie del Chat */
.hregb-bot-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--chat-border);
    background: rgba(248, 250, 252, 0.8);
    font-size: 11px;
    text-align: center;
    color: var(--chat-muted);
}

/* Animaciones */
@keyframes botPulse {
    0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes botMessageIn {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Indicador de Escritura (Typing indicator) */
.hregb-bot-typing {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    width: auto;
    max-width: 60px;
}
.hregb-bot-typing .dot {
    width: 6px;
    height: 6px;
    background: var(--chat-muted);
    border-radius: 50%;
    opacity: 0.4;
    animation: typingDot 1.4s infinite;
}
.hregb-bot-typing .dot:nth-child(2) { animation-delay: 0.2s; }
.hregb-bot-typing .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(-4px); opacity: 1; }
}

/* Adaptación responsiva */
@media (max-width: 480px) {
    .hregb-bot-container {
        bottom: 15px;
        right: 15px;
    }
    .hregb-bot-card {
        width: calc(100vw - 30px);
        height: 480px;
        bottom: 70px;
    }
}
