/* Risk Survey Task - Minimalistic Design */

/* Import better fonts */
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;500;600;700&display=swap');

/* CSS Variables for consistent spacing */
:root {
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --border-radius: 4px;
    --border: 1px solid #e5e5e5;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --text-primary: #333;
    --text-secondary: #666;
    --text-light: #999;
    --background: #fff;
    --background-light: #fafafa;
    --risk-red: #dc2626;
    --risk-blue: #2563eb;
    --safe-gray: #2d3748;
    --selected-border: #333;
}

/* Reset and base styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    font-weight: 400;
    font-size: 16px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Main content container */
.main-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: var(--spacing-xl);
    background: var(--background);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Trial-specific container for single-page layout */
.main-container.trial-container-page {
    height: 100vh;
    max-height: 100vh;
    padding: var(--spacing-lg);
    justify-content: space-between;
    overflow: hidden;
    box-sizing: border-box;
}

/* Attention check container for centered layout */
.main-container.attention-check-page {
    height: 100vh;
    max-height: 100vh;
    padding: var(--spacing-lg);
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
}

.jspsych-content {
    max-width: 100%;
    margin: 0;
    background: transparent;
    padding: 0;
}

.jspsych-content-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Trial container */
.trial-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 144px;
    margin: var(--spacing-lg) 0;
    min-height: 450px;
}

/* Option container */
.option-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0;
    border: none;
    background: none;
    min-width: 0;
}

