/* Chatbot.css - Premium UNITEK AI Assistant */

:root {
    --cb-primary: #0066cc;
    --cb-secondary: #00b8d4;
    --cb-bg: rgba(255, 255, 255, 0.9);
    --cb-text: #1a1a1a;
    --cb-glass: rgba(255, 255, 255, 0.85);
}

@keyframes saludo {
    0% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(20px);
    }

    100% {
        transform: translateX(0);
    }
}

img.saludo-animado {
    width: 200px;
    /* Ajusta el tamaño */
    border-radius: 10px;
    /* Esquinas redondeadas */
    animation: saludo 2s infinite ease-in-out;
}

img.saludo-interactivo {
    width: 200px;
    border-radius: 10px;
    transition: transform 0.3s ease, filter 0.3s ease;
    cursor: pointer;
}

img.saludo-interactivo:hover {
    transform: scale(1.1);
    filter: brightness(110%);
}

/* Launcher - Image Only */
.chatbot-launcher {
    position: fixed;
    bottom: 120px;
    right: 32px;
    width: 75px;
    height: 75px;
    background: transparent;
    cursor: pointer;
    z-index: 10000;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-launcher img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 15px rgba(0, 102, 204, 0.3));
}

.chatbot-launcher:hover {
    transform: scale(1.1) translateY(-5px);
}

.chatbot-launcher.wiggle {
    animation: launcherWave 2.5s infinite ease-in-out;
}

@keyframes launcherWave {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    10% {
        transform: scale(1.1) rotate(-15deg);
    }

    20% {
        transform: scale(1.1) rotate(15deg);
    }

    30% {
        transform: scale(1.1) rotate(-15deg);
    }

    40% {
        transform: scale(1.1) rotate(15deg);
    }

    50% {
        transform: scale(1) rotate(0deg);
    }
}

@keyframes launcherWiggle {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: scale(1.1) rotate(-5deg);
    }

    20%,
    40%,
    60%,
    80% {
        transform: scale(1.1) rotate(5deg);
    }
}

/* Welcome Bubble */
.welcome-bubble {
    position: fixed;
    bottom: 205px;
    right: 32px;
    background: white;
    padding: 12px 20px;
    border-radius: 18px;
    border-bottom-right-radius: 4px;
    box-shadow: 0 10px 25px rgba(0, 102, 204, 0.15);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cb-primary);
    z-index: 9999;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    border: 1px solid rgba(0, 102, 204, 0.1);
}

.welcome-bubble.active {
    opacity: 1;
    transform: translateY(0);
}

.welcome-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 15px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

/* Window */
.chatbot-window {
    position: fixed;
    bottom: 210px;
    right: 35px;
    width: 380px;
    max-width: 90vw;
    height: 600px;
    max-height: 70vh;
    background: var(--cb-glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chatbot-window.active {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0) scale(1);
    display: flex;
}

@media (max-width: 768px) {
    .chatbot-launcher {
        bottom: 85px;
        right: 12px;
        width: 65px;
        height: 65px;
    }

    .welcome-bubble {
        bottom: 160px;
        right: 12px;
    }

    .chatbot-window {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        transform: translateY(100%);
    }

    .chatbot-window.active {
        transform: translateY(0);
    }
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #003366, #0066cc);
    padding: 15px 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-mini-logo {
    height: 25px;
    width: auto;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 51, 102, 0.2) transparent;
}

/* Chrome, Edge, and Safari */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(0, 51, 102, 0.2);
    border-radius: 10px;
}

.msg {
    max-width: 85%;
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    animation: msgIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.msg.user {
    align-self: flex-end;
    background: #0066cc;
    color: white;
    border-bottom-right-radius: 4px;
}

.msg.bot {
    align-self: flex-start;
    background: white;
    color: #2c3e50;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(0, 51, 102, 0.05);
}

/* Quick Actions / Buttons */
.quick-actions-container {
    padding: 15px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: rgba(255, 255, 255, 0.4);
    border-top: 1px solid rgba(0, 51, 102, 0.05);
}

.quick-chip {
    background: white;
    border: 1px solid #0066cc;
    color: #0066cc;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 102, 204, 0.1);
    flex-grow: 1;
    text-align: center;
}

.quick-chip:hover {
    background: #0066cc;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 102, 204, 0.2);
}

/* Footer info */
.chatbot-footer {
    padding: 0;
    text-align: center;
    background: transparent;
}

/* Hide old input container */
.chat-input-container {
    display: none !important;
}

/* Typing Indicator */
.typing-indicator {
    padding: 10px 20px;
    display: none;
    align-self: flex-start;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #0066cc;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    opacity: 0.6;
    animation: bounce 1.4s infinite ease-in-out both;
}