* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hidden {
    display: none !important;
}

/* Auth container */
#auth-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 300px;
    text-align: center;
}

#auth-container h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

#auth-container input {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

#auth-container button {
    width: 48%;
    padding: 10px;
    margin: 5px 1%;
    border: none;
    border-radius: 5px;
    background: #667eea;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

#auth-container button:hover {
    background: #5a67d8;
}

/* Chat container */
#chat-container {
    display: flex;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

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

#user-info {
    padding: 20px;
    background: #667eea;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#user-info #user-email {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
}

#logout-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

#logout-btn:hover {
    background: rgba(255,255,255,0.3);
}

#sidebar h3 {
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    color: #333;
}

#users-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
}

#users-list li {
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

#users-list li:hover {
    background: #e0e7ff;
}

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

#chat-header {
    padding: 20px;
    background: #667eea;
    color: white;
    font-weight: bold;
    border-bottom: 1px solid #ddd;
}

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

.message {
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 10px;
    max-width: 60%;
    word-wrap: break-word;
}

.my-message {
    background: #667eea;
    color: white;
    align-self: flex-end;
    margin-left: auto;
}

.other-message {
    background: #e5e5ea;
    color: black;
    align-self: flex-start;
}

#input-area {
    display: flex;
    padding: 20px;
    background: #f5f5f5;
    border-top: 1px solid #ddd;
}

#message-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-right: 10px;
    font-size: 14px;
}

#send-btn {
    padding: 10px 20px;
    background: #667eea;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    transition: background 0.3s;
}

#send-btn:hover {
    background: #5a67d8;
}