#jspsych-survey-text-next {
  font-size: 24px;
  font-weight: bold;
  font-family: "Helvetica", "Arial", sans-serif;
  height: 40px;
  width: 120px;
  padding: 4px 4px 4px 4px;
}

/* Style for the question title */
.jspsych-survey-multi-choice-question p {
  font-size: 22px;
  font-weight: bold; /* Bold only for the title */
  color: #000000;
  font-family: "Helvetica", "Arial", sans-serif;
  margin-bottom: 10px;
}

/* Style for the options (radio buttons) */
.jspsych-survey-multi-choice-option label {
  font-size: 22px; /* Slightly smaller and not bold */
  font-weight: normal;
  color: #000000;
  font-family: "Helvetica", "Arial", sans-serif;
}

.jspsych-survey-multi-choice {
  overflow: visible !important;
  max-width: 100% !important;
}

.jspsych-display-element input[type="text"] {
  font-family: "Helvetica", "Arial", sans-serif;
  font-size: 25px;
  height: 40px;
  width: 300px;
}

.jspsych-btn {
  font-size: 25px;
  font-family: "Helvetica", "Arial", sans-serif;
  font-weight: bold;
  text-align: center;
  color: #1b1b1b;
  font-weight: 600;
  border: 0px;
  padding: 10px 20px;
  background-color: #1356555d;
  /* Default background color */
  border-radius: 8px;
  /* Rounded corners for a modern look */
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  /* Smooth transition */
}

/* Hover effect */
.jspsych-btn:hover {
  background-color: #13565599; /* Change to light blue when hovered */
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2); /* Slight shadow effect */
  cursor: pointer;
}

#jspsych-survey-multi-choice-next {
  font-size: 25px;
  font-family: "Helvetica", "Arial", sans-serif;
  font-weight: bold;
  text-align: center; /* Center-align title */
  color: #000000;
  font-weight: 600;
  border: 0px;
  padding: 15px 25px;
  background-color: #1356552a;
}

.jspsych-content {
  max-width: 90%;
}

body {
  font: normal 24px Helvetica, Arial, sans-serif !important; /* <-- fonts */
  padding: auto;
  margin: auto;
}

.loader {
  width: 20px;
  aspect-ratio: 1;
  border-radius: 50%;
  animation: l5 1s infinite linear alternate;
}

#jspsych-survey-multi-choice-response {
  font-size: 20px;
  font-weight: bold;
  color: #000000;
  font-weight: 200; /* Slightly less bold than the title */
  margin: 15px 0;
  font-family: "Helvetica", "Arial", sans-serif;
  height: 40px;
  width: 120px;
  padding: 0px 4px 4px 4px;
}

@keyframes l5 {
  0% {
    box-shadow: 30px 0 #000, -30px 0 #0002;
    background: #000;
  }
  33% {
    box-shadow: 30px 0 #000, -30px 0 #0002;
    background: #0002;
  }
  66% {
    box-shadow: 30px 0 #0002, -30px 0 #000;
    background: #0002;
  }
  100% {
    box-shadow: 30px 0 #0002, -30px 0 #000;
    background: #000;
  }
}

h1 {
  font-size: 40px; /* Adjust size for main title */
  font-weight: bold;
  text-align: center; /* Center-align title */
  color: #135655; /* Title color */
  margin: 20px 0;
}

h2 {
  font-size: 25px;
  font-weight: bold;
  text-align: center; /* Center-align title */
  color: #000000;
  font-weight: 600; /* Slightly less bold than the title */
  color: #34495e;
  margin: 15px 0;
}

h3 {
  font-size: 20px;
  font-weight: bold;
  color: #000000;
  font-weight: 500; /* Slightly less bold than the title */
  color: #34495e;
  margin: 15px 0;
}

body {
  font-family: "Arial", sans-serif;
  font-size: 24px;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  color: #333; /* Default text color */
}

