/* ═══════════════════════════════════════════════════════════════
   Miami Lakes Chamber — Chatbot Widget Styles
   ═══════════════════════════════════════════════════════════════ */

:root {
    --ml-primary:      #1a4f8a;
    --ml-primary-dark: #143d6e;
    --ml-accent:       #e8a020;
    --ml-white:        #ffffff;
    --ml-bg:           #f4f7fb;
    --ml-border:       #dde3ee;
    --ml-text:         #2c3e50;
    --ml-text-light:   #7f8c9a;
    --ml-bot-bubble:   #ffffff;
    --ml-user-bubble:  #1a4f8a;
    --ml-shadow:       0 8px 40px rgba(26,79,138,.22);
    --ml-radius:       18px;
    --ml-radius-sm:    10px;
    --ml-font:         'Segoe UI', system-ui, -apple-system, sans-serif;
    --ml-transition:   .25s cubic-bezier(.4,0,.2,1);
    --ml-w:            370px;
    --ml-h:            520px;
}

/* ── Wrapper ──────────────────────────────────────────────────── */
#ml-chatbot-wrapper {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: var(--ml-font);
}

/* ── Toggle button ───────────────────────────────────────────── */
#ml-chat-toggle {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--ml-primary);
    color: var(--ml-white);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(26,79,138,.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--ml-transition), transform var(--ml-transition), box-shadow var(--ml-transition);
    position: relative;
    outline: none;
}
#ml-chat-toggle:hover {
    background: var(--ml-primary-dark);
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(26,79,138,.5);
}
#ml-chat-toggle:active { transform: scale(.97); }

.ml-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    animation: ml-pulse 2s infinite;
}
@keyframes ml-pulse {
    0%,100% { transform: scale(1); }
    50%      { transform: scale(1.2); }
}
.ml-chat-badge.ml-hidden { display: none; }

/* ── Chat window ─────────────────────────────────────────────── */
#ml-chat-window {
    position: absolute;
    bottom: 76px;
    right: 0;
    width: var(--ml-w);
    height: var(--ml-h);
    background: var(--ml-bg);
    border-radius: var(--ml-radius);
    box-shadow: var(--ml-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--ml-border);
    animation: ml-slide-up .28s cubic-bezier(.4,0,.2,1) both;
}
@keyframes ml-slide-up {
    from { opacity:0; transform: translateY(20px) scale(.97); }
    to   { opacity:1; transform: translateY(0)    scale(1);   }
}

/* ── Header ──────────────────────────────────────────────────── */
.ml-chat-header {
    background: var(--ml-primary);
    color: var(--ml-white);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.ml-chat-header-info {
    display: flex;
    align-items: center;
    gap: 11px;
}
.ml-chat-avatar {
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,.18);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ml-chat-header-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}
.ml-chat-header-sub {
    font-size: 11px;
    opacity: .8;
    margin-top: 1px;
}
.ml-chat-close-btn {
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--ml-transition);
    flex-shrink: 0;
    outline: none;
}
.ml-chat-close-btn:hover { background: rgba(255,255,255,.3); }

/* ── Messages area ───────────────────────────────────────────── */
#ml-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}
#ml-chat-messages::-webkit-scrollbar { width: 5px; }
#ml-chat-messages::-webkit-scrollbar-track { background: transparent; }
#ml-chat-messages::-webkit-scrollbar-thumb { background: #c5cfd8; border-radius: 10px; }

/* ── Message bubbles ─────────────────────────────────────────── */
.ml-msg {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    animation: ml-fade-in .2s ease both;
}
@keyframes ml-fade-in {
    from { opacity:0; transform: translateY(6px); }
    to   { opacity:1; transform: translateY(0);   }
}
.ml-msg.ml-bot  { justify-content: flex-start; }
.ml-msg.ml-user { justify-content: flex-end;   }

