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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

#login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 450px;
}

.login-box h1 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
    font-size: 32px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.color-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.color-picker input[type="radio"] {
    display: none;
}

.color-picker label {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s;
    display: block;
}

.color-picker input[type="radio"]:checked + label {
    border-color: #333;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary, .btn-secondary, .btn-send {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #dc3545;
    color: white;
    width: auto;
    padding: 8px 20px;
    font-size: 14px;
}

.btn-secondary:hover {
    background: #c82333;
}

#chat-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.chat-header {
    background: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-left h2 {
    color: #333;
    font-size: 24px;
    margin-bottom: 5px;
}

.encryption-status {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

#user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: #333;
}

.chat-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 280px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    overflow-y: auto;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 16px;
}

#users-list {
    list-style: none;
}

#users-list li {
    padding: 12px;
    margin-bottom: 8px;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.9);
}

#messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
}

.message-content {
    flex: 1;
}

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

.message-username {
    font-weight: 600;
    color: #333;
}

.message-time {
    font-size: 12px;
    color: #999;
}

.message-text {
    background: white;
    padding: 12px 15px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    color: #333;
    word-wrap: break-word;
}

.system-message {
    text-align: center;
    color: #666;
    font-size: 14px;
    font-style: italic;
    padding: 10px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    margin: 10px auto;
}

.message-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

#message-form {
    display: flex;
    gap: 10px;
}

#message-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    transition: border-color 0.3s;
}

#message-input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-send {
    width: auto;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 25px;
}

.btn-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