#thumbnail-sidebar {
  width: 800px; /* Set fixed width */
  height: 120px; /* Set fixed width */
  padding: 20px;
  border: 3px solid #ddd;
  display: grid;
  grid-template-columns: repeat(10, 1fr); /* 10 columns */
  grid-template-rows: repeat(2, auto); /* 2 rows */
  gap: 5px;
  overflow-y: auto;
  justify-content: center;
  margin: 0 auto;
}

/* Unified Trial Styles - Works for Practice and Main Trials */
.center-flex-instructions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
}

.center-flex-instructions button {
  width: 80%;
  max-width: 900px;
  text-align: left;
  padding: 12px;
  font-size: 16px;
  border: 0px;
  border-radius: 8px;
  background-color: #f9f9f9;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.center-flex-instructions button:hover {
  background-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

/* Main Trial Container */
.trial-container {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  padding: 30px;
  border-radius: 15px;
}

.trial-header h2 {
  margin: 0;
  text-align: center;
  font-size: 28px;
  color: #2c3e50;
}

.decision-question {
  text-align: center;
  margin-bottom: 40px;
}

.decision-question h2 {
  font-size: 24px;
  color: #2c3e50;
  margin: 0;
}

.distributions-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 60px;
  min-height: 500px;
  margin-bottom: 30px;
}

.distribution-side {
  flex: 1;
  padding: 30px;
  border: 3px solid white;
  border-radius: 15px;
  background: white;
  min-height: 450px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  min-width: 400px;
  cursor: pointer; /* Add cursor pointer to indicate clickability */
}

.distribution-side:hover {
  box-shadow: 0 5px 20px #135655;
  transform: translateY(-3px);
  cursor: pointer; /* Ensure cursor stays pointer on hover */
}

.distribution-side h3 {
  text-align: center;
  margin-bottom: 30px;
  color: #2c3e50;
  font-size: 22px;
  font-weight: bold;
}

.distribution-columns {
  display: flex;
  gap: 25px;
  justify-content: center;
}

.distribution-column {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.species-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: white;
  min-height: 60px; /* Ensure consistent height */
}

.species-count {
  font-size: 26px;
  font-weight: bold;
  color: #2c3e50;
  min-width: 60px; /* Increased to accommodate two-digit numbers */
  text-align: right;
  white-space: nowrap; /* Prevent line breaks */
}

.species-image {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
  flex-shrink: 0; /* Prevent image from shrinking */
}

.instructions {
  text-align: center;
  font-size: 16px;
  color: #7f8c8d;
  margin-top: 25px;
}

.response-prompt {
  display: flex;
  justify-content: space-around;
  font-size: 16px;
  align-items: center;
  background: #ecf0f1;
  padding: 20px;
  border-radius: 10px;
  margin-top: 25px;
}

.response-prompt p {
  font-size: 16px;
  margin: 0;
  color: #2c3e50;
  background: #ecf0f1;
  font-weight: bold;
}

/* Fix for practice trials - keep compatibility */
.practice-container {
  composes: trial-container; /* This will inherit all trial-container styles */
}

.practice-header {
  composes: trial-header; /* This will inherit all trial-header styles */
}

/* Dynamic Distribution Layouts - Flexbox Version */
.distribution-side {
  padding: 20px;
  border: 0px solid #ddd;
  border-radius: 10px;
  margin: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  min-width: 400px; /* Keep your existing min-width */
}

.distribution-side:hover {
  border-color: #135655;
  box-shadow: 0 5px 20px #135655; /* Keep your existing hover effect */
  transform: translateY(-3px);
}

.distribution-columns {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 15px;
}

.distribution-column {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.species-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: white;
  min-height: 60px;
}

.species-count {
  font-size: 26px;
  font-weight: bold;
  color: #2c3e50;
  min-width: 60px;
  text-align: right;
  white-space: nowrap;
}

