/* ============================================================
   5INKO ChatBot IA — Estilos Frontend
   Version: 1.0.0 | 5inko.com
   ============================================================ */

:root {
    --ficbot-accent: #6B21A8;
    --ficbot-accent-dark: #4c1d7a;
    --ficbot-white: #ffffff;
    --ficbot-gray-50: #f9fafb;
    --ficbot-gray-100: #f3f4f6;
    --ficbot-gray-200: #e5e7eb;
    --ficbot-gray-400: #9ca3af;
    --ficbot-gray-600: #4b5563;
    --ficbot-gray-800: #1f2937;
    --ficbot-shadow: 0 10px 40px rgba(0,0,0,.18);
    --ficbot-radius: 16px;
    --ficbot-z: 99999;
}

/* Contenedor principal */
#ficbot-container {
    position: fixed;
    z-index: var(--ficbot-z);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
#ficbot-container.ficbot-bottom-right { bottom: 24px; right: 24px; }
#ficbot-container.ficbot-bottom-left  { bottom: 24px; left: 24px; }

/* Botón toggle */
#ficbot-toggle {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--ficbot-accent);
    color: var(--ficbot-white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--ficbot-shadow);
    transition: transform .2s ease, background .2s;
    position: relative;
}
#ficbot-toggle:hover { background: var(--ficbot-accent-dark); transform: scale(1.08); }
#ficbot-toggle svg { width: 26px; height: 26px; }

/* Pulso animado */
#ficbot-toggle::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--ficbot-accent);
    animation: ficbot-pulse 3s ease-out infinite;
}
@keyframes ficbot-pulse {
    0%   { transform: scale(1);   opacity: .6; }
    60%  { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Ventana del chat */
#ficbot-window {
    width: 340px;
    max-height: 520px;
    background: var(--ficbot-white);
    border-radius: var(--ficbot-radius);
    box-shadow: var(--ficbot-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 12px;
    animation: ficbot-slide-up .25s ease;
}
@keyframes ficbot-slide-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Header */
#ficbot-header {
    background: var(--ficbot-accent);
    color: var(--ficbot-white);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ficbot-header-info { display: flex; align-items: center; gap: 10px; }
.ficbot-avatar { font-size: 26px; line-height: 1; }
.ficbot-bot-name { font-weight: 700; font-size: 14px; }
.ficbot-status-text { font-size: 11px; opacity: .85; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.ficbot-dot { width: 7px; height: 7px; background: #4ade80; border-radius: 50%; display: inline-block; }
#ficbot-close-btn {
    background: none; border: none; color: white; font-size: 18px;
    cursor: pointer; opacity: .7; padding: 0 4px; line-height: 1;
    transition: opacity .15s;
}
#ficbot-close-btn:hover { opacity: 1; }

/* Área de mensajes */
#ficbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 200px;
    max-height: 280px;
    scroll-behavior: smooth;
}
#ficbot-messages::-webkit-scrollbar { width: 4px; }
#ficbot-messages::-webkit-scrollbar-track { background: transparent; }
#ficbot-messages::-webkit-scrollbar-thumb { background: var(--ficbot-gray-200); border-radius: 4px; }

/* Burbujas de mensaje */
.ficbot-msg {
    max-width: 82%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.45;
    word-break: break-word;
    animation: ficbot-fade-in .2s ease;
}
@keyframes ficbot-fade-in { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:translateY(0); } }

.ficbot-msg-bot {
    background: var(--ficbot-gray-100);
    color: var(--ficbot-gray-800);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}
.ficbot-msg-user {
    background: var(--ficbot-accent);
    color: var(--ficbot-white);
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

/* Typing indicator */
.ficbot-typing {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: var(--ficbot-gray-100);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    width: fit-content;
}
.ficbot-typing span {
    width: 7px; height: 7px;
    background: var(--ficbot-gray-400);
    border-radius: 50%;
    animation: ficbot-bounce .9s infinite;
}
.ficbot-typing span:nth-child(2) { animation-delay: .15s; }
.ficbot-typing span:nth-child(3) { animation-delay: .30s; }
@keyframes ficbot-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

/* Sugerencias rápidas */
#ficbot-suggestions-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 14px 2px;
}
.ficbot-suggestion {
    font-size: 11.5px;
    padding: 5px 11px;
    border-radius: 99px;
    border: 1.5px solid var(--ficbot-accent);
    color: var(--ficbot-accent);
    background: var(--ficbot-white);
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.ficbot-suggestion:hover {
    background: var(--ficbot-accent);
    color: var(--ficbot-white);
}

/* Input */
#ficbot-input-area {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-top: 1px solid var(--ficbot-gray-200);
    gap: 8px;
    background: var(--ficbot-white);
}
#ficbot-input {
    flex: 1;
    border: 1.5px solid var(--ficbot-gray-200);
    border-radius: 99px;
    padding: 8px 14px;
    font-size: 13px;
    outline: none;
    transition: border-color .15s;
    color: var(--ficbot-gray-800);
    background: var(--ficbot-gray-50);
}
#ficbot-input:focus { border-color: var(--ficbot-accent); }
#ficbot-send {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--ficbot-accent);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s, transform .1s;
    color: white;
}
#ficbot-send:hover { background: var(--ficbot-accent-dark); transform: scale(1.05); }
#ficbot-send svg { width: 18px; height: 18px; }

/* Footer branding */
#ficbot-footer-brand {
    text-align: center;
    font-size: 10.5px;
    color: var(--ficbot-gray-400);
    padding: 5px 0 8px;
    background: var(--ficbot-white);
}
#ficbot-footer-brand a {
    color: var(--ficbot-accent);
    text-decoration: none;
    font-weight: 600;
}

/* Responsive mobile */
@media (max-width: 400px) {
    #ficbot-window { width: calc(100vw - 32px); }
    #ficbot-container.ficbot-bottom-right { right: 16px; }
    #ficbot-container.ficbot-bottom-left  { left: 16px; }
}
