:root {
    --primary-color: #4a76a8;
    --secondary-color: #f0f2f5;
    --text-color: #333;
    --hover-color: #3a5a78;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --delete-color: #e74c3c;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--secondary-color);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.chat-container {
    background-color: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 1000px;
    overflow: hidden;
    display: flex;
}

.sidebar {
    width: 250px;
    background-color: #f8f9fa;
    padding: 20px;
    border-right: 1px solid #e5e5ea;
}

.user-profile {
    text-align: center;
    margin-bottom: 30px;
}

.user-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
}

.user-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.user-status {
    font-size: 14px;
    color: #666;
}

.sidebar-menu {
    list-style-type: none;
    padding: 0;
}

.sidebar-menu li {
    margin-bottom: 10px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.sidebar-menu a:hover {
    background-color: var(--secondary-color);
}

.sidebar-menu i {
    margin-right: 10px;
}

.main-content {
    flex-grow: 1;
    padding: 20px;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chat-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.room-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.room-item {
    background-color: #ffffff;
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.room-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.room-info {
    flex-grow: 1;
}

.room-name {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 18px;
    margin-bottom: 5px;
    display: block;
}

.room-creator {
    font-size: 14px;
    color: #666;
}

.room-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: var(--hover-color);
}

.btn-danger {
    background-color: var(--delete-color);
    color: white;
    border: none;
}

.btn-danger:hover {
    background-color: #c0392b;
}

#create-room-form {
    margin-top: 30px;
}

#create-room-form h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
    color: var(--text-color);
}

#create-room-form form {
    display: flex;
    gap: 10px;
}

#create-room-form input[type="text"] {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
}

.no-rooms {
    text-align: center;
    padding: 40px 20px;
    font-size: 18px;
    color: #666;
    background-color: #f9f9f9;
    border-radius: 12px;
    margin-bottom: 20px;
}

.no-rooms-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.flash-message {
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 8px;
    text-align: center;
}

.flash-message.success {
    background-color: #d4edda;
    color: #155724;
}

.flash-message.error {
    background-color: #f8d7da;
    color: #721c24;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    border: none;
    width: 90%;
    max-width: 400px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e5e5;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
}

.close {
    font-size: 24px;
    font-weight: 300;
    color: #aaa;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.submit-btn {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

.submit-btn:hover {
    background-color: var(--hover-color);
}

.sidebar-menu a.active {
    background-color: var(--primary-color);
    color: white;
}

.sidebar-menu a.active i {
    color: white;
}

@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
        height: auto;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e5e5ea;
    }
    
    .main-content {
        padding: 15px;
    }
    
    #create-room-form form {
        flex-direction: column;
    }
    
    #create-room-form input[type="text"] {
        margin-bottom: 10px;
    }

@keyframes highlight {
    0% { background-color: rgba(74, 118, 168, 0.1); }
    50% { background-color: rgba(74, 118, 168, 0.3); }
    100% { background-color: rgba(0, 0, 0, 0); }
}

.new-message-highlight {
    animation: highlight 2s ease-out;
}

.unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background-color: #e74c3c;
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    margin-left: 8px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

}