* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container.hidden {
    display: none;
}

/* Login Box */
.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    text-align: center;
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    color: #667eea;
    margin-bottom: 30px;
    font-size: 32px;
}

.login-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.login-box input:focus {
    outline: none;
    border-color: #667eea;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.login-box button:hover {
    transform: translateY(-2px);
}

.info-text {
    color: #888;
    font-size: 14px;
    margin-top: 20px;
}

/* Chat Container */
#chatContainer {
    flex-direction: column;
    background: white;
    width: 90%;
    max-width: 800px;
    height: 90vh;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h1 {
    font-size: 24px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    font-size: 14px;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid white;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Message Box */
.message-box {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f5f5;
}

.message {
    margin-bottom: 15px;
    animation: slideIn 0.3s ease-in-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.own {
    text-align: right;
}

.message-content {
    display: inline-block;
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 10px;
    word-wrap: break-word;
}

.message.own .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.message:not(.own) .message-content {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
}

.message-username {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
    font-weight: bold;
}

.message.own .message-username {
    color: #666;
    text-align: right;
}

.message-time {
    font-size: 11px;
    color: #bbb;
    margin-top: 5px;
}

/* Input Area */
.input-area {
    display: flex;
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
    gap: 10px;
}

.input-area input {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.input-area input:focus {
    outline: none;
    border-color: #667eea;
}

.input-area button {
    padding: 10px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.input-area button:hover {
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 600px) {
    .login-box {
        padding: 30px 20px;
    }

    #chatContainer {
        width: 95%;
        height: 95vh;
    }

    .chat-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .user-info {
        justify-content: center;
    }

    .message-content {
        max-width: 90%;
    }
}