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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f4f4;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    height: 100%;
    overflow: auto;
    margin: 0;
}

.chat-container {
    width: 400px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    max-height: 600px;
    min-height: 500px;
    height: 100%;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.chat-header {
    background-color: #007BFF;
    color: white;
    padding: 16px;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
    text-transform: capitalize;
    letter-spacing: 0.5px;
}

.chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f9f9f9;
    border-radius: 10px;
    margin: 10px;
    position: relative;
    font-size: 16px;
    max-height: calc(100% - 160px);
    animation: fadeIn 0.5s ease-in-out;
}

.chat-messages::-webkit-scrollbar {
    display: none;
}

.chat-messages {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.message {
    max-width: 75%;
    margin-bottom: 12px;
    padding: 12px 16px;
    border-radius: 15px;
    line-height: 1.6;
    word-wrap: break-word;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.message ul {
    margin-left: 20px;
    margin-top: 20px;
    margin-bottom: 10px;
    list-style-type: disclosure-closed;
}

.from-user {
    background-color: #007BFF;
    color: white;
    align-self: flex-end;
    margin-left: auto;
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 15px;
}

.from-bot {
    background-color: #E5E5E5;
    color: #333;
    align-self: flex-start;
    margin-right: auto;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 15px;
}

.chat-input-area {
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f4f4f4;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
}

#chat-input {
    width: 70%;
    padding: 12px;
    border-radius: 20px;
    border: 1px solid #ccc;
    resize: none;
    font-size: 16px;
    margin-right: 15px;
    background-color: #fff;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.4;
}

#chat-input:focus {
    border-color: #007BFF;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.6);
}

#send-message {
    background-color: #007BFF;
    color: white;
    border: none;
    padding: 16px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    width: 25%;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#send-message:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

@media (max-width: 420px) {
    body {
        justify-content: flex-start;
        height: 100%;
        overflow: auto;
    }

    .chat-container {
        width: 100%;
        height: 90vh;
        max-height: none;
        border-radius: 0;
        box-shadow: none;
    }

    .chat-header {
        font-size: 16px;
        padding: 12px;
    }

    .chat-messages {
        padding: 12px;
    }

    #chat-input {
        width: 65%;
    }

    #send-message {
        padding: 16px 14px;
        font-size: 16px;
    }
}

span.typing-indicator {
    display: inline-block;
    font-size: 16px;
    color: #007BFF;
    font-style: italic;
    animation: typingAnimation 1.5s steps(5, end) infinite;
}

@keyframes typingAnimation {
    0% {
        content: '';
    }
    20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60% {
        content: '...';
    }
    80% {
        content: '..';
    }
    100% {
        content: '.';
    }
}

code {
    margin: 1rem 0;
    display: block;
    background-color: #bcbcbc80;
    color: #241e1e;
    padding: 1rem;
    border-radius: 5px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.botName {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
}

.botName::after {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #4dbd4d;
    margin-left: 10px;
    position: relative;
    top: 3px;
}

.message-content h3 {
    margin: 1rem 0;
}

strong {
    margin-top: 1rem;
}

.message-time {
    font-size: 12px;
    color: #aaa;
    margin-top: 5px;
    display: block;
    text-align: right;
    font-weight: 500;
}

.message p {
    margin-bottom: 16px;
}

.disclaimer {
    position: absolute;
    right: 10px;
    top: 20%;
    transform: translateY(-50%);
    width: 30px;
    z-index: 99;
}

.disclaimer img {
    width: 100%;
}