* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    opacity: 0.9;
}

.main-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    min-height: 70vh;
}

.sidebar {
    background: #f8f9fa;
    padding: 20px;
    border-right: 1px solid #e9ecef;
}

.user-info, .room-management, .security-info {
    margin-bottom: 30px;
}

.user-info h3, .room-management h3, .security-info h4 {
    margin-bottom: 15px;
    color: #495057;
}

.username-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.btn-primary, .btn-secondary {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.room-list {
    margin-top: 20px;
}

.room-list h4 {
    margin-bottom: 10px;
    color: #495057;
}

.room-item {
    background: white;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    cursor: pointer;
    transition: all 0.3s ease;
}

.room-item:hover {
    border-color: #007bff;
    transform: translateX(5px);
}

.chat-area {
    display: flex;
    flex-direction: column;
    height: 70vh;
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background: white;
}

.room-info {
    font-size: 0.9em;
    color: #6c757d;
    margin-top: 5px;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.messages {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
}

.message.own {
    align-self: flex-end;
    background: #007bff;
    color: white;
}

.message.other {
    align-self: flex-start;
    background: white;
    border: 1px solid #dee2e6;
}

.message-header {
    font-size: 0.8em;
    opacity: 0.8;
    margin-bottom: 5px;
}

.message-content {
    word-wrap: break-word;
}

.message-timestamp {
    font-size: 0.7em;
    opacity: 0.6;
    text-align: right;
    margin-top: 5px;
}

.welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.welcome-message ul {
    list-style: none;
    margin-top: 20px;
}

.welcome-message li {
    margin: 10px 0;
}

.message-input-area {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    background: white;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.input-group input {
    flex: 1;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
}

.input-group button {
    padding: 12px 24px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.encryption-status {
    text-align: center;
}

.encrypted-badge {
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    min-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #495057;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
    
    .message {
        max-width: 85%;
    }
}
/* Styles pour les salons privés */
.room-item.private {
    border-left: 4px solid #dc3545;
    background: linear-gradient(135deg, #fff5f5, #ffffff);
}

.private-badge {
    background: #dc3545;
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.7em;
    margin-left: 5px;
}

.public-badge {
    background: #28a745;
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.7em;
    margin-left: 5px;
}

.room-type-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.room-type-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

.room-type-btn.active {
    border-color: #007bff;
    background: #007bff;
    color: white;
}

.room-type-btn i {
    font-size: 1.2em;
    margin-bottom: 5px;
}

.room-name-preview {
    text-align: center;
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-weight: bold;
}

.error-message {
    color: #dc3545;
    font-size: 0.9em;
    margin-top: 5px;
}

.password-field {
    margin-bottom: 15px;
}

.password-field input {
    width: 100%;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
}

.room-privacy-info {
    font-size: 0.8em;
    color: #6c757d;
    margin-top: 5px;
}
/* Styles pour les canaux d'annonces */
.room-item.announcement {
    border-left: 4px solid #ffc107;
    background: linear-gradient(135deg, #fffbf0, #ffffff);
}

.announcement-badge {
    background: #ffc107;
    color: #212529;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.7em;
    margin-left: 5px;
}

.write-restricted {
    opacity: 0.7;
    background: #f8f9fa !important;
}

.write-restricted .message-input-area {
    background: #e9ecef;
}

.write-restricted input {
    background: #f8f9fa;
    border-color: #dee2e6;
}
