/* Eye Tracking Calibration Styles */

body {
    margin: 0;
    padding: 0;
    font-family: 'Optima', sans-serif;
    background-color: #ffffff;
    color: #1a1a1a;
    min-height: 100vh;
    overflow: hidden;
}

/* Phase containers */
.phase {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
}

.phase.hidden {
    display: none;
}

.container {
    text-align: center;
    max-width: 600px;
    padding: 40px;
    position: relative;
    z-index: 1001;
}

h1 {
    font-size: 42px;
    margin-bottom: 20px;
    font-weight: normal;
}

.instructions {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Buttons */
button {
    padding: 15px 40px;
    font-size: 18px;
    font-family: 'Trebuchet MS', monospace;
    background-color: #ffffff;
    color: #1a1a1a;
    border: 3px solid #d3d3d3;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
}

button:hover:not(:disabled) {
    background-color: #E0CCF5;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button.secondary {
    background-color: #f5f5f5;
    border-color: #e0e0e0;
}

button.secondary:hover {
    background-color: #e8e8e8;
}

/* Camera status */
#camera-status {
    font-size: 16px;
    padding: 15px 25px;
    border-radius: 8px;
    margin: 30px 0;
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

#camera-status.success {
    background-color: #d4edda;
    color: #155724;
    border-color: #28a745;
}

#camera-status.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #dc3545;
}

/* Calibration phase */
#calibration-phase {
    position: relative;
}

#calibration-instructions {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 50;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 15px 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#calibration-instructions p {
    margin: 5px 0;
    font-size: 16px;
    color: #333;
}

/* Progress bar */
#progress-bar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 30px;
    background-color: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

#progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background-color: #32CD32;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 15px;
}

#progress-text {
    position: relative;
    z-index: 1;
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

/* Calibration points */
.calibration-point {
    position: fixed;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #ff0000;
    border: 3px solid #cc0000;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 100;
    padding: 0;
    margin: 0;
}

.calibration-point:hover:not(.complete) {
    transform: scale(1.3);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
}

/* Click progress colors */
.calibration-point[data-clicks="1"] {
    background-color: #ff2200;
    border-color: #cc1100;
}

.calibration-point[data-clicks="2"] {
    background-color: #ff5500;
    border-color: #cc3300;
}

.calibration-point[data-clicks="3"] {
    background-color: #ff8800;
    border-color: #cc5500;
}

.calibration-point[data-clicks="4"] {
    background-color: #ffbb00;
    border-color: #cc8800;
}

.calibration-point.complete {
    background-color: #ffee00;
    border-color: #ccbb00;
    cursor: default;
    opacity: 0.7;
}

/* 9-point positions (3x3 grid) */
#pt1 { top: 5%; left: 5%; }
#pt2 { top: 5%; left: 50%; transform: translateX(-50%); }
#pt3 { top: 5%; right: 5%; }
#pt4 { top: 50%; left: 5%; transform: translateY(-50%); }
#pt5 { top: 50%; left: 50%; transform: translate(-50%, -50%); }
#pt6 { top: 50%; right: 5%; transform: translateY(-50%); }
#pt7 { bottom: 5%; left: 5%; }
#pt8 { bottom: 5%; left: 50%; transform: translateX(-50%); }
#pt9 { bottom: 5%; right: 5%; }

/* Video container - positioned at top center, below progress bar */
#webgazerVideoContainer {
    position: fixed !important;
    top: 160px !important;
    left: 50% !important;
    bottom: auto !important;
    right: auto !important;
    transform: translateX(-50%) scale(0.5) !important;
    transform-origin: top center !important;
    z-index: 1000 !important;
    border: 2px solid #333;
    border-radius: 8px;
    overflow: hidden;
}

/* Hide the face feedback box - it doesn't scale properly with resized video */
#webgazerFaceFeedbackBox {
    display: none !important;
}

/* WebGazer gaze prediction dot */
#webgazerGazeDot {
    z-index: 999 !important;
}

/* Error phase */
#error-phase .container {
    max-width: 500px;
}

#error-message {
    font-size: 14px;
    color: #721c24;
    background-color: #f8d7da;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

.skip-link {
    display: inline-block;
    margin-top: 20px;
    color: #666;
    font-size: 14px;
    text-decoration: underline;
}

.skip-link:hover {
    color: #333;
}
