/* Vision Test Specific Styles */

.vision-test-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 200px);
}

/* Step Indicator */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    padding: 0 20px;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
    padding: 0 10px;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    right: -50%;
    width: 100%;
    height: 2px;
    background: #e5e7eb;
    z-index: -1;
}

.step.active:not(:last-child)::after,
.step.completed:not(:last-child)::after {
    background: var(--primary-color);
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-weight: bold;
    transition: all 0.3s;
}

.step.active .step-number {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.step.completed .step-number {
    background: var(--success-color);
    color: white;
}

.step-title {
    font-size: 14px;
    color: #6b7280;
}

.step.active .step-title {
    color: var(--primary-color);
    font-weight: 600;
}

/* Test Steps */
.test-step {
    display: none;
    animation: fadeIn 0.5s;
}

.test-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-content {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.step-content h2 {
    text-align: center;
    color: var(--text-dark);
    margin-bottom: 32px;
    font-size: 28px;
}

.step-content h2 i {
    color: var(--primary-color);
    margin-right: 12px;
}

/* Instructions */
.instructions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.instruction-item {
    text-align: center;
    padding: 24px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.3s;
}

.instruction-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
}

.instruction-item i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.instruction-item h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.instruction-item p {
    font-size: 14px;
    color: var(--text-light);
}

/* Disclaimer */
.disclaimer {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 16px 20px;
    margin: 32px 0;
    border-radius: 4px;
}

.disclaimer i {
    color: #f59e0b;
    margin-right: 8px;
}

.disclaimer p {
    margin: 0;
    font-size: 14px;
    color: #78350f;
    line-height: 1.6;
}

/* Buttons */
.btn-large {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    font-size: 18px;
}

/* Camera Container */
.camera-container {
    position: relative;
    max-width: 640px;
    margin: 0 auto 24px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

#videoElement {
    width: 100%;
    height: auto;
    display: block;
}

#canvasElement {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.face-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.guide-oval {
    width: 300px;
    height: 400px;
    border: 3px dashed rgba(37, 99, 235, 0.6);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* Detection Status */
.detection-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.status-item {
    background: #f9fafb;
    padding: 12px 16px;
    border-radius: 8px;
    text-align: center;
}

.status-label {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.status-value {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.status-value.success {
    color: var(--success-color);
}

.status-value.warning {
    color: var(--warning-color);
}

.instruction-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 24px;
}

.instruction-box p {
    margin: 0;
    color: #1e40af;
    font-weight: 500;
}

/* Vision Chart */
.test-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
}

.vision-chart-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto 32px;
    min-height: 400px;
    background: #f9fafb;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#visionChart {
    width: 100%;
    height: 400px;
}

.eye-cover-instruction {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(37, 99, 235, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    font-weight: 600;
}

/* Direction Buttons */
.direction-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.direction-row {
    display: flex;
    gap: 16px;
}

.direction-btn {
    width: 80px;
    height: 80px;
    border: 2px solid var(--primary-color);
    background: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.direction-btn i {
    font-size: 32px;
    color: var(--primary-color);
}

.direction-btn:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

.direction-btn:hover i {
    color: white;
}

.direction-btn:active {
    transform: scale(0.95);
}

.test-controls {
    text-align: center;
}

/* Results */
.results-container {
    max-width: 800px;
    margin: 0 auto;
}

.confidence-score {
    text-align: center;
    margin-bottom: 40px;
}

.score-circle {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 16px;
}

.score-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-bg {
    fill: none;
    stroke: #e5e7eb;
    stroke-width: 8;
}

.score-fill {
    fill: none;
    stroke: var(--success-color);
    stroke-width: 8;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 1s ease;
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-text span {
    display: block;
    font-size: 48px;
    font-weight: bold;
    color: var(--success-color);
}

.score-text small {
    font-size: 14px;
    color: var(--text-light);
}

#confidenceMessage {
    font-size: 18px;
    color: var(--text-dark);
    font-weight: 600;
}

.vision-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.result-card {
    background: #f9fafb;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
}

.result-card h3 {
    font-size: 18px;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.result-card h3 i {
    color: var(--primary-color);
    margin-right: 8px;
}

.result-value {
    font-size: 48px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.result-range {
    font-size: 14px;
    color: var(--text-light);
}

.additional-measurements {
    background: #f9fafb;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 32px;
}

.measurement-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.measurement-item:last-child {
    border-bottom: none;
}

.measurement-label {
    font-weight: 500;
    color: var(--text-dark);
}

.measurement-value {
    font-weight: 600;
    color: var(--primary-color);
}

.result-disclaimer {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 32px;
}

.result-disclaimer i {
    color: var(--primary-color);
    margin-right: 8px;
}

.result-disclaimer p {
    margin: 0;
    color: #1e40af;
    font-size: 14px;
}

.result-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 768px) {
    .step-indicator {
        padding: 0 10px;
    }

    .step-title {
        font-size: 12px;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .step-content {
        padding: 24px 16px;
    }

    .step-content h2 {
        font-size: 22px;
    }

    .instructions {
        grid-template-columns: 1fr;
    }

    .direction-btn {
        width: 60px;
        height: 60px;
    }

    .direction-btn i {
        font-size: 24px;
    }

    .result-value {
        font-size: 36px;
    }

    .result-actions {
        flex-direction: column;
    }

    .result-actions .btn {
        width: 100%;
    }
}
