* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    text-align: center;
    backdrop-filter: blur(10px);
}

h1 {
    color: #4a5568;
    font-size: 3em;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    color: #718096;
    font-size: 1.2em;
    margin-bottom: 30px;
}

.stats-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin: 40px 0;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    min-width: 200px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.stat-number {
    font-size: 3.5em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.stat-label {
    color: #718096;
    font-size: 1.1em;
    font-weight: 500;
}

.content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .content {
        grid-template-columns: 1fr;
    }
}

.sidebar {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

.users-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

h2 {
    color: #4a5568;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
    font-size: 1.8em;
}

.nickname-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-weight: 600;
}

.input-field {
    width: 100%;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.input-field:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.current-user-info {
    background: #f7fafc;
    padding: 20px;
    border-radius: 10px;
    margin-top: 25px;
    border: 2px solid #e2e8f0;
}

.user-id {
    font-family: monospace;
    background: #edf2f7;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9em;
    word-break: break-all;
}

.users-list {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.user-item {
    background: white;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s;
    border: 1px solid #e2e8f0;
}

.user-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    border-color: #667eea;
}

.user-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2em;
}

.user-details {
    flex: 1;
}

.user-nickname {
    font-weight: bold;
    color: #2d3748;
    font-size: 1.2em;
    margin-bottom: 5px;
}

.user-info {
    color: #718096;
    font-size: 0.9em;
    display: flex;
    gap: 15px;
}

.user-status {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #48bb78;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.notification {
    position: fixed;
    top: 30px;
    right: 30px;
    padding: 20px 25px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
    max-width: 400px;
}

.notification.success {
    border-left: 5px solid #48bb78;
}

.notification.error {
    border-left: 5px solid #f56565;
}

.notification.info {
    border-left: 5px solid #4299e1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.notification-icon {
    font-size: 24px;
}

.notification-content {
    flex: 1;
}

.system-messages {
    margin-top: 30px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.system-message {
    padding: 8px 0;
    color: #718096;
    font-size: 0.9em;
    border-bottom: 1px solid #e2e8f0;
}

.system-message:last-child {
    border-bottom: none;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #a0aec0;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.connection-status {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: white;
    padding: 10px 20px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #48bb78;
}

.status-indicator.offline {
    background: #f56565;
}

.server-info {
    margin-top: 30px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 10px;
    font-size: 0.85em;
    color: #718096;
}

/* Стили для скроллбара */
.users-list::-webkit-scrollbar,
.system-messages::-webkit-scrollbar {
    width: 8px;
}

.users-list::-webkit-scrollbar-track,
.system-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.users-list::-webkit-scrollbar-thumb,
.system-messages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.users-list::-webkit-scrollbar-thumb:hover,
.system-messages::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.ping-test {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    color: #718096;
    font-size: 0.9em;
}
