/* General styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.chat-container {
    display: flex;
    width: 100%;
    height: 100%;
    max-width: 1600px;
    margin: 0 auto;
    box-shadow: 0 0 25px rgba(0,0,0,0.05);
}

/* Sidebar */
.sidebar {
    width: 240px;
    background-color: #ffffff;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    transition: transform 0.3s ease;
}



.sidebar.hidden {
    display: none;
}

#menu-button {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

#user-list, #file-list {
    margin-bottom: 20px;
}

#user-list h2, #file-list h2 {
    font-size: 16px;
    color: #333;
    margin-top: 0;
}

#users, #uploaded-files {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
}

#users li, #uploaded-files li {
    padding: 5px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#uploaded-files a {
    color: #007bff;
    text-decoration: none;
}

#uploaded-files a:hover {
    text-decoration: underline;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #e5ddd5;
    background-image: url('https://www.transparenttextures.com/patterns/subtle-dots.png');
    position: relative; /* Add this for positioning context */
    padding-top: 50px; /* Add padding to the top */
}

#chat-box {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.input-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #f0f2f5;
    border-top: 1px solid #ddd;
}

.chat-input {
    display: flex;
    align-items: center;
    flex: 1;
}

.file-upload-container {
    display: flex;
    align-items: center;
}

#username-display {
    font-weight: bold;
    margin-right: 10px;
}

#message-input {
    flex: 1;
    border: 1px solid #ccc;
    border-radius: 18px;
    padding: 10px 15px;
    font-size: 14px;
    resize: none;
    overflow-y: hidden;
    line-height: 1.4;
}

#message-input:focus {
    outline: none;
}

.chat-input button {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.chat-input button:hover {
    background-color: #0056b3;
}

.chat-input button svg {
    width: 20px;
    height: 20px;
}

.file-upload-container {
    padding: 10px 20px;
    background-color: #f0f2f5;
    display: flex;
    align-items: center;
}

#file-upload-form {
    display: flex;
    align-items: center;
}

#file-input {
    border: 1px solid #ccc;
    border-radius: 18px;
    padding: 8px 12px;
    font-size: 14px;
}

.file-upload-container button {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 18px;
    padding: 8px 15px;
    margin-left: 10px;
    cursor: pointer;
    font-size: 14px;
}

/* Chat Messages */
.chat-message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.chat-message .username {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.chat-message .message-content {
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 70%;
    word-wrap: break-word;
}

.chat-message.sent {
    align-items: flex-end;
}

.chat-message.sent .message-content {
    background-color: #dcf8c6;
    color: #333;
}

.chat-message.received {
    align-items: flex-start;
}

.chat-message.received .message-content {
    background-color: #ffffff;
    color: #333;
}

.chat-message.system {
    align-items: center;
    font-size: 12px;
    color: #888;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #ddd;
    }

    .chat-area {
        padding-top: 10px;
    }

    #menu-button {
        top: 5px;
        left: 5px;
    }

    .input-area {
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
    }

    .chat-input, .file-upload-container {
        width: 100%;
        padding: 0;
        box-sizing: border-box;
    }

    .file-upload-container {
        margin-top: 10px;
        justify-content: center;
    }

    #file-upload-form {
        width: 100%;
        justify-content: center;
    }
}

