* {
    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%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

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

header {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

header h1 {
    font-size: 28px;
    color: #333;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: #f5f5f5;
    border-radius: 25px;
    font-weight: 600;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #999;
    animation: pulse 2s infinite;
}

.status-dot.ready { background: #4caf50; }
.status-dot.qr { background: #ff9800; }
.status-dot.error { background: #f44336; }
.status-dot.disconnected { background: #9e9e9e; }

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

.main-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.card h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.status-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
}

.info-item label {
    font-weight: 600;
    color: #666;
}

.error-text {
    color: #f44336;
    font-weight: 600;
}

.qr-container {
    text-align: center;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#qrImage {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.help-text {
    margin-top: 15px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
    min-width: 120px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-warning {
    background: #ff9800;
    color: white;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.loading {
    color: #666;
    font-style: italic;
}

.groups-list {
    max-height: 400px;
    overflow-y: auto;
}

.group-item {
    padding: 12px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.group-name {
    font-weight: 600;
    color: #333;
}

.group-id {
    font-size: 12px;
    color: #999;
    font-family: monospace;
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
    }
    
    .main-content {
        grid-template-columns: 1fr;
    }
}
