/* =========================================================
   Cayumanque Ecolodge Chatbot - Estilos públicos
   ========================================================= */

:root {
    --ecolodge-green: #2b7a6a;
    /* Verde natural tipo ecolodge */
    --ecolodge-green-dark: #236258;
    --chat-bg: #f2f5f9;
    --chat-header: #0b1f25;
    --chat-text: #1d2b34;
    --chat-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    --radius-lg: 18px;
    --radius-sm: 12px;
    font-family: "Segoe UI", system-ui, sans-serif;
}

/* =========================================================
   BOTÓN FLOTANTE (FAB) - BURBUJA DE CHAT
   ========================================================= */

.chatbot-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 85px;
    height: 85px;
    border-radius: 50%;
    background: var(--ecolodge-green);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    z-index: 1000;
    animation: chatbotBounce 1.2s ease;
}

.chatbot-fab svg {
    width: 50px;
    height: 50px;
    fill: #fff;
}

.chatbot-fab:hover {
    transform: scale(1.08);
    background: var(--ecolodge-green-dark);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

/* ✨ Animación de rebote suave */
@keyframes chatbotBounce {
    0% {
        transform: scale(0.4);
        opacity: 0;
    }

    50% {
        transform: scale(1.15);
        opacity: 1;
    }

    75% {
        transform: scale(0.95);
    }

    100% {
        transform: scale(1);
    }
}

/* =========================================================
   WIDGET DEL CHAT
   ========================================================= */

.chatbot-widget {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: min(380px, 92vw);
    max-height: 80vh;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--chat-shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
}

.chatbot-widget.open {
    display: flex;
    animation: chatbotFadeIn 0.3s ease;
}

@keyframes chatbotFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================
   CABECERA
   ========================================================= */

.chatbot-header {
    background: var(--chat-header);
    color: #fff;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header h2 {
    font-size: 16px;
    margin: 0 0 4px;
}

.chatbot-header .status {
    font-size: 12px;
    opacity: 0.8;
}

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

.header-actions select {
    padding: 4px 6px;
    border-radius: 6px;
    border: none;
}

.header-actions .close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

/* =========================================================
   CUERPO DEL CHAT
   ========================================================= */

.chatbot-body {
    padding: 16px;
    background: var(--chat-bg);
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    max-width: 85%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-line;
}

.message.bot {
    background: #fff;
    align-self: flex-start;
    border: 1px solid #e0e0e0;
}

.message.user {
    background: var(--ecolodge-green);
    color: #fff;
    align-self: flex-end;
}

.message.typing {
    font-style: italic;
    opacity: 0.7;
}

.message a {
    color: var(--ecolodge-green-dark);
    font-weight: 600;
    text-decoration: none;
}

.message a:hover {
    text-decoration: underline;
}

/* =========================================================
   CHIPS Y BOTONES RÁPIDOS
   ========================================================= */

.chatbot-chips {
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
}

.chip {
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef4f7;
    border: none;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s ease;
}

.chip:hover {
    background: #dce9ee;
}

/* =========================================================
   CTA WHATSAPP / RESERVA
   ========================================================= */

.chatbot-cta {
    padding: 12px 16px 0;
    background: #fff;
    border-top: 1px solid #e0e0e0;
}

.whatsapp-cta {
    display: block;
    text-align: center;
    padding: 10px 12px;
    background: var(--ecolodge-green);
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.whatsapp-cta:hover {
    background: var(--ecolodge-green-dark);
}

/* =========================================================
   INPUT DEL CHAT
   ========================================================= */

.chatbot-input {
    display: flex;
    gap: 8px;
    padding: 12px 16px 16px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.chatbot-input input {
    flex: 1;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid #d9e2ec;
}

.chatbot-input button {
    padding: 10px 16px;
    border-radius: 999px;
    border: none;
    background: var(--ecolodge-green);
    color: #fff;
    cursor: pointer;
    transition: background 0.25s ease;
}

.chatbot-input button:hover {
    background: var(--ecolodge-green-dark);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 600px) {
    .chatbot-widget {
        right: 16px;
        bottom: 90px;
        width: 92vw;
    }

    .chatbot-fab {
        right: 16px;
        bottom: 16px;
    }
}