:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary-color: #38bdf8;
    --secondary-color: #818cf8;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --success: #4ade80;
    --waiting: #fbbf24;
    --error: #f87171;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: radial-gradient(circle at top right, #1e1b4b, #0f172a);
    color: var(--text-main);
    min-height: 100vh;
    padding: 2rem;
}

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.badge {
    font-size: 0.7rem;
    background: var(--primary-color);
    color: #000;
    padding: 2px 8px;
    border-radius: 12px;
    vertical-align: middle;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.waiting .dot { background: var(--waiting); box-shadow: 0 0 10px var(--waiting); }
.connected .dot { background: var(--success); box-shadow: 0 0 10px var(--success); }
.disconnected .dot { background: var(--error); box-shadow: 0 0 10px var(--error); }

main {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
}

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

.card {
    padding: 2rem;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
}

h2 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

p {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

#qrcode-container {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 250px;
    position: relative;
}

#qrcode img {
    max-width: 100%;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-bottom-color: var(--primary-color);
    border-radius: 50%;
    display: inline-block;
    animation: rotation 1s linear infinite;
    position: absolute;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.count {
    font-size: 0.8rem;
    color: var(--primary-color);
}

.feed {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.feed::-webkit-scrollbar {
    width: 6px;
}

.feed::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.empty-state {
    text-align: center;
    padding: 3rem 0;
}

.result-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
    animation: slideIn 0.3s ease-out;
}

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

.result-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.user-id { font-weight: 600; font-size: 0.9rem; }
.time { font-size: 0.75rem; color: var(--text-dim); }

.data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.data-item {
    font-size: 0.8rem;
}

.label {
    display: block;
    color: var(--text-dim);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.value {
    color: var(--text-main);
}

footer {
    margin-top: 4rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.8rem;
}