/* New class for the inner option wrapper */
.option {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* New class for option labels */
.option-label {
    font-weight: 600;
    font-size: 18px;
    color: var(--text-primary);
    padding: var(--spacing-sm) 0;
}

/* Bar styles */
.risk-bar {
    position: relative;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.risk-bar-red {
    background: var(--risk-red);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    padding: 2px;
}

.risk-bar-blue {
    background: var(--risk-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    padding: 2px;
}

.safe-bar {
    background: var(--safe-gray);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

/* Size classes */
.size-large {
    width: 140px;
    height: 280px;
    font-size: 14px;
}

.size-small {
    width: 90px;
    height: 160px;
    font-size: 11px;
}

/* Confidence slider */
.confidence-container {
    text-align: center;
    margin: var(--spacing-sm) 0;
    flex-shrink: 0;
}

.confidence-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.confidence-slider {
    width: 300px;
    height: 6px;
    border-radius: 3px;
    background: var(--text-light);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.confidence-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--text-primary);
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

.confidence-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--text-primary);
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

/* Disabled confidence slider styles */
.confidence-slider:disabled {
    background: #e0e0e0;
    cursor: not-allowed;
    opacity: 0.5;
}

.confidence-slider:disabled::-webkit-slider-thumb {
    background: #bbb;
    cursor: not-allowed;
}

.confidence-slider:disabled::-moz-range-thumb {
    background: #bbb;
    cursor: not-allowed;
}

.confidence-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: var(--spacing-xs);
}

/* Navigation */
.navigation {
    text-align: center;
    margin-top: var(--spacing-sm);
    margin-bottom: 0;
    flex-shrink: 0;
}

.next-button {
    padding: 0.5rem var(--spacing-lg);
    background: var(--text-primary);
    color: var(--background);
    border: none;
    border-radius: var(--border-radius);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    min-width: 120px;
    height: 32px;
}

.next-button:disabled {
    background: var(--text-light);
    cursor: not-allowed;
}

.trial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 14px;
    flex-shrink: 0;
}

/* Instructions */
.instructions {
    text-align: center;
    margin: var(--spacing-xl) 0 var(--spacing-sm);
    line-height: 1.7;
    color: var(--text-primary);
}

.instructions h2 {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 24px;
    margin-bottom: var(--spacing-md);
}

.instructions p {
    font-size: 16px;
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
}

.instructions ul {
    text-align: left;
    max-width: 500px;
    margin: var(--spacing-md) auto;
    padding-left: var(--spacing-lg);
}

.instructions li {
    margin-bottom: var(--spacing-sm);
    font-size: 16px;
    color: var(--text-secondary);
}

/* Timer */
.timer {
    position: fixed;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: var(--text-primary);
    color: var(--background);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 14px;
}

/* Selection highlight */
.selected-bar {
    outline: 4px solid #000 !important;
    outline-offset: 0;
    border: none !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .main-container {
        margin: var(--spacing-sm);
        padding: var(--spacing-lg);
        min-height: 50vh;
    }
    
    .main-container.trial-container-page {
        margin: var(--spacing-xs);
        padding: var(--spacing-md);
        height: 100vh;
        max-height: 100vh;
    }
    
    .main-container.attention-check-page {
        margin: var(--spacing-xs);
        padding: var(--spacing-md);
        height: 100vh;
        max-height: 100vh;
    }
    
    .bars-area {
        gap: var(--spacing-lg);
        min-height: 200px;
        max-height: 300px;
    }
    
    .size-large {
        width: 100px;
        height: 200px;
        font-size: 12px;
    }
    
    .size-small {
        width: 70px;
        height: 120px;
        font-size: 10px;
    }
    
    .confidence-slider {
        width: 250px;
    }
    
    .confidence-label {
        font-size: 13px;
    }
    
    .trial-header {
        font-size: 12px;
        margin-bottom: var(--spacing-xs);
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: var(--spacing-md);
        margin: var(--spacing-xs);
    }
    
    .main-container.trial-container-page {
        padding: var(--spacing-sm);
        margin: 0;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .main-container.attention-check-page {
        padding: var(--spacing-sm);
        margin: 0;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .bars-area {
        gap: var(--spacing-md);
        min-height: 180px;
        max-height: 250px;
    }
    
    .size-large {
        width: 80px;
        height: 160px;
        font-size: 11px;
    }
    
    .size-small {
        width: 60px;
        height: 100px;
        font-size: 9px;
    }
    
    .confidence-slider {
        width: 200px;
    }
    
    .confidence-label {
        font-size: 12px;
    }
    
    .next-button {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 13px;
    }
}

.bars-area {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3.5rem;
    flex: 1;
    min-height: 300px;
    max-height: 400px;
    margin: var(--spacing-sm) 0;
}

/* Hide jsPsych instructions previous button when not wanted */
.no-prev-btn .jspsych-btn:first-child {
    display: none !important;
}

/* Style all jsPsych navigation and response buttons like .next-button */
.jspsych-btn, .jspsych-html-button-response-button {
    padding: 0 var(--spacing-lg);
    background: var(--text-primary);
    color: var(--background);
    border: none;
    border-radius: var(--border-radius);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    min-width: 120px;
    height: 32px;
    margin: 0 0.5rem;
    text-align: center;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.jspsych-btn:disabled, .jspsych-html-button-response-button:disabled {
    background: var(--text-light);
    cursor: not-allowed;
}

/* Remove hover/active/focus color changes for all main buttons */
.jspsych-btn:hover, .jspsych-btn:active, .jspsych-btn:focus,
.jspsych-html-button-response-button:hover, .jspsych-html-button-response-button:active, .jspsych-html-button-response-button:focus,
.next-button:hover, .next-button:active, .next-button:focus {
    background: var(--text-primary) !important;
    color: var(--background) !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Vertically center all content on the screen */
#jspsych-display-element {
    /* min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center; */
}

.centered-text {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

/* Reduce spacing for the final instruction text */
.instruction-footer {
    margin-bottom: 0 !important;
}

/* Control spacing above instruction navigation buttons */
#jspsych-instructions-nav {
    margin-top: 0;
}

.attention-check-prompt {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm);
    border-radius: var(--border-radius);
    background-color: var(--background-light);
    text-align: center;
}

/* Attention Check Styles */
.attention-check-container {
    width: 700px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

.attention-check-prompt,
.attention-check-options,
.attention-check-likert,
.attention-warning,
.attention-check-input {
    width: 700px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.attention-check-options, .attention-check-likert {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0.5rem 0 1rem 0;
}

.attention-check-option {
    display: flex;
    align-items: center;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.attention-check-option:hover {
    background-color: var(--background-light);
}

.attention-check-option input[type="radio"] {
    margin-right: var(--spacing-sm);
    transform: scale(1.2);
}

.attention-check-option span {
    font-size: 15px;
    color: var(--text-primary);
}

.attention-check-input input[type="text"] {
    width: 100%;
    padding: var(--spacing-sm);
    font-size: 16px;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    background-color: var(--background);
    color: var(--text-primary);
}

.attention-check-input input[type="text"]:focus {
    outline: none;
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px rgba(51, 51, 51, 0.1);
}

.attention-warning {
    color: var(--risk-red);
    font-weight: bold;
    margin-top: var(--spacing-sm);
    text-align: center;
    font-size: 16px;
}

/* Instruction-specific bar styling */
.instruction-bar {
    border: 2px solid #ddd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.instruction-bar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Image Valuation Study - Minimalistic Design */

/* Image Valuation Specific Styles */
.image-display {
    text-align: center;
    margin: 2rem 0;
}

/* Specific spacing for medium images in phase 2 */
.image-display.medium-image {
    margin: 1.5rem 0 1rem 0; /* Less margin bottom to bring questions closer */
}

.food-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.food-image.large {
    max-width: 800px;
}

.food-image.medium {
    max-width: 520px;
}

.food-image.small {
    max-width: 235px;
}

.question-container {
    margin: 1.5rem 0;
    padding: 1rem;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #fafafa;
}

/* Specific spacing adjustment for medium-sized images */
.food-image.medium + .question-container,
.medium-image .question-container {
    margin: 1rem 0; /* Reduced from 1.5rem to move questions closer */
}

.question-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
    font-size: 16px;
}

.radio-options {
    display: flex;
    gap: 1rem;
    margin: 0.5rem 0;
}

.radio-options label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.payment-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 0.5rem 0;
}

.slider-container {
    margin: 1rem 0;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-top: 0.25rem;
    color: var(--text-secondary);
}

.phase-progress {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
    margin: 1rem 0;
} 

/* Size reference lines for image display */
.size-reference-container {
    position: relative;
    display: inline-block;
    margin: 0 100px 100px 100px; /* Extra space for extended reference lines and text */
}

.size-reference-line {
    background: #333;
    position: absolute;
}

.size-reference-line.horizontal {
    height: 1px;
    width: 30px;
}

.size-reference-line.vertical {
    width: 1px;
    height: 30px;
}

.size-reference-text {
    position: absolute;
    font-size: 12px;
    color: #333;
    font-weight: 500;
    user-select: none;
}

.size-reference-text.vertical {
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* Scale bar styling for Phase 1 */
.scale-bar {
    text-align: center;
    margin: 20px 0;
    font-size: 14px;
    color: #666;
    font-family: Arial, sans-serif;
    font-weight: 500;
}

/* Dimension lines - industry standard style */
.dimension-text-bg, .dimension-text-side-bg {
    font-family: Arial, sans-serif;
    line-height: 1;
    white-space: nowrap;
}

/* Responsive adjustments for size reference lines */
@media (max-width: 768px) {
    .size-reference-container {
        margin: 0 40px 40px 40px;
    }
    
    .size-reference-line.horizontal {
        width: 20px;
    }
    
    .size-reference-line.vertical {
        height: 20px;
    }
    
    .size-reference-text {
        font-size: 10px;
    }
    
    .scale-bar {
        font-size: 12px;
        margin: 15px 0;
    }
}

@media (max-width: 480px) {
    .size-reference-container {
        margin: 0 30px 30px 30px;
    }
    
    .size-reference-line.horizontal {
        width: 15px;
    }
    
    .size-reference-line.vertical {
        height: 15px;
    }
    
    .size-reference-text {
        font-size: 9px;
    }
    
    .scale-bar {
        font-size: 11px;
        margin: 12px 0;
    }
} 

/* Attention check instruction styling */
.attention-instruction-box {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #666;
    border: 1px solid #e9ecef;
}

.attention-instruction-text {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
    font-style: italic;
    line-height: 1.4;
}

.attention-question-prompt {
    font-size: 18px;
    margin-bottom: 1.5rem;
    font-weight: 500;
    color: #212529;
    line-height: 1.5;
}

/* Responsive styling for attention checks */
@media (max-width: 768px) {
    .attention-instruction-box {
        padding: 0.75rem;
        margin-top: 1rem;
    }
    
    .attention-instruction-text {
        font-size: 13px;
    }
    
    .attention-question-prompt {
        font-size: 16px;
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .attention-instruction-box {
        padding: 0.5rem;
    }
    
    .attention-instruction-text {
        font-size: 12px;
    }
    
    .attention-question-prompt {
        font-size: 15px;
    }
} 