:root {
    --bg-dark: #000000;
    --sidebar-bg: #0a0a0a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: #a3a3a3;
    --accent: #ffffff;
    --error: #cccccc;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #000000, #111111, #000000);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.dashboard-container { display: flex; height: 100%; }

.sidebar {
    width: 350px;
    background-color: var(--sidebar-bg);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.logo-container { display: flex; align-items: center; gap: 12px; margin-bottom: 0.5rem; }
.pulse-dot { width: 12px; height: 12px; background-color: var(--accent); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); } }

h1 { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.5px; }
.highlight { color: var(--accent); }
.subtitle { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 2.5rem; }

.stats-card { background: var(--card-bg); border-radius: 12px; padding: 1.5rem; border: 1px solid rgba(255, 255, 255, 0.1); margin-bottom: 2rem; }
.stats-card h3 { font-size: 1.1rem; margin-bottom: 1.2rem; color: #e2e8f0; }
.stat-item { display: flex; justify-content: space-between; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.stat-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.stat-label { color: var(--text-secondary); font-weight: 500; }
.stat-value { font-weight: 700; }
.status-active { color: var(--accent); }
.status-error { color: var(--error); }

.info-section h4 { font-size: 0.9rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 1rem; }
.logs { list-style: none; font-family: monospace; font-size: 0.85rem; color: var(--accent); }
.logs li { margin-bottom: 0.5rem; opacity: 0.8; }

.video-section { flex: 1; display: flex; flex-direction: column; padding: 2rem; background: radial-gradient(circle at center, #1a1a1a 0%, #000000 100%); }
.video-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.video-header h2 { font-weight: 600; color: #e2e8f0; }

.header-controls { display: flex; align-items: center; gap: 1rem; }
.btn-danger { background-color: rgba(255, 255, 255, 0.1); color: var(--text-primary); padding: 8px 16px; border-radius: 6px; font-size: 0.85rem; font-weight: 600; border: 1px solid var(--text-primary); cursor: pointer; transition: all 0.3s ease; font-family: 'Inter', sans-serif; }
.btn-danger:hover { background-color: var(--text-primary); color: #000; }
.btn-primary { background-color: rgba(255, 255, 255, 0.1); color: var(--text-primary); padding: 8px 16px; border-radius: 6px; font-size: 0.85rem; font-weight: 600; border: 1px solid var(--text-primary); cursor: pointer; transition: all 0.3s ease; font-family: 'Inter', sans-serif; }
.btn-primary:hover { background-color: var(--text-primary); color: #000; }

.live-badge { background-color: rgba(255, 255, 255, 0.1); color: var(--text-primary); padding: 6px 12px; border-radius: 6px; font-size: 0.85rem; font-weight: 700; border: 1px solid var(--text-primary); display: flex; align-items: center; gap: 6px; animation: pulseOpacity 2s infinite; }
.live-badge::before { content: ''; display: block; width: 6px; height: 6px; background-color: var(--text-primary); border-radius: 50%; }
@keyframes pulseOpacity { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }

.video-wrapper { flex: 1; position: relative; border-radius: 16px; overflow: hidden; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); background-color: #000; display: flex; justify-content: center; align-items: center; border: 1px solid rgba(255, 255, 255, 0.1); }

/* Stack video and canvas directly on top of each other */
#webcam, #overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; }
#overlay { z-index: 5; pointer-events: none; }

.crosshair { position: absolute; width: 30px; height: 30px; border-color: rgba(255, 255, 255, 0.5); border-style: solid; pointer-events: none; z-index: 10; }
.crosshair-tl { top: 20px; left: 20px; border-width: 2px 0 0 2px; }
.crosshair-tr { top: 20px; right: 20px; border-width: 2px 2px 0 0; }
.crosshair-bl { bottom: 20px; left: 20px; border-width: 0 0 2px 2px; }
.crosshair-br { bottom: 20px; right: 20px; border-width: 0 2px 2px 0; }
