* {
    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;
    padding: 20px;
}

.wrapper {
    width: 100%;
    max-width: 1000px;
    height: 90vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

/* Login Screen */
.login-screen {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.login-box .icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.login-box h1 {
    color: #333;
    margin-bottom: 10px;
}

.login-box p {
    color: #666;
    margin-bottom: 25px;
}

.login-box input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 15px;
}

.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: 10px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
}

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

.error-msg {
    color: #e74c3c;
    margin-top: 10px;
    font-size: 14px;
}

/* Chat Screen */
.chat-screen {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    background: #2c3e50;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo span {
    font-size: 24px;
}

.logo h2 {
    font-size: 18px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info button {
    padding: 5px 15px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* Online Panel */
.online-panel {
    background: #ecf0f1;
    padding: 10px 20px;
    border-bottom: 1px solid #ddd;
}

.online-title {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    font-weight: bold;
}

.user-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.user-item {
    background: #3498db;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
}

.user-item.current {
    background: #2ecc71;
}

/* Message Area */
.message-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.welcome-msg {
    text-align: center;
    color: #999;
    padding: 20px;
}

.message {
    max-width: 70%;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 14px;
    word-wrap: break-word;
}

.message.own {
    align-self: flex-end;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 5px;
}

.message.other {
    align-self: flex-start;
    background: white;
    border: 1px solid #ddd;
    border-bottom-left-radius: 5px;
}

.message.system {
    align-self: center;
    background: #f1c40f;
    color: #333;
    font-size: 12px;
    max-width: 80%;
    text-align: center;
}

.message-name {
    font-size: 11px;
    margin-bottom: 3px;
    opacity: 0.8;
}

.message-time {
    font-size: 10px;
    margin-top: 3px;
    text-align: right;
    opacity: 0.7;
}

/* Typing Indicator */
.typing-indicator {
    padding: 5px 20px;
    font-size: 12px;
    color: #7f8c8d;
    font-style: italic;
    background: white;
    min-height: 32px;
}

/* Input Area */
.input-area {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #ddd;
}

.input-area input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 14px;
}

.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: 25px;
    cursor: pointer;
}

/* Scrollbar */
.message-area::-webkit-scrollbar {
    width: 5px;
}

.message-area::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.message-area::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 5px;
}

/* Responsive */
@media (max-width: 600px) {
    .message {
        max-width: 85%;
    }
    
    .login-box {
        padding: 30px 20px;
    }
}