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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow: hidden;
    background: #000;
    color: #fff;
}

#container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#left-column {
    width: 300px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.95);
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

#right-column {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-width: 0; /* Allow flex item to shrink below content size */
}

#canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}

#canvas:active {
    cursor: grabbing;
}

#video-container {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 200px;
    height: 150px;
    z-index: 10;
}

#video {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    opacity: 0.9;
    transform: scaleX(-1); /* Mirror for better UX */
    object-fit: cover;
}

#video-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    transform: scaleX(-1); /* Mirror to match video */
    pointer-events: none;
    z-index: 11;
}

#info {
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

#info h1 {
    font-size: 20px;
    margin-bottom: 15px;
    font-weight: 600;
    line-height: 1.3;
}

#status {
    margin-bottom: 15px;
    flex-shrink: 0;
}

#status-text {
    font-size: 14px;
    color: #ccc;
    margin-bottom: 5px;
}

#mode-text {
    font-size: 14px;
    font-weight: 400;
    color: #ccc;
}

#links, #links a {
    font-size: 14px;
    color: #666;
    flex-shrink: 0;
    margin-bottom: 15px;
}

#instructions {
    font-size: 14px;
    color: #ccc;
    flex-shrink: 0;
    margin-bottom: 15px;
}

#instructions ul {
    margin-top: 5px;
    padding-left: 20px;
}

#instructions li {
    margin-bottom: 5px;
}

#legend {
    font-size: 14px;
    color: #ccc;
    margin-top: 0;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

#legend p {
    margin-bottom: 8px;
}

#legend-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.legend-label {
    flex: 1;
    color: #ccc;
}

/* Custom scrollbar for legend */
#legend::-webkit-scrollbar {
    width: 6px;
}

#legend::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

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

#legend::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}
