/* 
=================================================================
  General & Layout Styles
  These styles define the main look of the page container.
=================================================================
*/

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

body {
    /* Use a modern font stack for broad compatibility */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f4f7; /* Light grey background like in the image */
    color: #333;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Aligns the container to the top */
    min-height: 100vh;
    padding: 40px 20px; /* Adds space at the top and sides */
}

.container {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Soft shadow */
    width: 100%;
    max-width: 800px; /* A fixed width for the content box */
    padding: 40px;
}

/* 
=================================================================
  Screen Management
  This system hides all screens by default and only shows the 
  one with the 'active' class. This is the core of the single-page app.
=================================================================
*/
.screen {
    display: none;
    width: 100%;
}

.screen.active {
    display: block; /* Use block instead of flex for more natural text flow */
}

/* 
=================================================================
  1. Consent Screen Styles
  Styles specifically for the first page to match the image.
=================================================================
*/
.language-selector {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
    font-size: 14px;
}

.lang-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
    font-size: 14px;
}

.consent-content {
    text-align: left; /* Default text alignment */
}

.k3vr-title {
    text-align: center;
    margin-bottom: 10px;
    font-size: 16px;
    color: #555;
}

.consent-content h1 {
    font-size: 24px;
    color: #2c3e50;
    text-align: center;
    font-weight: 600;
}

.consent-content hr {
    border: none;
    border-top: 1px solid #e0e0e0; /* Thin, light separator line */
    margin: 25px 0;
}

.consent-content p, .consent-content li {
    line-height: 1.6;
    font-size: 14px;
    margin-bottom: 1em; /* Space between paragraphs */
}

.consent-content ul {
    padding-left: 20px;
    margin-bottom: 1em;
}

.consent-content strong {
    font-weight: 600;
}

.consent-content a {
    color: #007bff;
    text-decoration: none;
}

.consent-content a:hover {
    text-decoration: underline;
}

.consent-actions {
    margin-top: 30px;
}

.warning-text {
    color: #d9534f; /* Red color for warning */
    font-weight: bold;
}

.data-link {
    display: inline-block;
    margin-bottom: 20px;
}

/* Style for the error message when checkbox is not ticked */
.consent-error {
    color: #721c24;
    font-weight: bold;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 12px;
    border-radius: 4px;
    margin: 20px 0;
}

.consent-checkbox-area {
    margin-top: 20px;
    display: flex;
    align-items: center;
}

.consent-checkbox-area input {
    width: 18px;
    height: 18px;
    margin-right: 10px;
}

.consent-checkbox-area label {
    font-size: 14px;
}

/* Specific style for the "Next" button on the consent screen */
.consent-actions .next-button {
    background-color: #007bff;
    color: white;
    padding: 12px 30px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    float: right; /* Aligns the button to the right */
    margin-top: 20px;
}

/* 
=================================================================
  2. Participant Info Screen Styles
  Styles for the second screen where user enters their details.
=================================================================
*/
.participant-form {
    padding: 30px;
    border-radius: 10px;
}

.participant-form h2 {
    text-align: center;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}
/* 
=================================================================
  4. Demographics Screen Styles (New)
  Styles for the demographic questions page to match the image.
=================================================================
*/
#participantScreen {
    text-align: left;
}

.question-block {
    background-color: #f8f9fa; /* Light grey background for each block */
    border: 1px solid #dee2e6; /* Subtle border */
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px; /* Space between question blocks */
}

.question-block h3 {
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: 600;
}

.asterisk {
    color: #d9534f; /* Red asterisk */
    margin-right: 4px;
}

.instruction-text {
    font-size: 14px;
    color: #007bff; /* Blue color for instructions */
    margin-bottom: 20px;
}

.question-statement {
    font-size: 14px;
    margin-bottom: 15px;
}

.options-group {
    display: flex;
    flex-direction: column;
    gap: 15px; /* Space between radio button options */
}

.radio-option {
    display: flex;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    margin-right: 12px;
    width: 16px;
    height: 16px;
}

.other-option {
    display: flex;
    align-items: center;
}

