:root {
    --primary-color: #4285f4;
    --secondary-color: #34a853;
    --warning-color: #fbbc05;
    --danger-color: #ea4335;
    --light-gray: #f5f5f5;
    --dark-gray: #333;
    --medium-gray: #757575;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: var(--dark-gray);
    line-height: 1.6;
    padding: 20px;
}

.chat-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 90vh;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 20px;
    text-align: center;
    position: relative;
}

header h1 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.online-count {
    font-size: 0.9rem;
    opacity: 0.9;
}

.chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: var(--light-gray);
}

.message {
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.self {
    margin-left: auto;
    background-color: var(--primary-color);
    color: white;
    border-bottom-right-radius: 5px;
}

.message.other {
    margin-right: auto;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 5px;
}

.message-info {
    display: flex;
    align-items: baseline;
    margin-bottom: 5px;
}

.message-username {
    font-weight: bold;
    margin-right: 8px;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
}

.input-area {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    background-color: white;
}

.input-area input {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border 0.3s;
}

.input-area input:focus {
    border-color: var(--primary-color);
}

.message-input {
    display: flex;
    gap: 10px;
}

.message-input input {
    flex: 1;
    margin-bottom: 0;
}

#sendButton {
    padding: 0 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

#sendButton:hover {
    background-color: #3367d6;
}

footer {
    padding: 10px 20px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--medium-gray);
    background-color: var(--light-gray);
}

/* Responsive design */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .chat-container {
        height: 95vh;
    }
    
    .message {
        max-width: 90%;
    }
}