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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 90%;
    max-width: 800px;
    height: 90vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

header h1 {
    font-size: 2em;
    margin-bottom: 5px;
}

header p {
    font-size: 0.9em;
    opacity: 0.9;
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f5f5;
}

.messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.85em;
}

.message-name {
    font-weight: bold;
    color: #667eea;
}

.message-time {
    color: #999;
}

.message-text {
    color: #333;
    word-wrap: break-word;
}

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

#nameInput {
    flex: 0 0 150px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    outline: none;
    transition: border-color 0.3s;
}

#messageInput {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    outline: none;
    transition: border-color 0.3s;
}

#nameInput:focus,
#messageInput:focus {
    border-color: #667eea;
}

#sendBtn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#sendBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

#sendBtn:active {
    transform: translateY(0);
}

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

.chat-container::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.chat-container::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }
    
    .input-container {
        flex-wrap: wrap;
    }
    
    #nameInput {
        flex: 1 1 100%;
    }
    
    #messageInput {
        flex: 1 1 calc(100% - 90px);
    }
    
    #sendBtn {
        flex: 0 0 80px;
    }
}
