:root {
    --bg-color: #0a0a0c;
    --card-bg: #141418;
    --text-primary: #ffffff;
    --text-secondary: #8b8b95;
    --accent-color: #00f2ff;
    --accent-glow: rgba(0, 242, 255, 0.2);
    --success-color: #00ff9d;
    --error-color: #ff0055;
    --font-main: 'Outfit', sans-serif;
    --font-mono: 'Roboto Mono', monospace;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1.5rem;
}

h1 {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-primary {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.8rem 1.5rem;
    font-family: var(--font-mono);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
}

.btn-primary:hover {
    background: var(--accent-color);
    color: var(--bg-color);
    box-shadow: 0 0 20px var(--accent-glow);
}

.status-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.status-item {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
}

.label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.5rem;
}

.value {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
}

.disconnected {
    color: var(--error-color);
}

.connected {
    color: var(--success-color);
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.card h2 {
    font-size: 0.9rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-desc {
    font-size: 0.75rem;
    color: #4a4a55;
    /* Darker text */
    margin-top: 0.2rem;
    font-weight: 500;
}

.graph-card {
    height: 400px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Fix overflow */
}

.graph-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.canvas-container {
    flex-grow: 1;
    position: relative;
    width: 100%;
    height: 100%;
    /* Ensure it fills the remaining space */
    overflow: hidden;
}

canvas {
    display: block;
    /* Remove inline spacing */
    width: 100% !important;
    height: 100% !important;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .status-bar {
        grid-template-columns: 1fr;
    }
}