.species-image {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

/* Dynamic sizing based on group size */
.layout-2-or-less .species-image {
  width: 120px;
  height: 120px;
}

.layout-3-to-4 .species-image {
  width: 100px;
  height: 100px;
}

.layout-5-plus .species-image {
  width: 80px;
  height: 80px;
}

/* Adjust columns for different layouts */
.layout-2-or-less .distribution-columns {
  flex-direction: row;
  gap: 30px;
}

.layout-3-to-4 .distribution-columns {
  flex-direction: row;
  gap: 25px;
}

.layout-5-plus .distribution-columns {
  flex-direction: row;
  gap: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .distribution-columns {
    flex-direction: column !important;
    gap: 10px;
  }

  .distribution-side {
    min-width: 300px !important;
  }

  .species-image {
    width: 80px !important;
    height: 80px !important;
  }
}

/* Consistent trial sizing based on entity count */
.trial-few-entities .distribution-side {
  min-width: 380px;
  min-height: 300px;
}

.trial-medium-entities .distribution-side {
  min-width: 420px;
  min-height: 320px;
}

.trial-many-entities .distribution-side {
  min-width: 460px;
  min-height: 340px;
}

/* Distribution side specific sizing */
.few-entities {
  min-width: 380px;
  min-height: 300px;
}

.medium-entities {
  min-width: 420px;
  min-height: 320px;
}

.many-entities {
  min-width: 460px;
  min-height: 340px;
}

/* Entity Type Rows Layout - Fixed Row Allocation */
.entity-type-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  min-height: 55px;
  margin-bottom: 12px;
  width: 100%;
}

