/* General Body and Font Settings */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    overflow-x: hidden; /* Prevent horizontal overflow */
}

/* Messages container to display chat and sidebar side by side */
.messages-container {
    display: flex;
    height: 100vh;
    background-color: var(--background-color);
}

/* Sidebar Configuration */
.sidebar {
    width: 300px;
    background-color: var(--background-color);
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    padding: 20px;
    overflow-y: auto;
}

/* Sidebar Button */
.sidebar button {
    width: 100%;
    padding: 10px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    margin-bottom: 20px;
    cursor: pointer;
}

.sidebar button:hover {
    background-color: var(--secondary-color);
}

/* Sidebar User List */
.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar .user {
    display: flex;
    align-items: center;
    padding: 10px 0;
    cursor: pointer;
    border-bottom: 1px solid #ddd;
    background-color: var(--background-color);
}

.sidebar .user:hover {
    background-color: var(--hover-color);
}

.sidebar .user img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.sidebar .user .user-name {
    font-weight: bold;
}

/* Chat Window */
.chat-window {
    flex-grow: 1; /* Takes up the remaining space after sidebar */
    padding: 20px;
    background-color: var(--background-color);
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    padding-bottom: 60px; /* Leave space for the message bar at the bottom */
    overflow: hidden;
    position: relative;
}

/* Chat Box Styling */
#chatBox {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    padding: 10px;
    background-color: var(--background-color);
    border-radius: 4px;
}

/* Message Bar Configuration (at the bottom of the screen) */
.message-bar {
    position: fixed;
    bottom: 0;
    left: 300px; /* Align with sidebar */
    width: calc(100% - 300px); /* Full width minus sidebar width */
    background-color: var(--background-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    padding: 10px;
    z-index: 100; /* Ensure it stays on top */
    box-sizing: border-box; /* Include padding in width calculation */
}

/* Message Input Field */
.message-bar input {
    width: 80%; /* Adjust the width as needed */
    padding: 10px;
    margin-right: 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: var(--background-color);
    color: var(--text-color);
    box-sizing: border-box;
}

/* Send Button */
.message-bar button {
    padding: 10px 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.message-bar button:hover {
    background-color: var(--secondary-color);
}

/* Popup Styles */
.popup {
    display: none; /* Hidden by default */
    position: fixed; /* Fixed position */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    z-index: 9999; /* Ensure it sits on top */
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* Popup Content */
.popup-content {
    background-color: var(--background-color);
    border-radius: 8px;
    padding: 20px;
    width: 80%;
    max-width: 500px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Popup Input Field */
.popup input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
}

/* Popup User List */
.popup ul {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
}

.popup li {
    padding: 8px;
    cursor: pointer;
}

.popup li:hover {
    background-color: var(--hover-color);
}

/* Popup Buttons */
.popup button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

.popup button:hover {
    background-color: var(--secondary-color);
}

/* Popup Cancel Button */
.popup .cancel-button {
    background-color: #ccc;
}

.popup .cancel-button:hover {
    background-color: #999;
}
