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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.main-content {
    padding: 30px;
}

.video-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

#videoElement {
    width: 100%;
    display: block;
}

#canvasElement {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.status-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 10px;
    background: white;
    font-size: 1.2em;
    font-weight: bold;
}

.status-indicator.safe {
    background: #d4edda;
    color: #155724;
}

.status-indicator.warning {
    background: #fff3cd;
    color: #856404;
}

.status-indicator.danger {
    background: #f8d7da;
    color: #721c24;
    animation: pulse 1s infinite;
}

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

.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.metric {
    background: white;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.metric label {
    font-weight: 600;
    color: #666;
}

.metric span {
    font-weight: bold;
    color: #333;
    font-size: 1.1em;
}

.controls {
    padding: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
    background: #f8f9fa;
}

.btn {
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-2px);
}

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

.test-mode-section {
    padding: 20px 30px;
    background: #e9ecef;
    border-top: 2px solid #dee2e6;
}

.test-mode-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
}

.test-mode-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

.test-mode-note {
    font-size: 0.9em;
    color: #6c757d;
    font-style: italic;
    margin: 0;
    padding-left: 30px;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .metrics {
        grid-template-columns: 1fr;
    }
    
    .test-mode-note {
        padding-left: 0;
    }
}

