body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.glass-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.connection-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Floating message counter */
.floating-stats {
    position: fixed;
    top: 60px;
    right: 20px;
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    z-index: 1000;
    min-width: 150px;
}

.floating-stats-title {
    font-size: 10px;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.floating-stats-value {
    font-size: 28px;
    font-weight: bold;
    color: #06b6d4;
    line-height: 1;
}

.floating-stats-time {
    font-size: 9px;
    color: #64748b;
    margin-top: 4px;
}

.connection-indicator.connected {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid #22c55e;
}

.connection-indicator.disconnected {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid #ef4444;
}

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

.status-dot.green {
    background: #22c55e;
}

.status-dot.red {
    background: #ef4444;
}

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

/* Responsive Vertical Bar */
.vertical-bar {
    width: 30px; /* Narrower for mobile */
    height: 60px; /* Shorter for mobile */
    background: linear-gradient(to top, rgba(148, 163, 184, 0.1) 0%, rgba(148, 163, 184, 0.05) 100%);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Tablet and Desktop scaling */
@media (min-width: 640px) {
    .vertical-bar {
        width: 50px;
        height: 160px;
        border-radius: 25px;
        border-width: 2px;
    }
}

.bar-fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    transition: height 0.3s ease;
    border-radius: 30px;
}

.apps-bar .bar-fill {
    background: linear-gradient(to top, #10b981, #34d399);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.brake-bar .bar-fill {
    background: linear-gradient(to top, #ef4444, #f87171);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

/* Speed Gauge */
.speed-gauge {
    position: relative;
}

.circular-gauge {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.3);
}

.gauge-inner {
    width: 135px;
    height: 135px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.mini-circular-gauge {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(51, 65, 85, 0.5);
    border: 3px solid rgba(74, 222, 128, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.rpm-gauge-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        from -90deg,
        rgba(74, 222, 128, 0.8) 0deg,
        rgba(74, 222, 128, 0.8) var(--rpm-fill, 0deg),
        transparent var(--rpm-fill, 0deg)
    );
}

.mini-gauge-inner {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    position: relative;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 220px;
    padding: 8px;
}

/* Compact layout adjustments */
.compact-spacing {
    margin-bottom: 0.75rem !important;
}

.compact-card {
    padding: 0.75rem !important;
}

/* Time display bar below charts */
.chart-time-display {
    background: rgba(51, 65, 85, 0.5);
    border-radius: 8px;
    padding: 8px 16px;
    margin-top: 12px;
    text-align: center;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.chart-time-label {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 4px;
}

.chart-time-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: #3b82f6;
    font-family: 'Courier New', monospace;
}

/* Temperature Display */
.temp-display {
    font-size: 2rem;
    font-weight: 900;
    text-align: center;
    transition: color 0.3s ease;
}

.temp-display.cold {
    color: #22c55e;
}

.temp-display.warm {
    color: #eab308;
}

.temp-display.hot {
    color: #ef4444;
}

/* Status Display */
.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.status-item {
    background: rgba(51, 65, 85, 0.5);
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid #3b82f6;
}

.status-label {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 4px;
}

.status-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: #e2e8f0;
    font-family: 'Courier New', monospace;
}

.heartbeat-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-left: 8px;
}

.heartbeat-ok {
    background: #22c55e;
    animation: pulse-green 2s infinite;
}

.heartbeat-fail {
    background: #ef4444;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Error Marker on Charts */
.error-marker {
    position: absolute;
    width: 3px;
    height: 100%;
    background: #ef4444;
    opacity: 0.8;
    z-index: 10;
}

/* Label toggle styles */
.label-hidden {
    text-decoration: line-through;
    opacity: 0.5;
}

/* Status indicator lights */
.status-lights {
    display: flex;
    gap: 6px;
    align-items: center;
}

.status-light {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.status-light.on {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
}

.status-light.off {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
}

.status-light-label {
    font-size: 9px;
    color: #94a3b8;
    text-transform: uppercase;
}

/* Chart time display */
.chart-time-display {
    margin-top: 12px;
    padding: 8px 16px;
    background: rgba(51, 65, 85, 0.5);
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.chart-time-label {
    font-size: 10px;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.chart-time-value {
    font-size: 18px;
    font-weight: bold;
    color: #06b6d4;
    font-family: 'Courier New', monospace;
}

.mini-gauge, .speed-gauge {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease; /* Makes resizing feel smooth */
}