/* WanderingEyes - Calibration Target Styles */

/* Calibration overlay container */
#calibrationOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 500;
    display: none;
}

#calibrationOverlay.active {
    display: block;
    pointer-events: auto;
}

/* Calibration target */
.calibration-target {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.calibration-target .outer-circle {
    width: 40px;
    height: 40px;
    border: 3px solid white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.calibration-target .inner-circle {
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.calibration-target.active .outer-circle {
    border-color: #4af;
    animation: calibration-pulse 0.5s ease-in-out infinite alternate;
}

.calibration-target.active .inner-circle {
    background: #4af;
}

.calibration-target.shrinking .outer-circle {
    animation: calibration-shrink 2s ease-in-out forwards;
}

@keyframes calibration-pulse {
    from {
        box-shadow: 0 0 10px rgba(68, 170, 255, 0.5);
    }
    to {
        box-shadow: 0 0 20px rgba(68, 170, 255, 0.8);
    }
}

@keyframes calibration-shrink {
    from {
        width: 40px;
        height: 40px;
        opacity: 1;
    }
    to {
        width: 10px;
        height: 10px;
        opacity: 0.8;
    }
}

/* Calibration completed target */
.calibration-target.completed .outer-circle {
    border-color: #4f4;
    opacity: 0.5;
}

.calibration-target.completed .inner-circle {
    background: #4f4;
    opacity: 0.5;
}

/* Calibration progress indicator */
#calibrationProgress {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    text-align: center;
    z-index: 501;
}

#calibrationProgress .progress-bar {
    width: 200px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
}

#calibrationProgress .progress-fill {
    height: 100%;
    background: #4af;
    transition: width 0.3s;
}

#calibrationProgress .progress-text {
    font-size: 14px;
    margin-bottom: 5px;
}

#calibrationProgress .progress-hint {
    font-size: 11px;
    color: #aaa;
    margin-top: 8px;
}

/* Calibration pattern selector */
#calibrationPatternSelector {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    z-index: 502;
    display: none;
}

#calibrationPatternSelector.visible {
    display: block;
}

#calibrationPatternSelector h3 {
    color: white;
    margin: 0 0 20px 0;
    font-size: 18px;
}

.pattern-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.pattern-option {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.pattern-option:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.pattern-option.selected {
    background: rgba(68, 170, 255, 0.3);
    border-color: #4af;
}

.pattern-option .pattern-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 10px;
    position: relative;
}

.pattern-option .pattern-icon .dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

.pattern-option .pattern-name {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
}

.pattern-option .pattern-desc {
    font-size: 11px;
    color: #aaa;
}

/* 5-point pattern preview */
.pattern-5 .dot:nth-child(1) { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.pattern-5 .dot:nth-child(2) { top: 0; left: 0; }
.pattern-5 .dot:nth-child(3) { top: 0; right: 0; }
.pattern-5 .dot:nth-child(4) { bottom: 0; left: 0; }
.pattern-5 .dot:nth-child(5) { bottom: 0; right: 0; }

/* 9-point pattern preview */
.pattern-9 .dot:nth-child(1) { top: 0; left: 0; }
.pattern-9 .dot:nth-child(2) { top: 0; left: 50%; transform: translateX(-50%); }
.pattern-9 .dot:nth-child(3) { top: 0; right: 0; }
.pattern-9 .dot:nth-child(4) { top: 50%; left: 0; transform: translateY(-50%); }
.pattern-9 .dot:nth-child(5) { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.pattern-9 .dot:nth-child(6) { top: 50%; right: 0; transform: translateY(-50%); }
.pattern-9 .dot:nth-child(7) { bottom: 0; left: 0; }
.pattern-9 .dot:nth-child(8) { bottom: 0; left: 50%; transform: translateX(-50%); }
.pattern-9 .dot:nth-child(9) { bottom: 0; right: 0; }

/* Calibration settings panel */
#calibrationSettings {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

#calibrationSettings .setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    color: white;
}

#calibrationSettings .setting-label {
    font-size: 13px;
}

#calibrationSettings input[type="range"] {
    width: 120px;
}

#calibrationSettings .setting-value {
    font-size: 12px;
    color: #aaa;
    min-width: 40px;
    text-align: right;
}

/* Start calibration button */
#startCalibrationBtn {
    margin-top: 20px;
    background: #4af;
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

#startCalibrationBtn:hover {
    background: #5bf;
    transform: scale(1.05);
}

/* Calibration complete screen */
#calibrationComplete {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    z-index: 503;
    display: none;
}

#calibrationComplete.visible {
    display: block;
}

#calibrationComplete h3 {
    color: #4f4;
    margin: 0 0 15px 0;
    font-size: 24px;
}

#calibrationComplete p {
    color: #aaa;
    margin: 0 0 20px 0;
}

#calibrationComplete button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 10px 25px;
    border-radius: 6px;
    cursor: pointer;
    margin: 0 5px;
    transition: all 0.2s;
}

#calibrationComplete button:hover {
    background: rgba(255, 255, 255, 0.3);
}
