/**
 * PCYA Chatbot - Estilos Base y Variables
 * Archivo: main.css
 * Descripción: Variables CSS, botón flotante, animaciones generales
 */

/* ===========================================================
   VARIABLES CSS (Fácil Personalización)
   =========================================================== */
:root {
    --pcya-primary-color: #333333; /* Color Oscuro principal */
    --pcya-accent-color: #EA1917; /* Color Rojo de acento */
    --pcya-text-color: #333;
    --pcya-background-messages: #F4F4F4; /* Fondo de la ventana de mensajes */
    --pcya-bubble-bot-bg: #fff;
    --pcya-box-shadow-medium: 0 6px 22px rgba(0,0,0,0.35);
    --pcya-box-shadow-large: 0 12px 32px rgba(0,0,0,0.25);
}

/* ===========================================================
   BOTÓN FLOTANTE (Launcher)
   =========================================================== */

#pcya-chat-launcher {
    position: fixed !important;
    bottom: 25px !important;
    right: 25px !important;
    z-index: 999999999 !important;
}

.pcya-icon {
    width: 58px;
    height: 58px;
    background: var(--pcya-primary-color);
    border-radius: 50%;
    box-shadow: var(--pcya-box-shadow-medium);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .25s ease;
    overflow: hidden;
}

.pcya-icon img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    transition: .25s ease;
}

.pcya-icon.open img {
    width: 15px;
    height: 15px;
}

.pcya-icon:hover {
    background: var(--pcya-accent-color);
    transform: scale(1.10);
    box-shadow: 0 10px 28px rgba(0,0,0,0.45);
}

#chatbot-toggle.open-icon {
    transform: rotate(45deg);
    background: var(--pcya-primary-color);
}

/* ===========================================================
   ANIMACIONES GLOBALES
   =========================================================== */

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

/* ===========================================================
   UTILIDADES GLOBALES
   =========================================================== */

.pcya-menu-hidden {
    display: none !important;
}

/* ===========================================================
   RESPONSIVE - MOBILE
   =========================================================== */

@media (max-width: 480px) {
    #pcya-chat-window {
        width: calc(100vw - 20px) !important;
        height: calc(100vh - 120px) !important;
        max-height: 600px !important;
        bottom: 105px !important;
        right: 10px !important;
        left: 10px !important;
        top: auto !important;
        border-radius: 30px !important;
    }

    #pcya-chat-launcher {
        bottom: 20px !important;
        right: 20px !important;
    }

    .pcya-icon {
        width: 46px;
        height: 46px;
    }

    .pcya-icon img {
        width: 24px;
        height: 24px;
    }
}
/* INDICADOR DE ESCRITURA (PUNTITOS DE DARIO) */
.pcya-typing {
    background: #ffffff !important;
    padding: 12px 16px !important;
    border-radius: 18px 18px 18px 5px !important;
    width: fit-content !important;
    display: flex !important;
    align-items: center !important;
    margin: 10px 0 !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05) !important;
    align-self: flex-start !important;
}

.typing-indicator {
    display: flex !important;
    gap: 5px !important;
    align-items: center !important;
}

.typing-indicator span {
    width: 7px !important;
    height: 7px !important;
    background: #EA1917 !important; /* Rojo PC YA */
    border-radius: 50% !important;
    display: inline-block !important;
    animation: pcya-blink 1.4s infinite both !important;
}

.typing-indicator span:nth-child(2) { animation-delay: .2s !important; }
.typing-indicator span:nth-child(3) { animation-delay: .4s !important; }

@keyframes pcya-blink {
    0% { opacity: .2; transform: scale(0.8); }
    20% { opacity: 1; transform: scale(1.1); }
    100% { opacity: .2; transform: scale(0.8); }
}
/* ── TOOLTIP DE BIENVENIDA ─────────────────────────────────── */
#pcya-chat-tooltip {
    position: fixed !important;
    bottom: 95px !important;
    right: 25px !important;
    z-index: 999999998 !important;
    background: #2d2d2d;
    color: #fff;
    border-radius: 12px;
    padding: 14px 36px 14px 16px;
    max-width: 480px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    font-size: 15px;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
}
#pcya-chat-tooltip.pcya-tooltip-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
#pcya-chat-tooltip p {
    margin: 0;
}
#pcya-tooltip-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    color: #ccc;
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}
#pcya-tooltip-close:hover {
    color: #fff;
}
