:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --color-red: #ef4444;
    --color-red-glow: rgba(239, 68, 68, 0.5);
    
    --color-green: #10b981;
    --color-green-glow: rgba(16, 185, 129, 0.5);
    
    --color-blue: #3b82f6;
    --color-blue-glow: rgba(59, 130, 246, 0.5);
    
    --color-grey: #475569;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(239, 68, 68, 0.15) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dashboard-container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

header {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.connection-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
}

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

.indicator.red {
    background-color: var(--color-red);
    box-shadow: 0 0 10px var(--color-red-glow);
}

.indicator.green {
    background-color: var(--color-green);
    box-shadow: 0 0 10px var(--color-green-glow);
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
}

.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.status-item {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
}

.state-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.state-badge.off {
    background: rgba(71, 85, 105, 0.2);
    color: var(--text-muted);
}

.state-badge.on {
    background: var(--color-green-glow);
    color: #fff;
    box-shadow: 0 0 15px var(--color-green-glow);
}

.controls-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.btn {
    border: none;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.3s ease;
    user-select: none;
}

.btn:active {
    transform: scale(0.96);
}

.btn-text {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.025em;
    color: white;
}

.btn-subtext {
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0.8;
}

.btn-emergency {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    box-shadow: 0 10px 25px var(--color-red-glow);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-emergency:active {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    box-shadow: 0 5px 15px var(--color-red-glow);
}

.btn-relay {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    box-shadow: 0 10px 25px var(--color-blue-glow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-relay.active {
    background: linear-gradient(135deg, #10b981, #047857);
    box-shadow: 0 10px 25px var(--color-green-glow);
}

footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}