.other-text-input {
    border: none;
    border-bottom: 1px solid #ccc;
    background-color: transparent;
    margin-left: 8px;
    padding: 4px;
    font-size: 14px;
}

.other-text-input:focus {
    outline: none;
    border-bottom-color: #007bff;
}

/* Position the "Next" button at the bottom right of the container */
#demographicsForm {
    position: relative;
    padding-bottom: 60px; /* Add space at the bottom for the button */
}

#demographicsForm .next-button {
    position: absolute;
    bottom: 0;
    right: 0;
    float: none; /* Override previous float style */
    background-color: #007bff;
    color: white;
}

/* General button style, can be overridden */
.button {
    padding: 12px 30px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
    float: right;
}

/* Specific button for starting the experiment */
.participant-form .button {
    background-color: #28a745; /* Green color */
    color: white;
}
/* 
=================================================================
  5. Instructions Screen Styles (New)
  Styles for the detailed instructions page (page 3).
=================================================================
*/
#instructionsScreen .instructions-box {
    border:none; /* 2px solid #aed6f1; /* Light blue border */
    background-color:  #ffffff; /*#fcfdfe;*/
    /*border-radius: 8px;*/
    padding: 10px;
}

.instruction-section {
    margin-bottom: 40px; /* Space between sections */
}
.instruction-section:last-child {
    margin-bottom: 0;
}

.instruction-title {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.instruction-title .icon {
    font-size: 24px;
    margin-right: 12px;
}

.instruction-title h3 {
    font-size: 18px;
    font-weight: 600;
}

.instruction-content p {
    margin-bottom: 1em;
    font-size: 14px;
    line-height: 1.6;
}

.instruction-content ol {
    padding-left: 20px;
    font-size: 14px;
    line-height: 1.6;
}

.instruction-content li {
    margin-bottom: 1em;
}

.example-slider-image {
    display: block;
    margin: 20px auto; /* Center the image */
    max-width: 350px;
    width: 100%;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Container for the bottom button */
#instructionsScreen .button-container {
    text-align: right;
    margin-top: 20px;
}

#instructionsScreen .next-button {
    background-color: #007bff;
    color: white;
    float: none; /* Override any previous float styles */
    display: inline-block;
}
/* 
=================================================================
  6. Situation Screen Styles (Corrected & Updated)
  Styles to match the new scenario page design.
=================================================================
*/
/* This is the container box that will match the style of the instructions page */
.scenario-container-box {
    border:none; /* 2px solid #aed6f1; /* Light blue border */
    background-color:  #ffffff; /*#fcfdfe;*/
    /*border-radius: 8px;*/
    padding: 10px;

}

.scenario-main-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 30px;
    max-width: 600px;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.scenario-box {
    border: 2px dotted #a0a0a0;
    padding: 30px;
    margin-bottom: 30px;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
}

#situationScreen .situation-text {
    font-size: 16px;
    line-height: 1.7;
    white-space: pre-line;
    color: #333;
    font-weight: 500;
}

.scenario-sub-instruction {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    text-align: center;
}

.video-count {
    font-weight: bold;
    font-size: 18px;
    color: #333;
}

/* We remove the specific button container for the situation screen to use the general one */
#situationScreen .button-container {
    width: 100%;
    margin-top: 20px;
    text-align: right;
}

/* We remove the dotted button style. The general .next-button style will now apply.
   To make sure, we can combine it with the instructions button style */
#instructionsScreen .next-button,
#situationScreen .next-button {
    background-color: #007bff;
    color: white;
    float: none;
    display: inline-block;
    border: none; /* Make sure there's no border */
}

/* This ensures hover effects are consistent too */
#instructionsScreen .next-button:hover,
#situationScreen .next-button:hover {
    background-color: #0056b3;
}

/* 
=================================================================
  3. Styles for the Rest of the Experiment
  These are the original styles needed for the welcome text, 
  situation, fixation cross, video, slider, etc.
=================================================================
*/
.welcome-text, .situation-text, .completion-screen {
    text-align: center;
    padding: 20px;
}

.situation-text {
    white-space: pre-line; /* Respects line breaks in the text */
}

