/* Chatbot container */
#chatbot-container {

     padding: 1.25rem;
     font-family: Arial, sans-serif;
     position: fixed;
     right: 1rem;
     top: 14.5rem;
     height: 36vw;
     width: 19.5vw;
     max-width: 90vw;
     padding: 1.25rem;
     z-index: 1000;
     overflow: hidden;
     box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.1);
     background-color: white;
     border-radius: 0.5rem;
     border: 0.1rem solid rgb(223, 223, 223);
}
#chatbot-container .header-colour {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4.5rem;
    background: #622388;
background: linear-gradient(90deg, rgba(98, 35, 136, 1) 0%, rgba(77, 43, 122, 1) 61%, rgba(62, 37, 111, 1) 100%);
    z-index: -1;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

.chat-header .chatbot-title {
    margin: 0;
    font-size: 1.5rem;
}


.star-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    opacity: 0.8;
    pointer-events: none;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 1em;
    font-size: 1rem;   
    margin-right: 2.7em; 
}

.chat-header #chatbot-close-btn{
    border: none;
    color: #fff;
    background: transparent;
    height: 1em;
    width: 1em;
    border-radius: 50%;
    font-size: 1.9rem;
    top: 0.2em;
    right: 0.4em;
    position: absolute;
    cursor: pointer;
}
.chat-header #chatbot-close-btn:hover{
    background: #fff;
    color: #622388;
    transition: 0.3s;
}
.chatbot-icon {
    height: 2.5em;
    width: auto;
    margin-right: 0.7em;
    vertical-align: middle;
}

.chat-messages {
    position: absolute;
    top: 3.3em; 
    bottom: 5em; 
    left: 0;
    right: 0;
    overflow-y: auto;
    padding: 0.8em 1em;
    width: 100%;
    box-sizing: border-box;
    background: transparent;
}




/* Messages */
.message {
    margin: 0.5em 0;
    padding: 0.7em 1em;
    border-radius: 1em;
    max-width: 95%;
    word-break: break-word;
    box-sizing: border-box;
    line-height: 1.5;
}

.bot-message ul,
.bot-message ol {
    margin: 0.5em 0 0.5em 1.2em;
    padding: 0;
}

.bot-message li {
    margin-bottom: 0.3em;
    padding-left: 0.2em;
    font-size: 1em;
}

.bot-message p {
    margin: 0.3em 0;
}

.user-message {
    background: #622388;
    align-self: flex-end;
    text-align: right;
    margin-left: auto;
    font-size: 1rem;
    color: #fff;
}

.bot-message {
    background: #4D2B7A;
    align-self: flex-start;
    text-align: left;
    margin-right: auto;
    font-size: 1rem;
    color: white;
}

.typing-indicator {
    display: inline-block;
    font-size: 1.2em;
    letter-spacing: 0.15em;
    color: #fff;
    position: relative;
    padding: 0.3em 0.4em;
}

.typing-indicator::after {
    content: '...';
    animation: blinkDots 1s steps(3, end) infinite;
}

@keyframes blinkDots {
    0%, 100% { color: #fff; opacity: 1; }
    50% { color: #fff; opacity: 0.3; }
}

/* Input and button */
.chat-input {
    position: absolute;
    bottom: 0;
    width: 100%;    
    background: #f5f4f4;
    padding: 1.5em 1.5em;
    right: 0;
    border-top: 0.1em solid #e2e2e2;
    box-shadow: rgba(0, 0, 0, 0.1) 0 0.5em 1.5em;

}
.chat-input .chatbot-user-input{
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 0.7em;
    outline: 0.1em solid #CCCCE5;
    
 
}

.chatbot-user-input .message-input{
    border: none;
    outline: none;
    height: auto;
    width: 90%;
    font-size: 1rem;
    padding: 0.5em;
    border-radius: inherit;
    font-size: 0.95rem;
    resize: none;
    overflow: hidden;
    margin-right:2.8em;
}




.chatbot-user-input #sendButton {
    background: #412571;
    border: none;
    color: white;
    padding: 0.4em;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    margin-left: 12%;
    position: fixed;
}
.chatbot-user-input #sendButton:hover {
    background: #622388;
}

/* Responsive design */
@media (max-width: 600px) {
    #chatbot-container {
        width: 98vw;
        height: 70vh;
        right: 1vw;
        top: 10vh;
        padding: 0.5em;
        border-radius: 0.3em;
    }
    .chat-header {
        font-size: 1em;
        padding: 0.5em;
    }
    .chat-messages {
        top: 4em;
        bottom: 6em;
        padding: 0.5em 0.5em;
        font-size: 0.95em;
    }
    .chat-input {
        padding: 0.7em 0.7em;
    }
    .chatbot-user-input .message-input {
        font-size: 0.9em;
        padding: 0.4em;
        margin-right: 2em;
    }
    .chatbot-user-input #sendButton {
        font-size: 1.2rem;
        margin-left: 0.5em;
        position: static;
    }
    .message {
        padding: 0.5em 0.7em;
        font-size: 0.95em;
    }
}

@media (max-width: 400px) {
    #chatbot-container {
        width: 100vw;
        height: 90vh;
        right: 0;
        top: 5vh;
        padding: 0.2em;
    }
    .chat-header {
        font-size: 0.9em;
    }
    .chat-messages {
        font-size: 0.9em;
    }
    .chat-input {
        padding: 0.4em 0.4em;
    }
}

@media (max-width: 1500px) and (min-width: 901px) {
    #chatbot-container {
        width: 30vw;
        height: 85vh;
        right: 2vw;
        top: 10vh;
    }
    .chat-header {
        font-size: 1.2em;
    }
    .chat-messages {
        font-size: 1.1em;
    }
    .chat-input {
        padding: 1em 1em;
    }
    .chatbot-user-input #sendButton {
        font-size: 1.3rem;
        margin-left: 0.5em;
        position: static;
    }
    
}

@media (max-width: 900px) and (min-width: 601px) {
    #chatbot-container {
        width: 45vw;
        height: 80vh;
        right: 2vw;
        top: 10vh;
    }
    .chat-header {
        font-size: 1.2em;
    }
    .chat-messages {
        font-size: 1.1em;
    }
    .chat-input {
        padding: 1em 1em;
    }
    .chatbot-user-input #sendButton {
        font-size: 1.3rem;
        margin-left: 0.5em;
        position: static;
    }
}

@media (max-height: 500px) {
    #chatbot-container {
        height: 50vh;
        top: 25vh;
    }
    .chat-messages {
        top: 3em;
        bottom: 4em;
    }
    .chat-input {
        padding: 1em 1em;
    }
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 0.5em;
}
.chat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 0.25em;
}
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
