﻿/* =========================================================
   ELDER LABORATORIES — CHATBOT
   ========================================================= */

.elder-chatbot {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 9999;
    font-family: "DM Sans", sans-serif;
}


/* =========================================================
   FLOATING BUTTON
   ========================================================= */

.elder-chatbot-toggle {
    width: 62px;
    height: 62px;
    border: none;
    border-radius: 50%;
    background: linear-gradient( 135deg, #234e86, #176f9f );
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(35, 78, 134, 0.30), 0 4px 12px rgba(0, 0, 0, 0.10);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}


    .elder-chatbot-toggle:hover {
        transform: translateY(-4px) scale(1.04);
        box-shadow: 0 18px 38px rgba(35, 78, 134, 0.35), 0 6px 16px rgba(0, 0, 0, 0.12);
    }


.chatbot-icon {
    font-size: 27px;
    line-height: 1;
}


/* =========================================================
   CHAT WINDOW
   ========================================================= */

.elder-chatbot-window {
    position: absolute;
    right: 0;
    bottom: 78px;
    width: 370px;
    max-width: calc(100vw - 40px);
    height: 520px;
    background: #ffffff;
    border-radius: 22px;
    border: 1px solid rgba(35, 78, 134, 0.12);
    box-shadow: 0 25px 70px rgba(15, 55, 95, 0.22), 0 8px 25px rgba(15, 55, 95, 0.10);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(18px) scale(0.96);
    transform-origin: bottom right;
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}


/* OPEN STATE */

.elder-chatbot.open .elder-chatbot-window {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}


/* =========================================================
   HEADER
   ========================================================= */

.elder-chatbot-header {
    min-height: 78px;
    padding: 15px 18px;
    background: linear-gradient( 135deg, #234e86, #176f9f );
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}


.elder-chatbot-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}


.elder-chatbot-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 auto;
}

    .elder-chatbot-avatar img {
        width: 27px;
        height: 27px;
        object-fit: contain;
        display: block;
    }


.elder-chatbot-brand strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.1px;
}


.elder-chatbot-brand span {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.78);
}


.elder-chatbot-close {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease, transform 0.25s ease;
}


    .elder-chatbot-close:hover {
        background: rgba(255, 255, 255, 0.20);
        transform: rotate(90deg);
    }


/* =========================================================
   MESSAGE AREA
   ========================================================= */

.elder-chatbot-messages {
    flex: 1;
    padding: 20px 16px;
    overflow-y: auto;
    background: linear-gradient( 180deg, #f7fbff 0%, #ffffff 55% );
}


    .elder-chatbot-messages::-webkit-scrollbar {
        width: 5px;
    }


    .elder-chatbot-messages::-webkit-scrollbar-thumb {
        background: #c7dced;
        border-radius: 10px;
    }


/* =========================================================
   BOT MESSAGE
   ========================================================= */

.elder-chatbot-message {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 15px;
}


.message-avatar {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #d8e8f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(35, 78, 134, 0.12);
}

    .message-avatar img {
        width: 22px;
        height: 22px;
        object-fit: contain;
        display: block;
    }


.message-content {
    max-width: 78%;
    padding: 11px 14px;
    background: #ffffff;
    border: 1px solid #e1edf5;
    border-radius: 4px 15px 15px 15px;
    box-shadow: 0 4px 12px rgba(35, 78, 134, 0.06);
}


    .message-content p {
        margin: 0;
        color: #38516b;
        font-size: 13px;
        line-height: 1.55;
    }


        .message-content p + p {
            margin-top: 5px;
        }


/* =========================================================
   QUICK ACTIONS
   ========================================================= */

.elder-chatbot-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: 39px;
    margin-top: 4px;
}


    .elder-chatbot-quick-actions button {
        border: 1px solid #cfe1ee;
        background: #ffffff;
        color: #234e86;
        border-radius: 20px;
        padding: 8px 12px;
        font-family: "DM Sans", sans-serif;
        font-size: 11px;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
    }


        .elder-chatbot-quick-actions button:hover {
            background: #234e86;
            border-color: #234e86;
            color: #ffffff;
            transform: translateY(-1px);
        }


/* =========================================================
   INPUT AREA
   ========================================================= */

.elder-chatbot-input-area {
    min-height: 68px;
    padding: 12px 14px;
    background: #ffffff;
    border-top: 1px solid #e5eef5;
    display: flex;
    align-items: center;
    gap: 8px;
}


    .elder-chatbot-input-area input {
        flex: 1;
        height: 42px;
        padding: 0 14px;
        border: 1px solid #d8e6f0;
        border-radius: 22px;
        outline: none;
        font-family: "DM Sans", sans-serif;
        font-size: 13px;
        color: #29445e;
        background: #f9fcff;
        transition: border-color 0.25s ease, box-shadow 0.25s ease;
    }


        .elder-chatbot-input-area input:focus {
            border-color: #6ca8ca;
            box-shadow: 0 0 0 3px rgba(35, 78, 134, 0.08);
        }


        .elder-chatbot-input-area input::placeholder {
            color: #9aaebe;
        }


    .elder-chatbot-input-area button {
        flex: 0 0 auto;
        width: 42px;
        height: 42px;
        border: none;
        border-radius: 50%;
        background: #234e86;
        color: #ffffff;
        font-size: 17px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.25s ease, background 0.25s ease;
    }


        .elder-chatbot-input-area button:hover {
            background: #176f9f;
            transform: translateX(2px);
        }


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 576px) {

    .elder-chatbot {
        right: 16px;
        bottom: 18px;
    }


    .elder-chatbot-toggle {
        width: 56px;
        height: 56px;
    }


    .elder-chatbot-window {
        right: 0;
        bottom: 70px;
        width: calc(100vw - 32px);
        max-width: none;
        height: min(520px, calc(100vh - 110px));
        border-radius: 20px;
    }


    .elder-chatbot-header {
        min-height: 70px;
    }
}

/* =========================================
   CHATBOT FLOATING BUTTON POSITION
   ========================================= */

.elder-chatbot-toggle {
    right: 24px !important;
    bottom: 24px !important;
}

/* =========================================
   MOVE CHATBOT CONTAINER
   ========================================= */

.elder-chatbot {
    right: 15px !important;
    bottom: 80px !important;
}

/* =========================================
   CHATBOT CATEGORY LIST
   ========================================= */

.elder-chatbot-category-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 12px 0 15px 39px;
}


.elder-chatbot-category-button {
    width: calc(100% - 39px);
    padding: 9px 13px;
    border: 1px solid #d6e5f0;
    border-radius: 10px;
    background: #ffffff;
    color: #234e86;
    font-family: "DM Sans", sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}


    .elder-chatbot-category-button:hover {
        background: #234e86;
        border-color: #234e86;
        color: #ffffff;
        transform: translateX(3px);
        box-shadow: 0 5px 14px rgba(35, 78, 134, 0.15);
    }