.ml-msg-icon {
    width: 30px;
    height: 30px;
    background: var(--ml-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    flex-shrink: 0;
}

.ml-bubble {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: var(--ml-radius);
    font-size: 13.5px;
    line-height: 1.55;
    word-break: break-word;
}
.ml-bot  .ml-bubble {
    background: var(--ml-bot-bubble);
    color: var(--ml-text);
    border-radius: 4px 16px 16px 16px;
    border: 1px solid var(--ml-border);
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.ml-user .ml-bubble {
    background: var(--ml-user-bubble);
    color: #fff;
    border-radius: 16px 16px 4px 16px;
}
.ml-bubble a {
    color: var(--ml-accent);
    text-decoration: underline;
    font-weight: 600;
}
.ml-user .ml-bubble a { color: #ffe0a0; }

/* Typing dots */
.ml-typing .ml-bubble {
    padding: 12px 18px;
}
.ml-typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}
.ml-typing-dots span {
    width: 7px;
    height: 7px;
    background: #b0bec5;
    border-radius: 50%;
    animation: ml-dot-bounce .9s infinite;
}
.ml-typing-dots span:nth-child(2) { animation-delay: .15s; }
.ml-typing-dots span:nth-child(3) { animation-delay: .3s;  }
@keyframes ml-dot-bounce {
    0%,80%,100% { transform: translateY(0);    }
    40%          { transform: translateY(-6px); }
}

/* ── Suggestions sticky bar (hidden — inline chips used instead) ── */
#ml-chat-suggestions {
    display: none;
}

/* ── Shared suggestion button base ───────────────────────────── */
.ml-suggestion-btn {
    background: #f0f5ff;
    border: 1.5px solid var(--ml-primary);
    color: var(--ml-primary);
    padding: 3px 9px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--ml-transition), color var(--ml-transition);
    font-family: var(--ml-font);
    white-space: nowrap;
    line-height: 1.4;
}
.ml-suggestion-btn:hover {
    background: var(--ml-primary);
    color: #fff;
}

/* ── Inline suggestion chips rendered inside the chat ────────── */
.ml-inline-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 4px 0 4px 38px;
    animation: ml-fade-in .2s ease both;
}

/* ── Input area ──────────────────────────────────────────────── */
.ml-chat-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fff;
    border-top: 1px solid var(--ml-border);
    flex-shrink: 0;
}
#ml-chat-input {
    flex: 1;
    border: 1.5px solid var(--ml-border);
    border-radius: 24px;
    padding: 9px 16px;
    font-size: 13.5px;
    font-family: var(--ml-font);
    color: var(--ml-text);
    background: var(--ml-bg);
    outline: none;
    transition: border-color var(--ml-transition);
}
#ml-chat-input:focus { border-color: var(--ml-primary); }
#ml-chat-input::placeholder { color: #aab4be; }

#ml-chat-send {
    width: 40px;
    height: 40px;
    background: var(--ml-primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--ml-transition), transform var(--ml-transition);
    outline: none;
}
#ml-chat-send:hover  { background: var(--ml-primary-dark); transform: scale(1.08); }
#ml-chat-send:active { transform: scale(.94); }
#ml-chat-send:disabled { background: #c5cfd8; cursor: not-allowed; transform: none; }

/* ── Footer note ─────────────────────────────────────────────── */
.ml-chat-footer-note {
    text-align: center;
    font-size: 11px;
    color: var(--ml-text-light);
    padding: 5px 0 8px;
    background: #fff;
    flex-shrink: 0;
}
.ml-chat-footer-note a {
    color: var(--ml-primary);
    text-decoration: none;
    font-weight: 600;
}
.ml-chat-footer-note a:hover { text-decoration: underline; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 480px) {
    :root { --ml-w: calc(100vw - 16px); --ml-h: 72vh; }
    #ml-chatbot-wrapper { bottom: 14px; right: 8px; left: 8px; }
    #ml-chat-toggle { right: 0; position: absolute; }
    #ml-chat-window { right: 0; }
}
