:root {
    --bg-color: #0f1115;
    --panel-bg: rgba(30, 34, 40, 0.6);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-ble: #00f2ff;
    /* Cyan for BLE */
    --accent-uwb: #00ff9d;
    /* Green for UWB */
    --accent-active: #ffb800;
    /* Orange for Active/Wake */
    --border-color: rgba(255, 255, 255, 0.1);
    --card-active-bg: rgba(0, 242, 255, 0.1);
    --font-main: 'Inter', sans-serif;
    --font-mono: 'JetBrains 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);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

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

h1 {
    font-weight: 300;
    font-size: 24px;
    letter-spacing: -0.5px;
}

.highlight {
    font-weight: 600;
    color: var(--accent-ble);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

main {
    display: grid;
    grid-template-columns: 1fr 450px;
    gap: 20px;
    flex: 1;
    min-height: 0;
    /* Fix for flex item overflow */
}

.canvas-wrapper {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.overlay-status {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    gap: 20px;
}

.status-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.label {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.value {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--accent-ble);
}

.info-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding: 0 4px;
}

.step-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 12px;
    transition: all 0.3s ease;
    opacity: 0.5;
}

.step-card.active {
    opacity: 1;
    border-color: var(--accent-ble);
    background: var(--card-active-bg);
    transform: translateX(-4px);
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.1);
}

.step-icon {
    font-size: 24px;
    background: rgba(255, 255, 255, 0.05);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-content h3 {
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.step-content p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.controls {
    margin-top: auto;
    display: flex;
    gap: 10px;
    padding-top: 20px;
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-family: var(--font-main);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn.primary {
    background: var(--accent-ble);
    color: #000;
    font-weight: 600;
}

.btn.primary:hover {
    background: #fff;
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Additions for new controls */
.control-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    padding: 4px 0;
}

.checkbox-row input {
    accent-color: var(--accent-ble);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-row label {
    cursor: pointer;
    user-select: none;
}

/* Update step cards for 6 items */
.step-card {
    padding: 12px;
    /* Slightly smaller padding to fit 6 items */
}

.step-icon {
    font-family: var(--font-mono);
    font-weight: 700;
}