.entity-group {
  display: flex;
  gap: 6px;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

.entity-image {
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

/* Dynamic image sizing based on entity count */
.large-images .entity-image {
  width: 70px;
  height: 70px;
}

.medium-images .entity-image {
  width: 60px;
  height: 60px;
}

.small-images .entity-image {
  width: 50px;
  height: 50px;
}

/* Adjust gaps based on image size */
.large-images {
  gap: 8px;
}

.medium-images {
  gap: 6px;
}

.small-images {
  gap: 4px;
}

/* Distribution side styling */
.distribution-side {
  padding: 20px;
  border: 0px solid #ddd;
  border-radius: 10px;
  margin: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.distribution-side:hover {
  border-color: #135655;
  background-color: #f9f9f9;
  box-shadow: 0 5px 20px #135655;
  transform: translateY(-3px);
}

.distribution-side h3 {
  text-align: center;
  margin-bottom: 20px;
  color: #2c3e50;
  font-size: 22px;
  font-weight: bold;
  flex-shrink: 0;
}

/* Better visual grouping for entity types */
.entity-type-row {
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 10px;
}

.entity-type-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Ensure proper content distribution */
.distribution-side > .entity-type-row:last-child {
  margin-bottom: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .large-images .entity-image {
    width: 60px !important;
    height: 60px !important;
  }

  .medium-images .entity-image {
    width: 50px !important;
    height: 50px !important;
  }

  .small-images .entity-image {
    width: 40px !important;
    height: 40px !important;
  }

  .entity-group {
    gap: 4px;
  }

  .entity-type-row {
    min-height: 45px;
    margin-bottom: 10px;
  }

  .distribution-side {
    min-width: 320px !important;
    min-height: 280px !important;
    padding: 15px;
  }
}

/* COMPARISON TRIAL SPECIFIC STYLES - Won't affect other experiments */

/* Trial container for comparison */
.trial-container-compare {
  max-width: 1200px; /* Smaller container */
  margin: 0 auto;
  background: white;
  padding: 20px; /* Reduced padding */
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

.trial-header-compare h2 {
  margin: 0;
  text-align: center;
  font-size: 24px; /* Smaller font */
  color: #2c3e50;
}

/* Distributions container for comparison */
.distributions-container-compare {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 40px; /* Smaller gap */
  min-height: 400px; /* Smaller height */
  margin-bottom: 20px;
}

/* Distribution side for comparison */
.distribution-side-compare {
  flex: 1;
  padding: 20px; /* Reduced padding */
  border: 2px solid white;
  border-radius: 12px;
  background: white;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.distribution-side-compare:hover {
  box-shadow: 0 4px 15px #135655;
  transform: translateY(-2px);
}

.distribution-side-compare h3 {
  text-align: center;
  margin-bottom: 20px; /* Reduced margin */
  color: #2c3e50;
  font-size: 20px; /* Smaller font */
  font-weight: bold;
  flex-shrink: 0;
}

/* Entity rows for comparison - SMALLER AND CLEANER */
.entity-type-row-compare {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  min-height: 45px; /* Smaller height */
  margin-bottom: 8px; /* Reduced spacing */
  width: 100%;
  flex: 0 0 auto;
  /* REMOVED border-bottom and padding-bottom to eliminate lines between rows */
}

.entity-group-compare {
  display: flex;
  gap: 4px; /* Smaller gap */
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  min-height: 40px; /* Smaller height */
}

/* Image sizing for comparison - SMALLER IMAGES */
.compare-large-images .entity-image-compare {
  width: 55px; /* Smaller */
  height: 55px; /* Smaller */
}

.compare-medium-images .entity-image-compare {
  width: 55px; /* Smaller */
  height: 55px; /* Smaller */
}

.compare-small-images .entity-image-compare {
  width: 55px; /* Smaller */
  height: 55px; /* Smaller */
}

/* Gap adjustments for comparison - SMALLER GAPS */
.compare-large-images {
  gap: 5px; /* Smaller gap */
}

.compare-medium-images {
  gap: 4px; /* Smaller gap */
}

.compare-small-images {
  gap: 3px; /* Smaller gap */
}

/* Consistent sizing for comparison trial - SMALLER CONTAINERS */
.trial-compare-few-entities .distribution-side-compare,
.trial-compare-medium-entities .distribution-side-compare,
.trial-compare-many-entities .distribution-side-compare {
  min-width: 380px; /* Smaller width */
  min-height: 320px; /* Smaller height */
}

.instructions-compare {
  text-align: center;
  font-size: 14px; /* Smaller font */
  color: #7f8c8d;
  margin-top: 20px;
}

/* Entity highlighting styles for comparison */
.normal-entity {
  opacity: 1; /* Slightly more transparent */
  transition: opacity 0.3s ease;
}

.highlighted-entity {
  opacity: 0.75;
  box-shadow: 0 0 4px 0px #a3a3a3 !important; /* Smaller shadow */
  transition: all 0.2s ease;
}

/* Better image styling */
.entity-image-compare {
  object-fit: cover;
  border-radius: 5px; /* Smaller radius */
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.entity-image-compare:hover {
  transform: scale(1.05); /* Smaller hover effect */
  z-index: 10;
  box-shadow: 0 2px 6px rgba(255, 255, 255, 0.3); /* Smaller shadow */
}

/* Responsive adjustments for comparison */
@media (max-width: 768px) {
  .distributions-container-compare {
    flex-direction: column;
    align-items: center;
    gap: 20px; /* Smaller gap */
    min-height: auto;
  }

  .distribution-side-compare {
    min-width: 300px !important; /* Smaller width */
    width: 100%;
  }

  .trial-compare-few-entities .distribution-side-compare,
  .trial-compare-medium-entities .distribution-side-compare,
  .trial-compare-many-entities .distribution-side-compare {
    min-width: 300px; /* Smaller width */
    min-height: 280px; /* Smaller height */
  }

  /* Adjust image sizes for mobile - EVEN SMALLER */
  .compare-large-images .entity-image-compare {
    width: 45px;
    height: 45px;
  }

  .compare-medium-images .entity-image-compare {
    width: 40px;
    height: 40px;
  }

  .compare-small-images .entity-image-compare {
    width: 35px;
    height: 35px;
  }

  .entity-type-row-compare {
    min-height: 40px; /* Smaller height */
    margin-bottom: 6px; /* Smaller spacing */
  }
}
