﻿/* ==========================================
   Floating Button
========================================== */
.chat-toggle {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg,#ff7b00,#ff4d00);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 26px;
    cursor: pointer;
    z-index: 999999;
    box-shadow: 0 10px 30px rgba(255,123,0,.35);
    transition: all .3s ease;
}

    .chat-toggle:hover {
        transform: scale(1.08);
    }


/* ==========================================
   Chat Window
========================================== */
.chat-window {
    position: fixed;
    right: 20px;
    bottom: 95px;
    width: 370px;
    max-width: calc(100vw - 20px);
    height: 560px;
    max-height: calc(100vh - 120px);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 999999;
    background: rgba(255,255,255,.96);
    border: 1px solid #dfe4ea;
    border-radius: 22px;
    box-shadow: 0 20px 60px rgba(0,0,0,.18), 0 0 0 3px rgba(255,255,255,.8);
}


/* ==========================================
   Header
========================================== */
.chat-header {
    background: linear-gradient(135deg,#ff7b00,#ff4d00);
    color: white;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bot-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 17px;
}

.title {
    font-size: 16px;
    font-weight: 600;
}

.online {
    font-size: 11px;
    opacity: .95;
}

    .online i {
        color: #00ff66;
        font-size: 9px;
        margin-right: 4px;
    }

.chat-header span {
    cursor: pointer;
    font-size: 20px;
}


/* ==========================================
   Body
========================================== */
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: #f6f8fb;
    scroll-behavior: smooth;
}


    /* Scrollbar */
    .chat-body::-webkit-scrollbar {
        width: 6px;
    }

    .chat-body::-webkit-scrollbar-thumb {
        background: #d2d7dd;
        border-radius: 20px;
    }


/* ==========================================
   Bot Message
========================================== */
.bot-msg {
    background: #fff;
    color: #333;
    font-size: 13px;
    line-height: 1.5;
    padding: 10px 12px;
    margin-bottom: 8px;
    max-width: 85%;
    border-radius: 15px 15px 15px 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    animation: fadeUp .25s ease;
}


/* ==========================================
   User Message
========================================== */
.user-msg {
    background: linear-gradient(135deg,#ff7b00,#ff4d00);
    color: white;
    font-size: 13px;
    line-height: 1.5;
    padding: 10px 12px;
    margin-bottom: 8px;
    width: fit-content;
    max-width: 85%;
    margin-left: auto;
    border-radius: 15px 15px 5px 15px;
    animation: fadeUp .25s ease;
}


/* ==========================================
   Module Area
========================================== */
.module-area {
    margin-top: 10px;
}


/* ==========================================
   Module Button
========================================== */
.module-btn {
    width: 100%;
    border: none;
    background: white;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,.05);
    transition: all .25s ease;
}

    .module-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 20px rgba(255,123,0,.15);
    }

    .module-btn i {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        background: linear-gradient(135deg,#ff7b00,#ff4d00);
        color: white;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 15px;
    }

    .module-btn div {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .module-btn span {
        font-size: 13px;
        font-weight: 600;
        color: #333;
    }

    .module-btn small {
        font-size: 11px;
        color: #7d8790;
        margin-top: 2px;
    }


/* ==========================================
   Footer
========================================== */
.chat-footer {
    background: white;
    border-top: 1px solid #eceff3;
    display: flex;
    align-items: center;
}

    .chat-footer input {
        flex: 1;
        border: none;
        outline: none;
        padding: 12px 14px;
        font-size: 13px;
        background: transparent;
    }

        .chat-footer input::placeholder {
            color: #9aa3ab;
        }

    .chat-footer button {
        width: 55px;
        border: none;
        background: linear-gradient(135deg,#ff7b00,#ff4d00);
        color: white;
        cursor: pointer;
        font-size: 17px;
        transition: .3s;
        padding: 12px 1px;
    }

        .chat-footer button:hover {
            opacity: .9;
        }




.module-chip {
    background: #fff4e8;
    color: #ff6b00;
    border: 1px solid #ffd2a8;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}


.sticky-module-bar {
    position: sticky;
    top: 0;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid #ececec;
    z-index: 100;
}

.top-module {
    border: none;
    background: #f5f5f5;
    color: #555;
    padding: 4px 7px;
    border-radius: 25px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 11px;
    transition: .25s;
}

    .top-module:hover {
        background: #ff6b00;
        color: white;
    }

.active-module {
    background: linear-gradient(135deg,#ff7b00,#ff4500);
    color: white;
}

/* ==========================================
   Animation
========================================== */
@keyframes fadeUp {

    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}



.suggestion-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 12px;
}

.suggestion-btn {
    border: 1px solid #ffb36b;
    background: #fff7ef;
    color: #ff6b00;
    border-radius: 20px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: .25s;
}

    .suggestion-btn:hover {
        background: #ff6b00;
        color: white;
    }





    .typing-msg {
        background: #fff;
        padding: 12px 15px;
        border-radius: 15px 15px 15px 5px;
        display: inline-flex;
        gap: 5px;
        margin-bottom: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,.05);
    }

    .typing-msg span {
        width: 8px;
        height: 8px;
        background: #999;
        border-radius: 50%;
        animation: typingBounce 1.4s infinite;
    }

    .typing-msg span:nth-child(2) {
        animation-delay: .2s;
    }

    .typing-msg span:nth-child(3) {
        animation-delay: .4s;
    }

    @keyframes typingBounce {

        0%,60%,100% {
            transform: translateY(0);
            opacity: .4;
        }

        30% {
            transform: translateY(-5px);
            opacity: 1;
        }
    }

.chat-header {
    cursor: move;
    user-select: none;
}


/* ==========================================
   Mobile
========================================== */
@media(max-width:768px) {

    .chat-window {
        width: 95%;
        height: 82vh;
        right: 2.5%;
        bottom: 85px;
    }

    .chat-toggle {
        right: 15px;
        bottom: 15px;
    }
}