.fixation {
    font-size: 60px;
    font-weight: bold;
    text-align: center;
    padding: 150px 0; /* Augmente l'espace pour mieux centrer verticalement */
}

/* --- Styles pour l'écran de la vidéo --- */
#videoScreen {
    /* On s'assure que cet écran est centré */
    display: none; /* Reste caché par défaut */
    align-items: center;
    justify-content: center;
    min-height: 500px; /* Donne une hauteur minimale à l'écran */
}

#videoScreen.active {
    display: flex; /* Utilise Flexbox pour centrer parfaitement quand il est actif */
}

.video-container {
    width: 100%;
    text-align: center;
}

#experimentVideo {
    /* C'est la règle la plus importante pour la TAILLE de la vidéo */
    max-width: 300px;  /* Définissez ici la largeur maximale souhaitée (ex: 300px) */
    max-height: 75vh; /* La vidéo ne dépassera jamais 75% de la hauteur de l'écran */
    
    /* Assure que la vidéo garde ses proportions et est bien affichée */
    height: auto;
    display: block;
    margin: 0 auto; /* Centre la vidéo horizontalement */
    background-color: #000; /* Fond noir si la vidéo a des bandes */
}

.placeholder-video {
    width: 100%;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #e9ecef;
    color: #6c757d;
    font-size: 16px;
}


/* --- Styles pour l'écran du slider --- */
.slider-container {
    width: 100%;
    text-align: center;
    padding: 60px 0; /* Plus de padding pour faire de la place */
}

.slider-question {
    font-size: 18px;
    margin-bottom: 40px;
}

.slider-interactive-area {
    position: relative; /* Nécessaire pour positionner la valeur */
    margin-bottom: 10px;
}

.slider-value-display {
    position: absolute;
    top: -30px; /* Positionné au-dessus du slider */
    left: 50%; /* Centré par défaut */
    transform: translateX(-50%);
    background-color: #f0f0f0;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

.slider-wrapper {
    position: relative;
    padding: 0 10px;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 14px;
}

.slider-error {
    color: #d9534f;
    font-weight: bold;
    margin-top: 20px;
    font-size: 16px;
}

/* --- Style personnalisé du slider --- */
input[type=range].slider {
    -webkit-appearance: none;
    width: 100%;
    height: 12px;
    background: linear-gradient(to right, #28a745, #ffc107, #dc3545); /* Dégradé vert-jaune-rouge */
    border-radius: 6px;
    outline: none;
}

input[type=range].slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: #ffffff;
    border: 2px solid #007bff;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -6px; /* Centre la poignée sur la barre */
}

input[type=range].slider::-moz-range-track {
    width: 100%;
    height: 12px;
    background: linear-gradient(to right, #28a745, #ffc107, #dc3545);
    border-radius: 6px;
    cursor: pointer;
}

input[type=range].slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: #ffffff;
    border: 2px solid #007bff;
    border-radius: 50%;
    cursor: pointer;
}
/* ================================================================= */
/* Styles pour l'écran des questions finales (Debriefing)
/* ================================================================= */

.final-question-layout {
    display: flex;
    gap: 40px; /* Espace entre les options radio et la boîte de commentaire */
    align-items: flex-start; /* Aligne les éléments en haut */
}

.final-question-layout .options-group {
    flex: 1; /* Prend l'espace disponible */
}

.final-question-layout .comment-box {
    flex: 1; /* Prend l'espace disponible */
}

.comment-box label {
    display: block;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 8px;
}

.comment-box textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit; /* Utilise la même police que le reste de la page */
    font-size: 14px;
    resize: vertical; /* Permet à l'utilisateur de redimensionner verticalement */
}

#finalQuestionsScreen .button-container {
    text-align: right; /* Aligne le bouton "Complete" à droite */
    margin-top: 30px;
}

/* Countdown bar (global) */
#countdownBar{
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 10px 14px;
  background: #111;
  color: #fff;
  font-size: 14px;
  line-height: 1.2;
  display: none; /* shown by JS */
  z-index: 9999;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
#countdownBar strong{ font-variant-numeric: tabular-nums; }
body{ padding-top: 48px; } /* leave space so it doesn't overlap the top content *