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

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 800px;
    width: 100%;
}

h1 {
    color: #333;
    margin-bottom: 20px;
}

.video-container {
    position: relative;
    width: 640px;
    height: 480px;
    margin: 20px auto;
    border: 2px solid #333;
    overflow: hidden; /* Ensures indicators inside don't overflow */
}

#webcam {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s ease-in-out; /* Smooth transition for sync mode */
    z-index: 1;
}

#canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

#bracelet-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

.controls {
    margin-top: 20px;
    text-align: center;
}

#enableWebcam, #calibrateWrist {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
}

#calibrateWrist {
    background-color: #FF5722;
}

#enableWebcam:hover {
    background-color: #45a049;
}

#calibrateWrist:hover {
    background-color: #E64A19;
}

#enableWebcam:disabled, #calibrateWrist:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

#calibrationStatus {
    margin-top: 10px;
    color: #FF5722;
    font-size: 14px;
    font-weight: bold;
}

#status {
    margin-top: 10px;
    color: #666;
    font-size: 14px;
}

.filter-controls {
    margin-top: 20px;
    padding: 20px;
    background-color: #f5f5f5;
    border-radius: 5px;
}

.filter-controls h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.filter-presets,
.filter-types {
    margin-bottom: 15px;
}

.filter-presets button,
.filter-types button {
    background-color: #2196F3;
    color: white;
    border: none;
    padding: 8px 16px;
    margin-right: 10px;
    margin-bottom: 5px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.filter-presets button:hover,
.filter-types button:hover {
    background-color: #1976D2;
}

.visualization-options {
    margin-top: 10px;
}

.visualization-options label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #333;
    margin-bottom: 8px;
}

.visualization-options input[type="checkbox"] {
    margin-right: 8px;
}

.mask-controls {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.mask-controls h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 14px;
}

.mask-controls label {
    display: flex;
    align-items: center;
    color: #333;
    font-size: 14px;
}

.mask-controls input[type="range"] {
    margin: 0 10px;
}

.mask-method {
    margin-bottom: 15px;
}

.mask-method label {
    display: inline-block;
    margin-right: 10px;
    font-weight: bold;
}

.mask-method button {
    background-color: #9E9E9E;
    color: white;
    border: none;
    padding: 6px 12px;
    margin-right: 5px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 12px;
    transition: background-color 0.3s;
}

.mask-method button:hover {
    background-color: #757575;
}

.mask-method button.active {
    background-color: #4CAF50;
}

.skin-settings {
    margin-top: 10px;
}

.mask-variant {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.mask-variant button {
    background-color: #607D8B;
    color: white;
    border: none;
    padding: 8px 16px;
    margin-right: 5px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.mask-variant button:hover {
    background-color: #455A64;
}

.mask-variant button.active {
    background-color: #FF5722;
}

.variant1-controls,
.variant2-controls {
    margin-top: 10px;
}

.edge-method,
.canny-settings,
.gap-settings,
.fill-options {
    margin-bottom: 10px;
}

.canny-settings label,
.gap-settings label {
    display: inline-flex;
    align-items: center;
    margin-right: 15px;
}

.canny-settings input[type="range"],
.gap-settings input[type="range"] {
    margin: 0 5px;
}

.fill-options {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.fill-options > label:first-child {
    margin-right: 10px;
    font-weight: bold;
}

.checkbox-label {
    display: inline-flex !important;
    align-items: center;
    margin-right: 15px;
    margin-bottom: 0 !important;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 5px;
}

@media (max-width: 700px) {
    .video-container {
        width: 100%;
        height: auto;
        aspect-ratio: 4/3;
    }
    
    .filter-presets button,
    .filter-types button {
        font-size: 12px;
        padding: 6px 12px;
    }
}

.status-indicators {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 20;
}

.indicator {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: #444; /* Default inactive color */
    border: 2px solid #fff;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
    transition: background-color 0.1s ease-in-out;
}

.indicator.active {
    background-color: #ff0000; /* Red for active HandDetection */
}

#depth-estimation-indicator.active {
    background-color: #0099ff; /* Blue for active DepthEstimation */
}