/* ============================================================
   Mezquita Chatbot — Estilos
   Paleta: teal #1A6B6B | dorado #C9962A | blanco roto #F7F3EE
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap');

:root {
    --mq-teal:       #1A6B6B;
    --mq-teal-dark:  #145555;
    --mq-gold:       #C9962A;
    --mq-gold-light: #E8B84B;
    --mq-cream:      #F7F3EE;
    --mq-text:       #1C1C1C;
    --mq-text-muted: #6B6B6B;
    --mq-border:     #D9D0C4;
    --mq-radius:     12px;
    --mq-shadow:     0 4px 24px rgba(0,0,0,0.12);
    --mq-font:       'Lato', sans-serif;
}

/* ── Área de mensajes ─────────────────────────────────────── */

.mq-chat__messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    background: var(--mq-cream);
}

.mq-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: var(--mq-radius);
    font-size: 0.95rem;
    line-height: 1.55;
    word-break: break-word;
}

.mq-msg--user {
    align-self: flex-end;
    background: var(--mq-teal);
    color: #fff;
    border-bottom-right-radius: 3px;
}

.mq-msg--bot {
    align-self: flex-start;
    background: #fff;
    color: var(--mq-text);
    border: 1px solid var(--mq-border);
    border-bottom-left-radius: 3px;
}

.mq-msg--thinking {
    align-self: flex-start;
    background: #fff;
    color: var(--mq-text-muted);
    border: 1px solid var(--mq-border);
    border-bottom-left-radius: 3px;
    font-style: italic;
}

/* ── Input ────────────────────────────────────────────────── */

.mq-chat__input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid var(--mq-border);
}

.mq-chat__input {
    flex: 1;
    resize: none;
    border: 1px solid var(--mq-border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--mq-text);
    background: var(--mq-cream);
    transition: border-color 0.2s;
    line-height: 1.4;
}

.mq-chat__input:focus {
    outline: none;
    border-color: var(--mq-teal);
}

.mq-chat__send {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    background: var(--mq-teal);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
    padding: 0;
}

.mq-chat__send:hover  { background: var(--mq-teal-dark); }
.mq-chat__send:active { transform: scale(0.94); }
.mq-chat__send svg    { width: 16px; height: 16px; }

/* ── Modo PÁGINA ──────────────────────────────────────────── */

#mq-chat-page {
    display: flex;
    flex-direction: column;
    height: 600px;
    max-width: 720px;
    margin: 0 auto;
    border: 1px solid var(--mq-border);
    border-radius: var(--mq-radius);
    overflow: hidden;
    box-shadow: var(--mq-shadow);
    font-family: var(--mq-font);
}

#mq-chat-page .mq-chat__messages {
    min-height: 460px;
}

/* ── Modo BURBUJA ─────────────────────────────────────────── */

#mq-bubble-wrapper {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: var(--mq-font);
}

.mq-bubble__toggle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--mq-teal);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
    padding: 0;
}

.mq-bubble__toggle:hover  { background: var(--mq-teal-dark); }
.mq-bubble__toggle:active { transform: scale(0.93); }
.mq-bubble__toggle svg    { width: 26px; height: 26px; }

.mq-bubble__panel {
    position: absolute;
    bottom: 64px;
    right: 0;
    width: 340px;
    height: 460px;
    background: #fff;
    border-radius: var(--mq-radius);
    box-shadow: var(--mq-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--mq-border);
    animation: mq-slide-up 0.2s ease;
}

.mq-bubble__panel[hidden] { display: none; }

@keyframes mq-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.mq-bubble__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--mq-teal);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.mq-bubble__close {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 2px 4px;
    opacity: 0.8;
    transition: opacity 0.15s;
}

.mq-bubble__close:hover { opacity: 1; }

.mq-bubble__panel .mq-chat__messages {
    min-height: 0;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 480px) {
    .mq-bubble__panel {
        width: calc(100vw - 32px);
        right: -8px;
    }

    #mq-chat-page {
        height: 500px;
    }
}

/* ── Accesibilidad: movimiento reducido ───────────────────── */

@media (prefers-reduced-motion: reduce) {
    .mq-bubble__panel { animation: none; }
}
