:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.3);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --danger: #f43f5e;
    --success: #10b981;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    filter: blur(80px);
    opacity: 0.6;
}

.blob {
    position: absolute;
    border-radius: 50%;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #1e3a8a;
    top: -100px;
    right: -100px;
    animation: move 20s infinite alternate;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: #581c87;
    bottom: -150px;
    left: -150px;
    animation: move 25s infinite alternate-reverse;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: #0f766e;
    top: 40%;
    left: 30%;
    animation: move 15s infinite linear;
}

@keyframes move {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(100px, 50px) scale(1.1); }
}

/* Dashboard Layout */
.dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

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

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

.logo-icon {
    font-size: 2.5rem;
}

.accent {
    color: var(--accent);
}

.controls {
    display: flex;
    gap: 1rem;
}

button {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.primary-btn {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 14px 0 var(--accent-glow);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 var(--accent-glow);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    backdrop-filter: blur(10px);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Status Bar */
.status-bar {
    display: flex;
    gap: 2rem;
    background: var(--card-bg);
    padding: 1rem 2rem;
    border-radius: 16px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
    align-items: center;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.disconnected { background-color: var(--danger); box-shadow: 0 0 10px var(--danger); }
.connected { background-color: var(--success); box-shadow: 0 0 10px var(--success); }

.signal-meter {
    width: 100px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    background: var(--success);
    transition: width 0.3s ease;
}

/* Grid Layout */
.grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto auto;
    gap: 1.5rem;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.main-stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.stat-box {
    text-align: center;
}

.stat-box h3 {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gauge {
    position: relative;
    width: 150px;
    height: 150px;
}

.gauge svg {
    transform: rotate(-90deg);
}

.gauge circle {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
}

.gauge circle.bg {
    stroke: rgba(255, 255, 255, 0.05);
}

.gauge circle.fg {
    stroke: var(--accent);
    transition: stroke-dashoffset 0.5s ease-out;
}

.gauge .value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: 800;
}

.brain-waves {
    grid-column: span 1;
}

.raw-wave {
    grid-column: span 2;
}

.chart-container {
    height: 300px;
    width: 100%;
    margin-top: 1rem;
}

.instructions-panel {
    margin-top: 2rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
}

.instructions-panel h3 {
    margin-bottom: 1rem;
}

.instructions-panel ol {
    margin-left: 1.5rem;
    color: var(--text-secondary);
}

.instructions-panel li {
    margin-bottom: 0.5rem;
}

.note {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--accent);
}

@media (max-width: 900px) {
    .grid-container {
        grid-template-columns: 1fr;
    }
    .brain-waves, .raw-wave {
        grid-column: span 1;
    }
}
