/* General Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background: #1e1e1e;
    color: #ffffff;
}

/* Full-screen layout */
#container {
    display: flex;
    height: 100vh;
    flex-direction: row;
}

/* Sidebar */
#sidebar {
    width: 20%;
    background: #121212;
    padding: 15px;
    overflow-y: auto;
    border-right: 1px solid #2a2a2a;
    display: flex;
    flex-direction: column;
    transition: 0.3s ease-in-out;
}

/* Adjust Sidebar for Small Screens */
@media (max-width: 768px) {
    #sidebar {
        width: 100%;
        height: auto;
        position: fixed;
        bottom: 0;
        left: 0;
        z-index: 10;
        border-right: none;
        border-top: 1px solid #2a2a2a;
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        padding: 10px;
    }

    #chat-history-list {
        flex-direction: row;
        display: flex;
        width: 100%;
        overflow-x: auto;
    }

    #chat-history-list li {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 8px 12px;
        margin: 3px;
        font-size: 12px;
    }

    #new-chat {
        padding: 10px;
        font-size: 12px;
    }
}

/* Sidebar Heading */
#sidebar h2 {
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 10px;
    text-align: left;
}

/* New Chat Button */
#new-chat {
    background: #2b2b2b;
    color: #ffffff;
    border: 1px solid #333;
    padding: 12px;
    margin-bottom: 15px;
    cursor: pointer;
    width: 100%;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    transition: 0.3s ease;
}

#new-chat:hover {
    background: #444;
}

/* Chat History */
#chat-history-list {
    list-style: none;
    padding: 0;
    width: 100%;
    flex-grow: 1;
    overflow-y: auto;
}

#chat-history-list li {
    background: #1e1e1e;
    padding: 10px;
    margin: 5px 0;
    cursor: pointer;
    border-radius: 8px;
    border: 1px solid #2a2a2a;
    text-align: left;
    font-size: 14px;
    color: #d1d1d1;
    transition: 0.3s ease;
}

#chat-history-list li:hover {
    background: #333;
    color: #ffffff;
}

/* Chat Area */
#chat-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: #1e1e1e;
    padding: 20px;
    overflow: hidden;
    justify-content: center;
    align-items: center;
    transition: 0.3s ease-in-out;
}

/* Adjust Chat Area for Small Screens */
@media (max-width: 768px) {
    #chat-area {
        width: 100%;
        height: calc(100vh - 60px);
        padding: 10px;
    }
}

/* Chat Box */
#chat-box {
    width: 80%;
    height: 70vh;
    overflow-y: auto;
    border-radius: 8px;
    padding: 15px;
    background: #121212;
    display: flex;
    flex-direction: column;
    transition: 0.3s ease-in-out;
}

/* Adjust Chat Box for Smaller Screens */
@media (max-width: 768px) {
    #chat-box {
        width: 100%;
        height: 60vh;
    }
}

@media (max-width: 480px) {
    #chat-box {
        height: 55vh;
    }
}

/* Messages */
.message {
    max-width: 75%;
    padding: 12px 16px;
    margin: 8px 0;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    display: inline-block;
    transition: 0.3s ease-in-out;
}

.user {
    background: #495866;
    color: white;
    align-self: flex-end;
    text-align: right;
    border-bottom-right-radius: 5px;
}

.bot {
    background: #2a2a2a;
    color: #ffffff;
    align-self: flex-start;
    text-align: left;
    border-bottom-left-radius: 5px;
}

/* Input Area */
#input-area {
    display: flex;
    width: 80%;
    padding: 15px;
    background: #121212;
    border-top: 1px solid #2a2a2a;
    position: sticky;
    bottom: 0;
    border-radius: 8px;
    transition: 0.3s ease-in-out;
}

/* Adjust Input Area for Smaller Screens */
@media (max-width: 768px) {
    #input-area {
        width: 100%;
        padding: 10px;
    }
}

/* Input Box */
input {
    flex-grow: 1;
    padding: 12px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #1e1e1e;
    color: white;
    font-size: 14px;
    transition: 0.3s ease-in-out;
}

/* Adjust Input Box for Smaller Screens */
@media (max-width: 480px) {
    input {
        font-size: 12px;
        padding: 10px;
    }
}

/* Send Button */
button {
    padding: 12px;
    margin-left: 10px;
    border: none;
    background: #495866;
    color: white;
    cursor: pointer;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    transition: 0.3s ease;
}

/* Adjust Button for Smaller Screens */
@media (max-width: 480px) {
    button {
        padding: 10px;
        font-size: 12px;
    }
}

button:hover {
    background: #006acc;
}
