* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

.notification-popup {
    animation: slideIn 0.3s ease, pulse 2s infinite;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: white;
    min-height: calc(100vh - 180px);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 20px 30px;
    text-align: left;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 14px;
    opacity: 0.9;
}

/* Compact Header Styles */
.compact-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.header-title {
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.compact-pair-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.compact-slider-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    margin: 0;
}

.compact-pair-selector .pair-slider {
    width: 120px;
    height: 4px;
    margin: 0;
}

.pair-slider {
    width: 200px;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(135deg, #007bff 0%, #6c757d 100%);
    outline: none;
    opacity: 0.8;
    transition: opacity 0.2s;
    -webkit-appearance: none;
    margin: 0 10px;
}

.pair-slider:hover {
    opacity: 1;
}

.pair-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: 2px solid #007bff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.pair-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: 2px solid #007bff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.slider-current {
    font-size: 12px;
    color: #495057;
    margin-left: 10px;
    font-weight: 500;
    min-width: 60px;
}

.compact-slider-current {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    min-width: 50px;
}

/* Navigation buttons */
.nav-btn {
    background: #007bff;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin: 0 5px;
}

.nav-btn:hover {
    background: #0056b3;
    transform: scale(1.1);
}

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

.nav-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

/* Main content area */
.main-content {
    padding: 20px 30px;
}

.images-section {
    margin-bottom: 30px;
}

.charts-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.image-container {
    flex: 1;
}

.image-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.image-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.image-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.image-header h3 {
    margin: 0;
    color: #495057;
    font-size: 18px;
    font-weight: 600;
}

.score {
    background: #e9ecef;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
}

.image-placeholder {
    position: relative;
    min-height: 300px;
    border: 2px dashed #dee2e6;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    margin-bottom: 15px;
}

.chart-image {
    max-width: 100%;
    max-height: 500px;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.chart-image:hover {
    transform: scale(1.02);
}

.placeholder-text {
    color: #6c757d;
    font-size: 14px;
    text-align: center;
}

.metrics {
    margin-bottom: 15px;
}

.metric-row {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: #6c757d;
}

.metric-row span {
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.description {
    font-size: 14px;
    color: #6c757d;
    line-height: 1.5;
    margin: 0;
}

/* Navigation Controls */
.navigation-controls {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin: 20px 0;
}

.navigation-controls h4 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 16px;
}

.nav-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Question Display */
.question-display {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-left: 4px solid #1976d2;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
}

.question-display h3 {
    margin-bottom: 10px;
    color: #1565c0;
    font-size: 16px;
}

.question-display p {
    margin: 0;
    color: #0d47a1;
    font-weight: 500;
    line-height: 1.6;
}

/* Modal overlay styles */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background-color: white;
    padding: 0;
    border-radius: 10px;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 10px 10px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #495057;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: #e9ecef;
    color: #495057;
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

/* Image modal specific styles */
.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
}

.image-modal.show {
    display: flex;
}

.image-modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10001;
}

.image-modal-close:hover,
.image-modal-close:focus {
    color: #bbb;
    text-decoration: none;
}

#modalImage {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

