@import url("https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,100..900&display=swap");

* {
    font-family: "Inter", sans-serif;
    box-sizing: border-box;
}

.basira-logo {
    display: inline-block;
    vertical-align: middle;
}

/* ===============================
   CHATBOT TOGGLER
================================ */
#chatbot-toggler {
    position: fixed;
    bottom: 30px;
    height: 65px;
    width: 65px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    background: linear-gradient(135deg, #f9966f 0%, #f27c4f 100%);
    box-shadow: 0 0 15px rgba(249,150,111,0.5);
    transition: all 0.3s ease;
    z-index: 999;
    padding: 0px !important;
    margin-bottom: 0px !important;
    margin-left: 35px;
}

    #chatbot-toggler:hover {
        transform: translateY(-2px) scale(1.04);
        box-shadow: 0 10px 22px rgba(249,150,111,0.55);
    }

    #chatbot-toggler:active {
        transform: scale(0.96);
    }

body.show-chatbot #chatbot-toggler {
    transform: rotate(90deg);
}

#chatbot-toggler span {
    color: #fff;
    position: absolute;
}

    body.show-chatbot #chatbot-toggler span:first-child,
    #chatbot-toggler span:last-child {
        opacity: 0;
    }

body.show-chatbot #chatbot-toggler span:last-child {
    opacity: 1;
}

/* ===============================
   CHAT POPUP
================================ */
.chatbot-popup {
    position: fixed;
    bottom: 90px;
    width: 420px;
    background: #fff;
    overflow: hidden;
    border-radius: 15px;
    opacity: 0;
    transform: scale(0.2);
    pointer-events: none;
    box-shadow: 0 0 128px rgba(0,0,0,0.1), 0 32px 64px -48px rgba(0,0,0,0.5);
    z-index: 1000;
    transition: all 0.15s ease;
    margin-left: 35px;
}

body.show-chatbot .chatbot-popup {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

/* ===============================
   HEADER
================================ */
.chat-header {
    display: flex;
    align-items: center;
    background: #f9966f;
    padding: 3px 22px;
    justify-content: space-between;
}

    .chat-header .header-info {
        display: flex;
        gap: 10px;
        align-items: center;
    }

.header-info .chatbot-logo {
    height: 35px;
    width: 35px;
    padding: 6px;
    fill: #f9966f;
    flex-shrink: 0;
    background: #fff;
    border-radius: 50%;
}

.header-info .logo-text {
    color: #fff;
    font-weight: 600;
}

.chat-header #close-chatbot {
    border: none;
    color: #fff;
    height: 40px;
    width: 40px;
    font-size: 1.9rem;
    margin-right: -10px;
    padding-top: 2px;
    cursor: pointer;
    border-radius: 50%;
    background: none;
    transition: 0.2s ease;
    padding: 0px !important;
    margin-bottom: 0px !important;
}

    .chat-header #close-chatbot:hover {
        background: #f27c4f;
    }

/* ===============================
   CHAT BODY
================================ */
.chat-body {
    padding: 25px 22px;
    display: flex;
    gap: 20px;
    height: 460px;
    margin-bottom: 82px;
    overflow-y: auto;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: #f9a07a transparent;
}

    .chat-body .message {
        display: flex;
        gap: 11px;
        align-items: center;
    }

    .chat-body .bot-message .bot-avatar {
        height: 60px;
        width: 60px;
        padding: 6px;
        fill: #fff;
        flex-shrink: 0;
        margin-bottom: 2px;
        align-self: flex-end;
        background: #f9966f;
        border-radius: 50%;
    }

    .chat-body .message .message-text {
        padding: 12px 16px;
        max-width: 75%;
        font-size: 0.95rem;
        background: #fff5f0;
    }

    .chat-body .bot-message .message-text {
        border-radius: 13px 13px 13px 3px;
    }

    .chat-body .user-message {
        flex-direction: column;
        align-items: flex-end;
    }

        .chat-body .user-message .message-text {
            color: #fff;
            background-color: #f9966f;
            border-radius: 13px 13px 3px 13px;
        }

    /* ===============================
   THINKING DOTS
================================ */
    .chat-body .bot-message .thinking-indicator {
        display: flex;
        gap: 4px;
        padding-block: 15px;
    }

        .chat-body .bot-message .thinking-indicator .dot {
            height: 7px;
            width: 7px;
            opacity: 0.7;
            border-radius: 50%;
            background: #f9966f;
            animation: dotPulse 1.8s ease-in-out infinite;
        }

@keyframes dotPulse {
    0%, 44% {
        transform: translateY(0);
    }

    28% {
        opacity: 0.4;
        transform: translateY(-4px);
    }

    44% {
        opacity: 0.2;
    }
}

/* ===============================
   FOOTER
================================ */
.chat-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: white;
    padding: 15px 22px 20px;
}

    .chat-footer .chat-form {
        display: flex;
        align-items: center;
        background: white;
        border-radius: 32px;
        outline: 1px solid #cccce5;
    }

        .chat-footer .chat-form:focus-within {
            outline: 2px solid #f9966f;
        }

.chat-form .message-input {
    border: none;
    outline: none;
    height: 47px;
    width: 100%;
    resize: none;
    max-height: 180px;
    font-size: 1rem;
    padding: 13px;
    border-radius: inherit;
}

.chat-form .chat-controls {
    display: flex;
    height: 47px;
    gap: 3px;
    align-items: center;
    padding-right: 6px;
}

    .chat-form .chat-controls button {
        height: 35px;
        width: 35px;
        border: none;
        font-size: 1.15rem;
        cursor: pointer;
        color: #f27c4f;
        background: none;
        border-radius: 50%;
        transition: 0.2s ease;
        padding: 0px !important;
        margin-bottom: 0px !important;
    }

    .chat-form .chat-controls #send-message {
        color: #fff;
        display: none;
        background: #f9966f;
    }

.chat-form .message-input:valid ~ .chat-controls #send-message {
    display: block;
}

.chat-form .chat-controls #send-message:hover {
    background: #f27c4f;
}
