﻿/* chatbot.css - Modern Green Chatbot */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

/*#aiChatButton {
    position: fixed;
    right: 25px;
    bottom: 25px;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg,#198754,#22c55e);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99999;
    transition: .3s;
    box-shadow: 0 10px 25px rgba(0,0,0,.25)
}*/

#aiChatButton {
    position: fixed;
    right: 25px;
    bottom: 25px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: transparent; /* Remove green background if image already has one */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99999;
    transition: .3s;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,.25);
}

    #aiChatButton:hover {
        transform: scale(1.08);
    }

    #aiChatButton img {
        width: 100%;
        height: 100%;
        object-fit: contain; /* or cover */
        display: block;
    }
    /*#aiChatButton img {
        width: 38px;
        height: 38px
    }*/

/*#aiChatWindow {
    position: fixed;
    right: 20px;
    bottom: 90px;*/

    /* Responsive Width */
    /*width: clamp(300px, 30vw, 420px);*/

    /* Responsive Height */
    /*height: clamp(420px, 75vh, 700px);

    background: #fff;
    border-radius: 20px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(0,0,0,.25);
    z-index: 99999;
    transition: all .3s ease;
}*/

#aiChatWindow {
    position: fixed;
    right: 20px;
    bottom: 90px;
    /* Responsive Width */
    width: clamp(300px, 30vw, 420px);
    /* Responsive Height */
    height: clamp(420px, 75vh, 700px);
    background: #fff;
    border-radius: 20px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(0,0,0,.25);
    z-index: 99999;
    transition: all .3s ease;
}


.chat-header {
    height: 72px;
    background: linear-gradient(135deg,#198754,#22c55e);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    color: #fff;
    flex-shrink: 0;
}

    .chat-header .left {
        display: flex;
        align-items: center;
        gap: 10px
    }

    .chat-header img {
        width: 46px;
        height: 46px;
        border-radius: 50%;
        background: #fff;
        padding: 5px
    }

    .chat-header h4 {
        font-size: 16px
    }

    .chat-header span {
        font-size: 12px;
        opacity: .9
    }

#btnClose {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    border-radius: 50%;
}

    #btnClose:hover {
        background: rgba(255,255,255,.2)
    }

#chatMessages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f0fff4;
    scroll-behavior: smooth;
}

    #chatMessages p,
    #chatMessages ul,
    #chatMessages ol {
        margin: 0 0 8px 0;
    }

    #chatMessages li {
        margin: 4px 0;
        line-height: 1.4;
    }

.user-message,
.bot-message {
    max-width: 85%;
    padding: 12px 15px;
    line-height: 1.5;
    font-size: 14px;
    word-break: break-word;
    white-space: pre-wrap;
    animation: fade .25s;
}

.user-message {
    align-self: flex-end;
    background: #198754;
    color: #fff;
    border-radius: 18px 18px 4px 18px;
}

.bot-message {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #d8e9dc;
    color: #333;
    border-radius: 18px 18px 18px 4px;
}

.typing {
    display: flex;
    gap: 5px;
    padding: 10px 14px;
    background: #fff;
    border-radius: 20px;
    width: max-content;
    border: 1px solid #d8e9dc;
}

    .typing span {
        width: 8px;
        height: 8px;
        background: #198754;
        border-radius: 50%;
        animation: typing 1s infinite;
    }

        .typing span:nth-child(2) {
            animation-delay: .2s
        }

        .typing span:nth-child(3) {
            animation-delay: .4s
        }

@keyframes typing {
    0%,100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-5px)
    }
}

@keyframes fade {
    from {
        opacity: 0;
        transform: translateY(8px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

.chat-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid #ddd;
    background: #fff;
    flex-shrink: 0;
}

#txtMessage {
    flex: 1;
    height: 46px;
    padding: 0 15px;
    border: 1px solid #ccc;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
}

    #txtMessage:focus {
        border-color: #22c55e;
        box-shadow: 0 0 0 3px rgba(34,197,94,.15);
    }

#btnSend {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: #198754;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: .3s;
}

    #btnSend:hover {
        background: #157347;
        transform: scale(1.05)
    }

#chatMessages::-webkit-scrollbar {
    width: 8px
}

#chatMessages::-webkit-scrollbar-track {
    background: #dff5e4
}

#chatMessages::-webkit-scrollbar-thumb {
    background: #22c55e;
    border-radius: 20px
}

#chatMessages {
    scrollbar-width: thin;
    scrollbar-color: #22c55e #dff5e4
}

@media(max-width:768px) {
    #aiChatWindow {
        left: 10px;
        right: 10px;
        width: auto;
        height: 82vh;
        bottom: 90px;
    }

    #aiChatButton {
        right: 18px;
        bottom: 18px;
        width: 60px;
        height: 60px;
    }

    .user-message, .bot-message {
        max-width: 92%
    }
}
