﻿/* =========================================================
   CHATBOT CONTAINER
   ========================================================= */

#chatbot-container {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 1080;
}

/* =========================================================
   TOGGLE BUTTON
   ========================================================= */

#chatbot-toggle {
    background: var(--falcon-primary, #2c7be5);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 0.5rem 1.25rem rgba(0,0,0,.25);
    transition: transform .2s ease, box-shadow .2s ease;
}

    #chatbot-toggle:hover {
        transform: translateY(-2px);
        box-shadow: 0 0.75rem 1.5rem rgba(0,0,0,.35);
    }

/* =========================================================
   CHATBOX PANEL
   ========================================================= */

#chatbox {
    position: fixed;
    bottom: 5.25rem;
    right: 1.25rem;
    width: 320px;
    max-width: calc(100vw - 2.5rem);
    height: 420px;
    background: var(--falcon-card-bg, #fff);
    border-radius: .75rem;
    box-shadow: 0 1rem 2rem rgba(0,0,0,.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(10px) scale(.98);
    pointer-events: none;
    transition: all .25s ease;
}

    #chatbox.show {
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }

/* =========================================================
   HEADER
   ========================================================= */

#chat-header {
    background: var(--falcon-primary, #2c7be5);
    color: #fff;
    padding: .6rem .85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: .9rem;
}

#chat-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    opacity: .85;
}

    #chat-close:hover {
        opacity: 1;
    }

/* =========================================================
   BODY
   ========================================================= */

#chat-body {
    flex: 1;
    padding: .75rem;
    overflow-y: auto;
    background: var(--falcon-body-bg, #f9fafd);
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

/* =========================================================
   MESSAGES
   ========================================================= */

.chat-msg {
    max-width: 80%;
    padding: .45rem .7rem;
    border-radius: .75rem;
    font-size: .85rem;
    line-height: 1.4;
    word-wrap: break-word;
}

    .chat-msg.user {
        background: var(--falcon-primary, #2c7be5);
        color: #fff;
        align-self: flex-end;
        border-bottom-right-radius: .2rem;
    }

    .chat-msg.bot {
        background: var(--falcon-gray-200, #edf2f9);
        color: var(--falcon-body-color, #344050);
        align-self: flex-start;
        border-bottom-left-radius: .2rem;
    }

    /* typing indicator */
    .chat-msg.typing {
        font-style: italic;
        opacity: .7;
    }

/* =========================================================
   INPUT AREA
   ========================================================= */

#chat-input {
    display: flex;
    padding: .5rem;
    gap: .5rem;
    border-top: 1px solid var(--falcon-border-color, #d8e2ef);
    background: var(--falcon-card-bg, #fff);
}

    #chat-input input {
        flex: 1;
        border-radius: .375rem;
        border: 1px solid var(--falcon-border-color, #d8e2ef);
        padding: .4rem .55rem;
        font-size: .85rem;
    }

        #chat-input input:focus {
            outline: none;
            border-color: var(--falcon-primary, #2c7be5);
        }

    #chat-input button {
        background: var(--falcon-primary, #2c7be5);
        border: none;
        color: #fff;
        border-radius: .375rem;
        padding: .4rem .75rem;
        font-size: .85rem;
        cursor: pointer;
    }

        #chat-input button:hover {
            filter: brightness(1.05);
        }

/* =========================================================
   DARK MODE FIXES
   ========================================================= */

[data-bs-theme="dark"] #chat-body {
    background: #0f172a;
}

[data-bs-theme="dark"] .chat-msg.bot {
    background: #1e293b;
    color: #e5e7eb;
}

/* =========================================================
   CHAT INPUT – DARK MODE FIX
   ========================================================= */

[data-bs-theme="dark"] #chat-input {
    background: #0b1220; /* slightly darker than body */
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

    [data-bs-theme="dark"] #chat-input input {
        background: #0f172a;
        border-color: rgba(255, 255, 255, 0.12);
        color: #e5e7eb;
    }

        [data-bs-theme="dark"] #chat-input input::placeholder {
            color: rgba(255, 255, 255, 0.45);
        }

        [data-bs-theme="dark"] #chat-input input:focus {
            border-color: var(--falcon-primary, #2c7be5);
            background: #0f172a;
        }

    [data-bs-theme="dark"] #chat-input button {
        background: var(--falcon-primary, #2c7be5);
        color: #fff;
    }

    /* ---- options ----- */
.chat-options {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chat-option {
    background: var(--falcon-primary, #2c7be5);
    color: #fff !important;
    border: none;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

    .chat-option:hover {
        background: #1a66d1;
    }

