/* WanderingEyes - Eye Tracking Test Application Styles */

/* Base styles */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: Arial, sans-serif;
}

#renderCanvas {
    width: 100%;
    height: 100%;
    touch-action: none;
    display: block;
}

/* Instructions panel */
#instructions {
    position: absolute;
    top: 20px;
    right: 10px;
    color: #a8c8a8;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 11px;
    pointer-events: none;
    max-width: 180px;
}

#instructions kbd {
    background: rgba(136, 184, 136, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}

/* Light controls panel */
#lightControls {
    position: absolute;
    left: 10px;
    top: 10px;
    color: #a8c8a8;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 6px;
    pointer-events: auto;
    width: 180px;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
}

#lightControls h3 {
    margin: 0 0 8px 0;
    font-size: 13px;
}

#lightControls h4 {
    margin: 8px 0 6px 0;
    font-size: 11px;
    color: #708870;
    border-top: 1px solid #405040;
    padding-top: 6px;
}

.slider-group {
    margin-bottom: 8px;
}

.slider-group label {
    display: block;
    margin-bottom: 2px;
    font-size: 10px;
}

.slider-group input[type="range"],
#lightControls input[type="range"] {
    width: 100%;
    margin-bottom: 2px;
    height: 14px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(136, 184, 136, 0.4);
    border-radius: 3px;
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    background: rgba(136, 184, 136, 0.4);
    border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #a8c8a8;
    border-radius: 50%;
    margin-top: -4px;
    cursor: pointer;
}

input[type="range"]::-moz-range-track {
    height: 6px;
    background: rgba(136, 184, 136, 0.4);
    border-radius: 3px;
}

input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #a8c8a8;
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

/* Checkbox styling */
.slider-group input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: rgba(136, 184, 136, 0.3);
    border: 1px solid #a8c8a8;
    border-radius: 3px;
    vertical-align: middle;
    cursor: pointer;
}

.slider-group input[type="checkbox"]:checked {
    background: #88b888;
}

.slider-group input[type="checkbox"]:checked::after {
    content: '✓';
    display: block;
    color: #a8c8a8;
    font-size: 10px;
    text-align: center;
    line-height: 12px;
}

.slider-value {
    font-size: 10px;
    color: #708870;
}

/* Loading overlay */
#loadingOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a8c8a8;
    font-size: 24px;
    z-index: 1000;
}

#loadingOverlay.hidden {
    display: none;
}

/* Mode toggle buttons */
#modePanel {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    background: rgba(0, 0, 0, 0.7);
    padding: 6px 10px;
    border-radius: 6px;
}

.mode-btn {
    background: rgba(136, 184, 136, 0.1);
    border: 1px solid rgba(136, 184, 136, 0.3);
    color: #a8c8a8;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.2s;
}

.mode-btn:hover {
    background: rgba(136, 184, 136, 0.2);
}

.mode-btn.active {
    background: rgba(136, 184, 136, 0.4);
    border-color: rgba(136, 184, 136, 0.8);
}

.mode-btn kbd {
    background: rgba(136, 184, 136, 0.2);
    padding: 1px 3px;
    border-radius: 2px;
    font-size: 8px;
    margin-left: 3px;
}

/* Measurement panel */
#measurementPanel {
    position: absolute;
    right: 10px;
    bottom: 10px;
    color: #a8c8a8;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 6px;
    font-size: 10px;
    min-width: 140px;
}

#measurementPanel h4 {
    margin: 0 0 6px 0;
    font-size: 11px;
}

#measurementPanel .metric {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

#measurementPanel .metric-label {
    color: #708870;
}

#measurementPanel .metric-value {
    font-family: monospace;
    color: #88b888;
}

/* Glint debug overlay */
#glintOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

#glintInfo {
    position: absolute;
    left: 10px;
    bottom: 60px;
    color: #a8c8a8;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 9px;
    font-family: monospace;
}

#glintInfo .glint-color {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
}

#glintInfo .glint-tl { background: #ff4444; }
#glintInfo .glint-tr { background: #44ff44; }
#glintInfo .glint-bl { background: #4444ff; }
#glintInfo .glint-br { background: #ffff44; }

/* Recording indicator */
#recordingIndicator {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(200, 0, 0, 0.8);
    color: #a8c8a8;
    padding: 8px 16px;
    border-radius: 5px;
    font-size: 14px;
    display: none;
    align-items: center;
    gap: 8px;
}

#recordingIndicator.visible {
    display: flex;
}

#recordingIndicator .rec-dot {
    width: 10px;
    height: 10px;
    background: #ff0000;
    border-radius: 50%;
    animation: pulse 1s infinite;
}

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

/* Light position presets */
#presetPanel {
    position: absolute;
    left: 200px;
    top: 10px;
    color: #a8c8a8;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 6px;
    width: 140px;
}

#presetPanel h4 {
    margin: 0 0 6px 0;
    font-size: 11px;
}

.preset-btn {
    display: block;
    width: 100%;
    background: rgba(136, 184, 136, 0.1);
    border: 1px solid rgba(136, 184, 136, 0.3);
    color: #a8c8a8;
    padding: 4px 8px;
    margin-bottom: 4px;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    font-size: 10px;
    transition: all 0.2s;
}

.preset-btn:hover {
    background: rgba(136, 184, 136, 0.2);
}

.preset-btn.active {
    background: rgba(136, 184, 136, 0.3);
    border-color: rgba(136, 184, 136, 0.6);
}

/* Quality score display */
#qualityScore {
    position: absolute;
    left: 200px;
    bottom: 10px;
    color: #a8c8a8;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 6px;
    min-width: 130px;
}

#qualityScore h4 {
    margin: 0 0 6px 0;
    font-size: 11px;
}

#qualityScore .score-bar {
    height: 8px;
    background: rgba(136, 184, 136, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

#qualityScore .score-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff4444, #ffff44, #44ff44);
    transition: width 0.3s;
}

#qualityScore .score-value {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
}

/* IR mode filter */
.ir-mode #renderCanvas {
    filter: grayscale(100%) contrast(1.3);
}

/* Blink indicator */
#blinkIndicator {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(80, 120, 80, 0.8);
    color: #a8c8a8;
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 12px;
    display: none;
}

#blinkIndicator.visible {
    display: block;
}

/* Scrollbar styling for panels */
#lightControls::-webkit-scrollbar {
    width: 6px;
}

#lightControls::-webkit-scrollbar-track {
    background: rgba(136, 184, 136, 0.1);
    border-radius: 3px;
}

#lightControls::-webkit-scrollbar-thumb {
    background: rgba(136, 184, 136, 0.3);
    border-radius: 3px;
}

#lightControls::-webkit-scrollbar-thumb:hover {
    background: rgba(136, 184, 136, 0.5);
}
