* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.chat-container {
    width: 100%;
    max-width: 800px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 80vh;
}

.chat-header {
    background-color: #0088cc;
    color: white;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.chat-header h1 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.chat-id-form {
    display: flex;
    gap: 10px;
}

#chat-id-input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    outline: none;
}

#connect-btn {
    padding: 8px 15px;
    background-color: #fff;
    color: #0088cc;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

#connect-btn:hover {
    background-color: #f0f0f0;
}

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

.empty-state {
    text-align: center;
    color: #888;
    margin-top: 30px;
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 10px;
    position: relative;
    word-wrap: break-word;
}

.message-info {
    font-size: 0.8rem;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
}

.message-sender {
    font-weight: bold;
}

.message-time {
    color: #888;
}

.message-text {
    font-size: 1rem;
}

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

.message.sent {
    align-self: flex-end;
    background-color: #0088cc;
    color: white;
}

.chat-input-container {
    padding: 15px;
    display: flex;
    gap: 10px;
    border-top: 1px solid #e0e0e0;
}

#message-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
}

#send-btn {
    padding: 0 20px;
    background-color: #0088cc;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
}

#send-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

#message-input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}