body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to top for longer content */
    min-height: 100vh;
}

#app-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 600px;
}

/* Auth Section */
#auth-container h2, #auth-container h3 {
    text-align: center;
    color: #333;
}

#auth-forms {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin-bottom: 20px;
}

.form-section {
    flex: 1;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

#register-form, #login-form {
    display: flex;
    flex-direction: column;
}

#register-form input, #login-form input, #message-form input {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

#register-form button, #login-form button, #message-form button, #logout-button {
    padding: 10px 15px;
    background-color: #5cb85c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

#register-form button:hover, #login-form button:hover, #message-form button:hover, #logout-button:hover {
    background-color: #4cae4c;
}

#logout-button {
    background-color: #d9534f;
    margin-left: 10px;
}
#logout-button:hover {
    background-color: #c9302c;
}


/* Chat Section */
#chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

#chat-header h2 {
    margin: 0;
    color: #333;
}

#user-info {
    font-size: 0.9em;
    color: #555;
}

#messages-area {
    height: 400px;
    border: 1px solid #ccc;
    padding: 10px;
    overflow-y: auto;
    margin-bottom: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
}

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

.message .sender {
    font-weight: bold;
    display: block;
    margin-bottom: 3px;
    font-size: 0.85em;
    color: #555;
}

.message .content {
    font-size: 1em;
}

.message .timestamp {
    font-size: 0.75em;
    color: #999;
    display: block;
    text-align: right;
    margin-top: 4px;
}

/* My messages aligned to the right */
.message.my-message {
    background-color: #dcf8c6; /* Light green */
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}
.message.my-message .sender {
    color: #075e54; /* Darker green for sender */
}


/* Other users' messages aligned to the left */
.message.other-message {
    background-color: #fff; /* White */
    align-self: flex-start;
    border: 1px solid #eee;
    border-bottom-left-radius: 5px;
}
.message.other-message .sender {
    color: #4a4a4a;
}


#message-form {
    display: flex;
}

#message-input {
    flex-grow: 1;
    margin-right: 10px;
    margin-bottom: 0; /* Override general input style */
}

.status-message {
    text-align: center;
    margin-top: 10px;
    font-style: italic;
}

.error {
    color: red;
}

.success {
    color: green;
}