/* Evaluation form styles */
.simple-evaluation-form {
    background: white;
    border-radius: 10px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.chart-evaluation-sections {
    margin-bottom: 30px;
}

.chart-section, .preference-section, .comments-section {
    margin-bottom: 10px;
    padding: 5px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
}

.chart-section h3, .preference-section h3, .comments-section h3 {
    color: #495057;
    margin-bottom: 12px;
    font-size: 1.05em;
    font-weight: 600;
}

/* Radio group styling (unchanged from original) */
.radio-group, .radio-group.horizontal {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-group.horizontal {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
}

.radio-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    transition: all 0.2s ease;
    position: relative;
}

.radio-item:hover {
    border-color: #007bff;
    background-color: #f0f8ff;
    transform: translateY(-1px);
    box-shadow: 0 1px 4px rgba(0, 123, 255, 0.1);
}

.radio-item input {
    margin-right: 10px;
    transform: scale(1.1);
    cursor: pointer;
}

.radio-item input[type="radio"]:checked + .radio-button {
    background-color: #007bff;
    border-color: #007bff;
}

.radio-item.checked {
    border-color: #007bff;
    background-color: #e3f2fd;
}

.radio-button {
    width: 16px;
    height: 16px;
    border: 1px solid #ddd;
    margin-right: 10px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    border-radius: 50%;
}

.radio-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-item span:last-child {
    color: #495057;
    font-size: 0.9em;
    font-weight: 500;
}

/* Slider-specific styles - replacing checkbox styles */
.slider-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.slider-group.horizontal {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.slider-container {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.slider-container:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.slider-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: #495057;
}

.slider-current-value {
    font-weight: 600;
    font-size: 0.95em;
    min-width: 120px;
    text-align: right;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f8f9fa;
    transition: color 0.2s ease;
}

/* Slider wrapper — bar flanked by endpoint labels */
.slider-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin: 4px 0;
}

/* Enhanced slider styling for discrete positions */
.evaluation-slider {
    flex: 0 0 180px;
    width: 240px;
    height: 3px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
    opacity: 0.8;
    transition: opacity 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    cursor: pointer;
}

.discrete-slider {
    background: linear-gradient(to right, #dc3545 0%, #dc3545 25%, #ffc107 25%, #ffc107 50%, #17a2b8 50%, #17a2b8 75%, #28a745 75%, #28a745 100%);
}

.evaluation-slider:hover {
    opacity: 1;
    box-shadow: 0 2px 8px rgba(0,123,255,0.3);
}

.evaluation-slider:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.25);
}

/* Slider thumb styling for discrete positions */
.evaluation-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 24px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.evaluation-slider::-webkit-slider-thumb:hover {
    background: #0056b3;
    transform: scale(1.2);
    box-shadow: 0 3px 12px rgba(0,0,0,0.4);
}

.evaluation-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.evaluation-slider::-moz-range-thumb:hover {
    background: #0056b3;
    transform: scale(1.2);
    box-shadow: 0 3px 12px rgba(0,0,0,0.4);
}

/* Slider track styling */
.evaluation-slider::-webkit-slider-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: transparent;
    border-radius: 5px;
    border: none;
}

.evaluation-slider::-moz-range-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: transparent;
    border-radius: 5px;
    border: none;
}

/* Tooltip styling */
.slider-tooltips {
    position: relative;
    height: 0;
    pointer-events: none;
}

.slider-tooltip {
    position: absolute;
    bottom: 30px;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    pointer-events: auto;
}

.slider-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
}

.slider-tooltip small {
    display: block;
    font-size: 10px;
    opacity: 0.8;
    margin-top: 2px;
}

