/* Main container styles */
.chat-system-container {
    display: flex;
    height: 80vh;
    max-width: 1200px;
    margin: 20px auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

/* Sidebar styles */
.chat-sidebar {
    width: 300px;
    background: #f5f5f5;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 15px;
    background: #2c3e50;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#logout-button {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
}

.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
}

.tab-button {
    flex: 1;
    padding: 10px;
    border: none;
    background: #ecf0f1;
    cursor: pointer;
}

.tab-button.active {
    background: #3498db;
    color: white;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
}

.search-box {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.search-box input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.contacts-list, .groups-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.contact-item, .group-item {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.contact-item:hover, .group-item:hover {
    background: #e8f4fc;
}

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

.group-avatar {
    width: 40px;
    height: 40px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-weight: bold;
}

.contact-info, .group-info {
    flex: 1;
}

.contact-name, .group-name {
    font-weight: bold;
    display: block;
}

.last-message {
    font-size: 0.8em;
    color: #777;
    display: block;
}

.unread-count {
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
}

/* Main chat area styles */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 15px;
    background: #ecf0f1;
    border-bottom: 1px solid #ddd;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
}

.message {
    margin-bottom: 15px;
    max-width: 70%;
}

.message.me {
    margin-left: auto;
}

.message-sender {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.message-sender img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
}

.message-content {
    padding: 10px;
    border-radius: 5px;
    background: #f1f1f1;
}

.message.me .message-content {
    background: #3498db;
    color: white;
}

.message-time {
    font-size: 0.7em;
    color: #777;
    margin-top: 5px;
    text-align: right;
}

.message.me .message-time {
    color: #3498db;
}

.message-time.read {
    color: #2ecc71;
}

.message-time.unread {
    color: #e74c3c;
}

.attachment {
    margin-top: 10px;
}

.attachment img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 5px;
}

.chat-input {
    padding: 15px;
    border-top: 1px solid #ddd;
    background: #f5f5f5;
}

.input-group {
    display: flex;
}

.input-group input[type="text"] {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 3px 0 0 3px;
}

.input-group button {
    padding: 10px 15px;
    border: none;
    background: #3498db;
    color: white;
    border-radius: 0 3px 3px 0;
    cursor: pointer;
}

#attachment-button {
    background: #95a5a6;
    border-radius: 0;
}

/* Modal styles */
#password-reset-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 5px;
    width: 400px;
    max-width: 90%;
}

.modal-content h3 {
    margin-top: 0;
}

.modal-content .form-group {
    margin-bottom: 15px;
}

.modal-content .form-group:last-child {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Admin styles */
.admin-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.admin-tabs .tab-button {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
}

.admin-tabs .tab-button.active {
    border-bottom-color: #3498db;
    font-weight: bold;
}

.admin-content .tab-content {
    display: none;
}

.admin-content .tab-content.active {
    display: block;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.form-group button {
    padding: 8px 15px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.groups-table select {
    width: 150px;
    margin-right: 10px;
}