/* ESTILOS DEL CHATBOT - TEMA TECNOLÓGICO/NEÓN */

/* Botón Flotante */
.chatbot-floating-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.5), 0 0 30px rgba(0, 210, 255, 0.3);
    z-index: 9999;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    gap: 12px;
    padding: 0;
    animation: floatingPulse 2s infinite ease-in-out;
}

@keyframes floatingPulse {
    0% { transform: scale(1); box-shadow: 0 0 15px rgba(0, 210, 255, 0.5); }
    50% { transform: scale(1.08); box-shadow: 0 0 30px rgba(0, 210, 255, 0.8); }
    100% { transform: scale(1); box-shadow: 0 0 15px rgba(0, 210, 255, 0.5); }
}

.chatbot-floating-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.8), 0 0 40px rgba(0, 210, 255, 0.5);
}

/* Estado Activo (Píldora) */
.chatbot-floating-btn.active {
    width: auto;
    min-width: 170px;
    padding: 0 22px;
    border-radius: 40px;
    /* Un toque más sobrio cuando está activo para no distraer demasiado */
    background: linear-gradient(135deg, #00b4db 0%, #2a69c5 100%);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.4), 0 0 20px rgba(0, 210, 255, 0.2);
}

.chatbot-status-text {
    display: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    animation: fadeIn 0.5s ease forwards;
}

.chatbot-floating-btn.active .chatbot-status-text {
    display: block;
}

.chatbot-active-dot {
    display: none;
    width: 10px;
    height: 10px;
    background-color: #00ffaa;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ffaa;
    margin-left: -4px;
}

.chatbot-floating-btn.active .chatbot-active-dot {
    display: block;
    animation: chatbotPulse 2s infinite;
}

@keyframes chatbotPulse {
    0% { transform: scale(1); box-shadow: 0 0 8px #00ffaa; }
    50% { transform: scale(1.3); box-shadow: 0 0 15px #00ffaa; }
    100% { transform: scale(1); box-shadow: 0 0 8px #00ffaa; }
}

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

/* Ventana del Chat */
.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 360px;
    height: 550px;
    max-height: 80vh;
    background-color: #0d0d12;
    border: 1px solid #1a1a24;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 210, 255, 0.15);
    z-index: 10000;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform-origin: bottom right;
    font-family: inherit;
}

.chatbot-window.hidden {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    pointer-events: none;
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #151520 0%, #0d0d12 100%);
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #252535;
}

.chatbot-title {
    color: #00d2ff;
    font-weight: 600;
    font-size: 16px;
    text-shadow: 0 0 8px rgba(0, 210, 255, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
}

.bot-status-dot {
    width: 8px;
    height: 8px;
    background-color: #00ffaa;
    border-radius: 50%;
    box-shadow: 0 0 8px #00ffaa;
    display: inline-block;
}

.chatbot-header-btns {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chatbot-header-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.chatbot-header-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.minimize-btn {
    font-size: 28px;
}

.close-btn:hover {
    background-color: rgba(255, 75, 75, 0.15);
    color: #ff4b4b;
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    padding: 20px 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background-color: #08080b; /* Muy oscuro */
    scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}
.chatbot-messages::-webkit-scrollbar-thumb {
    background-color: #252535;
    border-radius: 3px;
}

.chat-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.chat-bubble.bot {
    background-color: #1a1a24;
    color: #e2e2e2;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid #252535;
    border-left: 2px solid #00d2ff;
}

.chat-bubble.user {
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Opciones/Menú Inicial */
.chat-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    align-self: center; /* Centrar menú de opciones */
    width: 90%;
}

.chat-option-btn {
    background-color: rgba(0, 210, 255, 0.05);
    border: 1px solid rgba(0, 210, 255, 0.5);
    color: #00d2ff;
    padding: 10px 18px;
    border-radius: 12px; /* Más moderno */
    font-size: 13.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center; /* Texto centrado en botones */
    display: block;
    width: 100%;
    margin-bottom: 2px;
}

.chat-option-btn:hover {
    background-color: #00d2ff;
    color: #000;
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.4);
    transform: translateY(-2px);
}

/* Input Area */
.chatbot-input-area {
    padding: 15px;
    background-color: #0d0d12;
    border-top: 1px solid #252535;
    display: flex;
    gap: 10px;
    align-items: center;
}

#chatbot-input {
    flex: 1;
    background-color: #151520;
    border: 1px solid #252535;
    padding: 12px 18px;
    border-radius: 24px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#chatbot-input::placeholder {
    color: #666;
}

#chatbot-input:focus {
    border-color: #00d2ff;
    box-shadow: 0 0 8px rgba(0, 210, 255, 0.2);
}

#chatbot-send-btn {
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

#chatbot-send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.4);
}

/* Animación de "Escribiendo" */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background-color: #1a1a24;
    border-radius: 18px;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid #252535;
    width: fit-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: #00d2ff;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

@media (max-width: 480px) {
    .chatbot-window {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    .chatbot-window.hidden {
        transform: translateY(100%);
    }
}