/* Show tooltip on hover over slider thumb area - enhanced for discrete positioning */
.slider-wrapper:hover .slider-tooltip {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Active tooltip based on current slider value */
.slider-wrapper .slider-tooltip.active {
    opacity: 1 !important;
    visibility: visible !important;
    animation: tooltipBounce 0.3s ease;
}

/* Individual tooltip positioning based on slider value */
.discrete-slider[value="0"] ~ .slider-tooltips .slider-tooltip[data-position="0"],
.discrete-slider[value="1"] ~ .slider-tooltips .slider-tooltip[data-position="1"],  
.discrete-slider[value="2"] ~ .slider-tooltips .slider-tooltip[data-position="2"],
.discrete-slider[value="3"] ~ .slider-tooltips .slider-tooltip[data-position="3"] {
    opacity: 1;
    visibility: visible;
    animation: tooltipBounce 0.3s ease;
}

/* Show tooltips when hovering over slider wrapper */
.slider-wrapper:hover .slider-tooltip[data-position="0"]:not(.active),
.slider-wrapper:hover .slider-tooltip[data-position="1"]:not(.active),
.slider-wrapper:hover .slider-tooltip[data-position="2"]:not(.active),
.slider-wrapper:hover .slider-tooltip[data-position="3"]:not(.active) {
    opacity: 0.6;
    visibility: visible;
}

@keyframes tooltipBounce {
    0% { transform: translateX(-50%) translateY(10px); opacity: 0; }
    50% { transform: translateX(-50%) translateY(-5px); }
    100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* Labels for discrete positions */
.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 0.75em;
    color: #6c757d;
    line-height: 1.2;
    position: relative;
}

.slider-labels span {
    flex: 1;
    text-align: center;
    font-weight: 500;
    padding: 2px 4px;
}

.slider-labels .label-no {
    color: #dc3545;
    text-align: left;
}

.slider-labels .label-neutral-left {
    color: #fd7e14;
}

.slider-labels .label-neutral-right {
    color: #17a2b8;
}

.slider-labels .label-yes {
    color: #28a745;
    text-align: right;
}

/* Flanking endpoint labels on the slider row */
.slider-endpoint-left,
.slider-endpoint-right {
    font-weight: 600;
    padding: 2px 4px;
    box-sizing: border-box;
    font-size: 0.75em;
    margin-top: 5px;
    line-height: 1.2;
    color: #6c757d;
    white-space: nowrap;
}

.slider-endpoint-left {
    color: #dc3545;
    text-align: right;
}

.slider-endpoint-right {
    color: #28a745;
    text-align: left;
}

/* Caption row below the slider */
.slider-description {
    font-size: 0.75em;
    color: #6c757d;
    text-align: center;
    margin-top: 5px;
    font-style: italic;
    min-height: 16px;
    transition: color 0.2s ease;
}

.slider-description .slider-current-value {
    min-width: auto;
    text-align: left;
    font-style: normal;
}

.slider-description .slider-current-value::after {
    content: ' :';
    font-weight: 400;
    color: #495057;
    background: none;
}

/* Question group styling */
.question-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.question-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #007bff;
    transition: all 0.2s ease;
}

.question-item:hover {
    box-shadow: 0 2px 8px rgba(0,123,255,0.1);
}

.question-number {
    font-weight: 600;
    margin-bottom: 15px;
    color: #495057;
    font-size: 1em;
    line-height: 1.5;
}

/* Form actions */
.form-actions {
    padding: 5px 0;
    border-top: 1px solid #1e69b4;
    margin-top: 5px;
    display: flex;
    flex-direction: row-reverse;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
}

.save-btn, .submit-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
}

.save-btn {
    background-color: #6c757d;
    color: white;
}

.save-btn:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

.submit-btn {
    background-color: #007bff;
    color: white;
}

.submit-btn:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

/* Comments section */
.comments-section textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.comments-section textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.25);
}

/* Dataset info styles */
.dataset-info {
    font-size: 0.9em;
    margin-bottom: 8px;
    color: #495057;
}

.assumption-note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-left: 4px solid #ffc107;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #856404;
}

/* Master question section */
.master-question-section {
    padding: 8px 15px;
    background: white;
    border-bottom: 1px solid #e9ecef;
}

/* Suppress any legacy question display above the info buttons */
#currentQuestion {
    display: none !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .charts-row {
        flex-direction: column;
    }
    
    .nav-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .pair-slider {
        width: 100%;
        max-width: 250px;
    }
    
    .radio-group.horizontal {
        flex-direction: column;
        gap: 8px;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .save-btn, .submit-btn {
        width: 100%;
        margin: 5px 0;
    }
    
    .slider-label-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .slider-current-value {
        text-align: left;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 15px 20px;
    }
    
    .image-card {
        padding: 15px;
    }
    
    .simple-evaluation-form {
        padding: 20px 15px;
    }
    
    .chart-section, .preference-section, .comments-section {
        padding: 15px;
    }
}

/* Loading animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* Additional utility classes */
.text-center {
    text-align: center;
}

.text-muted {
    color: #6c757d;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mt-3 {
    margin-top: 1rem;
}

/* Print styles */
@media print {
    .navigation-controls,
    .form-actions,
    .modal-overlay,
    .image-modal {
        display: none;
    }
    
    .image-card {
        break-inside: avoid;
    }
}