/* Clean Psychometric Measures Styling - No Navbar Conflicts */
/* Note: Navbar styles are handled in style.css with unified .protocol-nav/.psychometric-nav rules */

/* Psychometric table container */
.psychometric-table-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    margin-bottom: 3rem;
}

.measure-selector {
    margin-bottom: 2rem;
}

.measure-selector h3 {
    margin-bottom: 1rem;
    color: var(--primary, #2c6cb1);
}

.measure-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.measure-btn {
    padding: 10px 20px;
    border: 2px solid var(--primary, #2c6cb1);
    background: white;
    color: var(--primary, #2c6cb1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.measure-btn:hover {
    background: var(--primary, #2c6cb1);
    color: white;
}

.measure-btn.active {
    background: var(--primary, #2c6cb1);
    color: white;
    box-shadow: 0 4px 8px rgba(44, 108, 177, 0.3);
}

.measure-info {
    background: var(--light-bg, #f8f9fa);
    border-left: 4px solid var(--primary, #2c6cb1);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 0 8px 8px 0;
}

.measure-info h3 {
    margin-top: 0;
    color: var(--primary, #2c6cb1);
}

.item-count {
    background: var(--secondary, #4a90e2);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

/* Table Container with Fixed Height for 5 Rows */
.table-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    background: white;
    
    /* This will be dynamically set by JavaScript based on row height */
    max-height: 400px; /* Fallback height */
    overflow-y: auto;
}

.measures-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.measures-table th {
    background: var(--primary, #2c6cb1);
    color: white;
    font-weight: 600;
    padding: 15px 12px;
    text-align: left;
    font-size: 14px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.measures-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border, #e9ecef);
    vertical-align: top;
    font-size: 14px;
    line-height: 1.5;
}

.measures-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.measures-table tbody tr:hover {
    background-color: rgba(44, 108, 177, 0.05);
}

.variable-column { 
    font-family: 'Courier New', monospace; 
    font-weight: 600;
    color: var(--primary, #2c6cb1);
    width: 15%;
}

.question-column { 
    width: 45%; 
    line-height: 1.4;
}

.response-column { 
    width: 40%; 
    font-size: 13px;
}

/* Scroll hint */
.scroll-hint {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(44, 108, 177, 0.1));
    text-align: center;
    padding: 10px;
    pointer-events: none;
    z-index: 5;
}

.scroll-hint small {
    color: var(--primary, #2c6cb1);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Loading and Error States */
.loading, .no-data {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted, #6c757d);
}

.no-data {
    font-style: italic;
}

/* Citation Styling */
.citation, .citation-content {
    font-family: 'Georgia', serif;
    font-size: 14px;
    line-height: 1.6;
    color: #444;
    margin: 12px 0;
    padding: 15px 20px;
    background-color: #fafafa;
    border-left: 3px solid #e15759;
    border-radius: 4px;
}

.citation .author { 
    font-weight: 600; 
    color: #333; 
}

.citation .year { 
    color: #666; 
}

.citation .title { 
    font-style: italic; 
}

.citation .journal { 
    color: #555; 
}

.citation .volume, 
.citation .pages { 
    color: #666; 
}

.citation .url { 
    word-break: break-all; 
    margin-top: 8px; 
}

.citation .url a { 
    color: #4e79a7; 
    text-decoration: none; 
    border-bottom: 1px dotted #4e79a7; 
}

.citation .url a:hover { 
    color: #e15759; 
    border-bottom-style: solid; 
}

/* Response Options Styling */
.response-options {
    margin: 0;
    padding-left: 1.8rem;
    list-style-type: none;
}

.response-options li {
    margin-bottom: 0.6rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.response-options li:last-child {
    border-bottom: none;
}

/* Default arrow for unspecified field types */
.response-options li::before {
    content: "▸";
    color: var(--secondary, #4a90e2) !important;
    font-weight: bold !important;
    position: absolute !important;
    left: -1.5rem !important;
    font-size: 0.9em !important;
    top: 0.25rem !important;
}

/* Circle for radio button options */
.response-options-radio li::before {
    content: "" !important;
    width: 16px !important;
    height: 16px !important;
    border: 2px solid var(--secondary, #4a90e2) !important;
    border-radius: 50% !important;
    background: white !important;
    position: absolute !important;
    left: -1.5rem !important;
    top: 0.3rem !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
}

/* Square for checkbox options */
.response-options-checkbox li::before {
    content: "" !important;
    width: 16px !important;
    height: 16px !important;
    border: 2px solid var(--secondary, #4a90e2) !important;
    border-radius: 2px !important;
    background: white !important;
    position: absolute !important;
    left: -1.5rem !important;
    top: 0.3rem !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
}

/* Simple Slider Visualization Styles */
.simple-slider-container {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.simple-slider-track {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.simple-slider-endpoint {
    text-align: center;
    min-width: 100px;
    flex-shrink: 0;
}

.simple-slider-left {
    text-align: left;
}

.simple-slider-right {
    text-align: right;
}

.simple-slider-label {
    font-size: 0.9em;
    color: #333;
    font-weight: 500;
    line-height: 1.3;
}

.simple-slider-bar {
    flex: 1;
    position: relative;
    height: 12px;
    margin: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.simple-slider-line {
    width: 100%;
    height: 6px;
    background: var(--primary, #2c6cb1);
    border-radius: 3px;
    position: relative;
}

.simple-slider-thumb {
    position: absolute;
    top: 50%;
    width: 16px;
    height: 16px;
    background: white;
    border: 3px solid var(--primary, #2c6cb1);
    border-radius: 50%;
    transform: translateY(-50%);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    z-index: 2;
}

.simple-slider-thumb-left {
    left: -8px;
}

.simple-slider-thumb-right {
    right: -8px;
}

/* Add a center thumb for visual appeal */
.simple-slider-line::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid var(--secondary, #4a90e2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 3;
}

.simple-slider-values {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding: 0 1rem;
}

.simple-slider-min,
.simple-slider-max {
    font-size: 0.85em;
    font-weight: bold;
    color: var(--primary, #2c6cb1);
    background: rgba(44, 108, 177, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Text Field Visualization Styles */
.text-field-container {
    margin: 0.5rem 0;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.text-field-display {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    background: white;
    font-size: 0.9em;
    color: #666;
    font-family: inherit;
    resize: none;
    cursor: not-allowed;
}

.text-field-display:focus {
    outline: none;
    border-color: var(--secondary, #4a90e2);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.text-validation-info {
    margin-top: 0.5rem;
    padding: 0.375rem 0.5rem;
    background: rgba(44, 108, 177, 0.05);
    border-radius: 3px;
    border-left: 3px solid var(--secondary, #4a90e2);
}

.text-validation-info small {
    color: #666;
    font-size: 0.8em;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .psychometric-table-container {
        padding: 1rem;
    }
    
    .measure-buttons {
        flex-direction: column;
    }
    
    .measure-btn {
        width: 100%;
        text-align: center;
    }
    
    .measures-table {
        font-size: 12px;
    }
    
    .measures-table th,
    .measures-table td {
        padding: 8px;
    }
    
    .variable-column {
        width: 20%;
    }
    
    .question-column {
        width: 50%;
    }
    
    .response-column {
        width: 30%;
    }
    
    .simple-slider-track {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .simple-slider-bar {
        order: 2;
        margin: 0;
        width: 100%;
    }
    
    .simple-slider-left {
        order: 1;
        text-align: center;
    }
    
    .simple-slider-right {
        order: 3;
        text-align: center;
    }
    
    .simple-slider-endpoint {
        min-width: auto;
        width: 100%;
    }
    
    .text-field-display {
        font-size: 0.85em;
    }
    
    .response-options {
        padding-left: 1.5rem;
    }
    
    .response-options-radio li::before,
    .response-options-checkbox li::before {
        width: 14px !important;
        height: 14px !important;
        left: -1.2rem !important;
    }
}

@media (max-width: 480px) {
    .simple-slider-label {
        font-size: 0.85em;
    }
    
    .text-field-container {
        padding: 0.5rem;
    }
}

/* Smaller Side-by-Side Images with Set Caption - Add to psychometric.css */

.image-set-container {
    margin: 2rem 0;
    max-width: 800px; /* Limit overall width to make images smaller */
    margin-left: auto;
    margin-right: auto;
}

.image-set-caption {
    text-align: center;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-left: 4px solid var(--primary, #2c6cb1);
    border-radius: 0 6px 6px 0;
    font-size: 0.9rem;
    color: #495057;
    font-weight: 500;
}

.image-set-caption strong {
    color: var(--primary, #2c6cb1);
}

.image-pair-small {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
}

.image-pair-small img {
    width: 100%;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.image-pair-small img:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.image-individual-caption {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
}

/* Even smaller variant */
.image-set-container-xs {
    margin: 1.5rem 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.image-pair-xs img {
    height: 150px; /* Extra small */
}

/* Medium size variant */
.image-set-container-md {
    margin: 2rem 0;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.image-pair-md img {
    height: 250px; /* Medium size */
}

/* Bottom caption variant */
.image-set-caption-bottom {
    text-align: center;
    margin-top: 1rem;
    margin-bottom: 0;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-left: 4px solid var(--primary, #2c6cb1);
    border-radius: 0 6px 6px 0;
    font-size: 0.9rem;
    color: #495057;
    font-style: italic;
}

/* Compact layout - even smaller overall */
.image-set-compact {
    margin: 1.5rem 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.image-set-compact .image-pair-small {
    gap: 0.75rem;
}

.image-set-compact img {
    height: 120px;
    border-radius: 4px;
}

.image-set-compact .image-set-caption {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .image-set-container,
    .image-set-container-xs,
    .image-set-container-md,
    .image-set-compact {
        max-width: 100%;
        margin: 1.5rem 0;
        padding: 0 1rem;
    }
    
    .image-pair-small,
    .image-pair-xs,
    .image-pair-md {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .image-pair-small img,
    .image-pair-md img {
        height: 180px;
    }
    
    .image-pair-xs img {
        height: 140px;
    }
    
    .image-set-compact img {
        height: 100px;
    }
}

@media (max-width: 480px) {
    .image-pair-small img,
    .image-pair-md img {
        height: 160px;
    }
    
    .image-pair-xs img {
        height: 120px;
    }
    
    .image-set-compact img {
        height: 90px;
    }
    
    .image-set-caption,
    .image-set-caption-bottom {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
}

/* fMRI Acquisition Parameters Styling - Add to psychometric.css */

.acquisition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.acquisition-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.25rem;
    border-left: 4px solid var(--secondary, #4a90e2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.acquisition-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.acquisition-section h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary, #2c6cb1);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.acquisition-section h4::before {
    content: "▸";
    color: var(--secondary, #4a90e2);
    font-size: 0.8em;
}

.param-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.param-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

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

.param-label {
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
    flex: 1;
    min-width: 0;
}

.param-value {
    font-family: 'Courier New', monospace;
    color: var(--primary, #2c6cb1);
    font-weight: 600;
    font-size: 0.9rem;
    text-align: right;
    flex-shrink: 0;
    margin-left: 1rem;
}

.technical-note {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
    border-left: 4px solid var(--primary, #2c6cb1);
}

.technical-note h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary, #2c6cb1);
    font-size: 1rem;
    font-weight: 600;
}

.technical-note ul {
    margin: 0;
    padding-left: 1.5rem;
    list-style: none;
}

.technical-note li {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.5;
    font-size: 0.9rem;
    color: #495057;
}

.technical-note li::before {
    content: "🔧";
    position: absolute;
    left: 0;
    top: 0;
    font-size: 0.9em;
}

.technical-note li:last-child {
    margin-bottom: 0;
}

.technical-note strong {
    color: var(--primary, #2c6cb1);
    font-weight: 600;
}

.task-description {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
    border-left: 4px solid #fd7e14;
}

.task-description h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #856404;
    font-size: 1rem;
    font-weight: 600;
}

.task-description p {
    margin: 0;
    color: #856404;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .acquisition-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .acquisition-section {
        padding: 1rem;
    }
    
    .param-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .param-value {
        text-align: left;
        margin-left: 0;
        font-size: 0.85rem;
    }
    
    .param-label {
        font-size: 0.85rem;
    }
    
    .technical-note,
    .task-description {
        padding: 1rem;
    }
    
    .technical-note li {
        font-size: 0.85rem;
        padding-left: 1.25rem;
    }
}

@media (max-width: 480px) {
    .acquisition-section h4 {
        font-size: 0.9rem;
    }
    
    .param-label,
    .param-value {
        font-size: 0.8rem;
    }
    
    .technical-note h4,
    .task-description h4 {
        font-size: 0.9rem;
    }
    
    .technical-note li {
        font-size: 0.8rem;
    }
    
    .task-description p {
        font-size: 0.85rem;
    }
}

.app-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 180px);
    min-height: 600px;
    margin: 0;
}

.app-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}
