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

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.screen {
    display: none;
}

.screen.active {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Login Screen */
.login-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    text-align: center;
    color: #333;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

button[type="submit"], #send-btn {
    width: 100%;
    padding: 0.75rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

button[type="submit"]:hover, #send-btn:hover:not(:disabled) {
    background: #5568d3;
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.error {
    color: #e74c3c;
    margin-top: 1rem;
    text-align: center;
}

.test-users {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
    font-size: 0.9rem;
    color: #666;
}

.test-users p {
    margin: 0.25rem 0;
}

/* Chat Screen */
.chat-container {
    display: flex;
    width: 95vw;
    height: 90vh;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #f8f9fa;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.current-user {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    background: #667eea;
    color: white;
}

.current-user h2 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: normal;
    opacity: 0.9;
}

.current-user p {
    font-size: 1.2rem;
    font-weight: bold;
}

.users-section {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.users-section h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

#user-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.user-list-header {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
    padding-left: 0.25rem;
}

.user-item {
    padding: 0.75rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-item:hover {
    background: #f0f0f0;
    border-color: #667eea;
}

.user-item.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.user-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #95a5a6;
}

.user-status.online {
    background: #27ae60;
}

.user-name {
    flex: 1;
    font-weight: 500;
}

.logout-btn {
    margin: 1rem;
    padding: 0.75rem;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.logout-btn:hover {
    background: #c0392b;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    background: white;
}

.chat-header h2 {
    font-size: 1.2rem;
    color: #333;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #f8f9fa;
}

.message {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    max-width: 70%;
}

.message.sent {
    align-self: flex-end;
    align-items: flex-end;
}

.message.received {
    align-self: flex-start;
}

.message-header {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.message-badge {
    background: #f39c12;
    color: white;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.7rem;
}

.message-content {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    word-wrap: break-word;
}

.message.sent .message-content {
    background: #667eea;
    color: white;
}

.message.received .message-content {
    background: white;
    color: #333;
}

.message-footer {
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.25rem;
}

.message-input {
    padding: 1.5rem;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 1rem;
}

#message-text {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

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

#send-btn {
    width: 100px;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

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

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

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