html {
  height: 100%;
  width: 100%;
}

body {
  font-family: 'Noto Sans', sans-serif;
  /* padding: 20px; */
  background-color: #FFFFFF;
  /* White background */
  color: #000000;
  /* Black text */
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark mode styles */
body.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
}

body.dark-mode h1,
body.dark-mode h2 {
  color: #f0f0f0;
}

/* Improve visibility of bold text in dark mode */
body.dark-mode strong,
body.dark-mode b {
  color: #ffffff; /* Bright white for bold text */
  font-weight: 700; /* Ensure proper bold weight */
}

/* Navbar dark mode styles */
body.dark-mode .navbar {
  background-color: #1a1a1a;
  color: #f0f0f0;
}

body.dark-mode .navbar-item,
body.dark-mode .navbar-link {
  color: #f0f0f0;
}

body.dark-mode #dark-mode-toggle {
  background-color: #333;
  color: #f0f0f0;
  border-color: #444;
}

body.dark-mode #dark-mode-toggle:hover {
  background-color: #444;
}

body.dark-mode #dark-mode-toggle .icon i {
  color: #f0f0f0;
}

body.dark-mode .nav a {
  color: #64b5f6;
}

body.dark-mode .nav a:hover {
  color: #90caf9;
}

body.dark-mode th {
  background-color: #333;
  color: #f0f0f0;
}

body.dark-mode tr:nth-child(even) {
  background-color: #2d2d2d;
}

body.dark-mode td {
  border-bottom: 1px solid #444;
}

body.dark-mode .rank {
  color: #64b5f6;
}

body.dark-mode .settings-info {
  color: #e0e0e0;
  background-color: #333;
}

body.dark-mode .answer {
  border: 1px solid #64b5f6;
}

body.dark-mode .answer:hover {
  background-color: #333;
}

body.dark-mode .footer .icon-link {
  color: #e0e0e0;
}

/* Footer dark mode styles */
body.dark-mode .footer {
  background-color: #1a1a1a;
  color: #f0f0f0;
}

body.dark-mode .hero,
body.dark-mode .section {
  background-color: #121212;
}

body.dark-mode .title,
body.dark-mode .subtitle {
  color: #f0f0f0;
}

body.dark-mode .publication-venue {
  color: #aaa;
}

body.dark-mode .table {
  background-color: #1e1e1e;
  color: #e0e0e0;
}

body.dark-mode .table.is-striped tbody tr:not(.is-selected):nth-child(even) {
  background-color: #2d2d2d;
}

/* Fix for table hover effect in dark mode */
body.dark-mode .table.is-hoverable tbody tr:hover {
  background-color: #2a2a2a !important;
}

/* Ensure striped rows still have proper contrast when hovered */
body.dark-mode .table.is-striped.is-hoverable tbody tr:not(.is-selected):nth-child(even):hover {
  background-color: #333333 !important;
}

/* Reduce excessive section padding */
.section {
  padding: 1.5rem 1.5rem; /* Reduced from Bulma's default 3rem */
}

/* Further reduce padding on mobile devices */
@media screen and (max-width: 768px) {
  .section {
    padding: 1rem 1rem;
  }
}

/* Adjust hero padding to match reduced section padding */
.hero-body {
  padding: 1.5rem 1.5rem;
}

@media screen and (max-width: 768px) {
  .hero-body {
    padding: 1rem 1rem;
  }
}

/* Reduce footer padding to match other sections */
.footer {
  padding: 1.5rem 1.5rem;
}

@media screen and (max-width: 768px) {
  .footer {
    padding: 1rem 1rem;
  }
}

/* Standardize table borders */
table, .table {
  border: 1px solid #dbdbdb;
  border-radius: 4px;
  overflow: hidden; /* Ensures the border-radius clips content */
}

/* Consistent cell borders for all tables */
th, td {
  padding: 12px;
  text-align: left;
  border: 1px solid #dbdbdb;
}

/* Fix inconsistencies in dark mode borders */
body.dark-mode table, 
body.dark-mode .table {
  border-color: #444;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.4) !important; /* Darker shadow for dark mode */
}

body.dark-mode th,
body.dark-mode td {
  border-color: #444;
}

/* Make sure leaderboard table matches other tables */
#leaderboardTable {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  margin-bottom: 20px;
  box-shadow: 0 0 20px rgba(200, 200, 200, 0.3);
  border: 1px solid #dbdbdb;
  border-radius: 4px;
  overflow: hidden;
}

#leaderboardTable th,
#leaderboardTable td {
  padding: 12px;
  text-align: left;
  border: 1px solid #dbdbdb;
}

/* Fix for dark mode leaderboard table */
body.dark-mode #leaderboardTable {
  border-color: #444;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.4) !important; /* Darker shadow for dark mode */
}

body.dark-mode #leaderboardTable th,
body.dark-mode #leaderboardTable td {
  border-color: #444;
}

/* Set background color for odd rows in leaderboard table in dark mode */
body.dark-mode #leaderboardTable tr:nth-child(odd) {
  background-color: #1e1e1e;
}

.leaderboard {
  max-width: 1000px; /* Increased from 800px for wider tables */
  margin: 0 auto; /* Added margin for centering */
  padding: 1.5rem 0rem;
}

/* Add responsive adjustments for the wider tables */
@media screen and (max-width: 1100px) {
  .leaderboard {
    max-width: 90%; /* Use percentage width on smaller screens */
  }
}

@media screen and (max-width: 768px) {
  #leaderboardTable,
  #detailedStatsTable,
  #leaderboardV3Table,
  #leaderboardV4Table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* Prevent cells from wrapping too early and forcing layout breaks */
  #leaderboardTable th,
  #leaderboardTable td,
  #detailedStatsTable th,
  #detailedStatsTable td,
  #leaderboardV3Table th,
  #leaderboardV3Table td,
  #leaderboardV4Table th,
  #leaderboardV4Table td {
    white-space: nowrap;
  }
}

h1,
h2 {
  text-align: center;
  color: #333333;
  /* Darker shade of black for headings */
  text-shadow: none;
  /* Removed shadow for a cleaner look */
}

.nav {
  text-align: center;
  margin-bottom: 20px;
}

.nav a {
  color: #0077B6;
  /* Blue for links */
  text-decoration: none;
  margin: 0 10px;
  font-weight: bold;
  transition: color 0.3s ease;
}

.nav a:hover {
  color: #005f86;
  /* Darker blue for hover effect */
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  box-shadow: 0 0 20px rgba(200, 200, 200, 0.3);
  /* Lighter shadow */
}

th,
td {
  padding: 12px;
  text-align: left;
  border: 1px solid #dbdbdb;
}

#leaderboardTable {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  margin-bottom: 20px;
  box-shadow: 0 0 20px rgba(200, 200, 200, 0.3);
  border: 1px solid #dbdbdb;
  border-radius: 4px;
  overflow: hidden;
}

#leaderboardTable th,
#leaderboardTable td {
  padding: 12px;
  text-align: left;
  border: 1px solid #dbdbdb;
}

.button.has-text-left-custom {
  display: flex;
  justify-content: flex-start;
  text-align: left;
}

th {
  background-color: #f2f2f2;
  /* Light grey header background */
  color: #333333;
  /* Dark text for better contrast */
}

tr:nth-child(even) {
  background-color: #f9f9f9;
  /* Alternate row shading for clarity */
}

.rank {
  font-weight: bold;
  color: #0077B6;
  /* Consistent with link color */
}

.settings-button {
  font-size: 0.8em;
  color: #0077B6;
  background: none;
  border: none;
  cursor: pointer;
  margin-top: 10px;
  text-decoration: underline;
}

.settings-info {
  font-size: 0.8em;
  margin-top: 10px;
  margin-bottom: 10px;
  display: none;
  color: #333333;
  /* Changed to a darker color */
  background-color: #f2f2f2;
  padding: 10px;
  border-radius: 5px;
}

.answer {
  cursor: pointer;
  padding: 10px;
  margin: 5px 0;
  border: 1px solid #0077B6;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.answer:hover {
  background-color: #f2f2f2;
  /* Light hover effect */
}

.correct {
  background-color: #4CAF50 !important;
  /* Green for correct answer */
  color: white;
}

.incorrect {
  background-color: #f44336 !important;
  /* Red for incorrect answer */
  color: white;
}

.footer .icon-link {
  font-size: 25px;
  color: #000;
  padding: 0 10px;
}

footer {
  margin-top: 60px;
}

.link-block a {
  margin-top: 5px;
  margin-bottom: 5px;
}

.dnerf {
  font-variant: small-caps;
}

.teaser .hero-body {
  padding-top: 0;
  padding-bottom: 3rem;
}

.teaser {
  font-family: 'Google Sans', sans-serif;
}

.publication-banner {
  max-height: parent;
}

.publication-banner video {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  object-fit: fit;
}

.publication-title {
  font-family: 'Google Sans', sans-serif;
}

.publication-authors {
  font-family: 'Google Sans', sans-serif;
}

.publication-venue {
  color: #555;
  width: fit-content;
  font-weight: bold;
}

.publication-awards {
  color: #ff3860;
  width: fit-content;
  font-weight: bolder;
}

.publication-authors a {
  color: black !important;
}

body.dark-mode .publication-authors a {
  color: white !important;
}

.publication-authors a:hover {
  text-decoration: underline;
}

.author-block {
  display: inline-block;
}

.publication-video {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;

  overflow: hidden;
  border-radius: 10px !important;
}

.publication-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.results-carousel {
  overflow: hidden;
}

.results-carousel .item {
  margin: 5px;
  overflow: hidden;
  padding: 20px;
  font-size: 0;
}

.results-carousel video {
  margin: 0;
}

.slider-pagination .slider-page {
  background: #000000;
}

.eql-cntrb {
  font-size: smaller;
}

/* Language toggle button styles */
#language-toggle {
  background-color: #f5f5f5;
  color: #333;
  border: 1px solid #dbdbdb;
  border-radius: 4px;
  padding: 5px 10px;
  margin-right: 10px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 46px; /* Add minimum width to prevent resizing when flag loads */
}

#language-toggle:hover {
  background-color: #e8e8e8;
}

body.dark-mode #language-toggle {
  background-color: #333;
  color: #f0f0f0;
  border-color: #444;
}

body.dark-mode #language-toggle:hover {
  background-color: #444;
}

/* Flag icons */
.flag-icon {
  width: 24px;
  height: 16px;
  display: inline-block;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  vertical-align: middle;
}

.flag-icon-it {
  background-image: url('/static/images/flags/it.svg');
}

.flag-icon-gb {
  background-image: url('/static/images/flags/gb.svg');
}

/* Make code blocks in dataset description wrap text */
.content pre {
  white-space: pre-wrap;       /* CSS 3 */
  word-wrap: break-word;       /* IE Edge */
  overflow-wrap: break-word;   /* Modern browsers */
  max-width: 100%;
}

.content pre code {
  white-space: pre-wrap;
  word-break: normal;
  overflow-wrap: break-word;
}

/* Ensure proper styling in dark mode */
body.dark-mode .content pre {
  background-color: #2a2a2a;
}

body.dark-mode .content pre code {
  color: #e0e0e0;
}

/* CoT Viewer Styles */
.cot-container {
  display: flex;
  margin-top: 20px;
  border: 1px solid #dbdbdb;
  border-radius: 4px;
  overflow: hidden;
  min-height: 400px;
}

.cot-sidebar {
  width: 30%;
  min-width: 200px;
  border-right: 1px solid #dbdbdb;
  overflow-y: auto;
  max-height: 500px;
  background-color: #f9f9f9;
}

.cot-proverb-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cot-proverb-item {
  padding: 10px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  transition: background-color 0.2s ease;
}

.cot-proverb-text {
  font-size: 0.95em;
  margin-bottom: 4px;
}

.cot-model-info {
  font-size: 0.8em;
  color: #666;
  font-style: italic;
}

.cot-proverb-item:hover {
  background-color: #f0f0f0;
}

.cot-proverb-item.selected {
  background-color: #e8e8e8;
}

.cot-proverb-item.selected .cot-proverb-text {
  font-weight: bold;
}

.cot-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  max-height: 500px;
}

/* Dark mode styles for CoT section */
body.dark-mode .cot-container {
  border-color: #444;
}

body.dark-mode .cot-sidebar {
  background-color: #2d2d2d;
  border-right-color: #444;
}

body.dark-mode .cot-proverb-item {
  border-bottom-color: #444;
}

body.dark-mode .cot-model-info {
  color: #aaa;
}

body.dark-mode .cot-proverb-item:hover {
  background-color: #3a3a3a;
}

body.dark-mode .cot-proverb-item.selected {
  background-color: #444;
}

body.dark-mode .cot-answer {
  background-color: transparent; /* Remove background in dark mode */
  border-left-color: #444; /* Default border for dark mode */
  box-shadow: none;
}

body.dark-mode .cot-model-answer .cot-answer {
  border-left-color: #64b5f6;
}

body.dark-mode .cot-correct-answer-text {
  border-left-color: #81C784 !important;
}

/* Updated CoT Content Layout */
.cot-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0px;
  position: relative;
}

.cot-proverb-title {
  margin: 0;
  flex-grow: 1;
  padding-right: 100px; /* Make space for the model tag */
}

.cot-model-tag {
  position: absolute;
  top: 0;
  right: 0;
  /* Removed background color */
  color: #777; /* Subtle gray color */
  padding: 4px 10px;
  font-weight: 600;
  font-size: 0.85em;
  font-style: italic;
}

.cot-answer {
  font-size: 1.2em;
  margin: 15px 0;
  padding: 15px 20px;
  border-left: 1px solid #ddd; /* Thinner, neutral border */
  border-radius: 2px;
  line-height: 1.5;
  background-color: transparent; /* Remove background color */
  box-shadow: none; /* Remove shadow */
  font-weight: normal;
  letter-spacing: 0.01em;
}

.cot-reasoning-container {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

.cot-reasoning-title {
  margin-bottom: 15px;
}

/* Dark mode versions */
body.dark-mode .cot-model-tag {
  color: #aaa;
}

body.dark-mode .cot-reasoning-container {
  border-top-color: #444;
}

/* Answer comparison styles */
.cot-answer-comparison {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 0px;
}

.cot-answer-label {
  font-size: 0.9em;
  font-weight: 600;
  color: #555;
  margin-bottom: 5px;
}

body.dark-mode .cot-answer-label {
  color: #aaa;
}

.cot-model-answer, 
.cot-correct-answer {
  flex: 1;
}

/* Style for model answer - blue left border */
.cot-model-answer .cot-answer {
  border-left-color: #0077B6; 
  border-left-width: 4px;
}

/* Style for correct answer - green left border only */
.cot-correct-answer-text {
  border-left-color: #4CAF50 !important;
  border-left-width: 4px;
  background-color: transparent !important;
  color: inherit !important;
}

.hidden {
  display: none;
}

/* Media query for larger screens to show answers side by side */
@media screen and (min-width: 768px) {
  .cot-answer-comparison {
    flex-direction: row;
  }
}

/* Proverb options styles */
.cot-options {
  margin-top: 15px;
  padding: 15px;
  border-top: 1px solid #eee;
  font-size: 0.95em;
  line-height: 1.5;
}

.cot-options div {
  margin-bottom: 5px;
}

body.dark-mode .cot-options {
  border-top-color: #444;
}

/* Options list styles */
.cot-options-list {
  margin-top: 10px;
  font-size: 1em;
  line-height: 1.5;
  border-radius: 4px;
  border-left: 3px solid #0077B6;
}

body.dark-mode .cot-options-list {
  border-left-color: #64b5f6;
}

.cot-options-list div {
  /* margin-bottom: 5px; */
  padding: 5px 10px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.cot-selected-option {
  font-weight: bold;
  color: #0077B6;
  /* background-color: #f0f0f0; */
  /* border-left: 3px solid #0077B6; */
}

/* Dark mode style for selected option */
body.dark-mode .cot-selected-option {
  color: #64b5f6;
  /* background-color: #333; */
  /* border-left-color: #64b5f6; */
}

/* Fix for organization logos */
.org-logo {
  width: 24px;
  height: 24px;
  vertical-align: middle;
  min-width: 24px;  /* Ensure fixed minimum size */
  min-height: 24px; /* Ensure fixed minimum size */
  object-fit: contain; /* Maintain aspect ratio */
}

.model-cell {
  border-right: none !important;
}

.org-cell {
  border-left: none !important;
}

/* Ensure proper spacing in model cells on mobile while keeping minimum size */
@media screen and (max-width: 768px) {
  .org-logo {
    margin-left: 5px;
    /* Removed width/height reduction to maintain visibility */
  }
}

/* Accuracy progress bar styles */
.accuracy-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.accuracy-progress-bar {
  width: 80px;
  height: 10px;
  background-color: #f0f0f0;
  border-radius: 5px;
  overflow: hidden;
  /* border: 1px solid #dbdbdb; */
}

.accuracy-progress-fill {
  height: 100%;
  background-color: #4CAF50; /* Green color for the progress fill */
  transition: width 0.5s ease-in-out;
  border-radius: 0 5px 5px 0; /* Rounded corners on right side */
}

body.dark-mode .accuracy-progress-bar {
  background-color: #333;
  border-color: #444;
}

/* Make responsive for small screens */
@media screen and (max-width: 768px) {
  .accuracy-progress-bar {
    width: 60px;
  }
}

/* Thinking indicator styles */
.thinking-indicator {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  height: 24px;      /* Add fixed height */
  line-height: 24px; /* Match line height to height */
  vertical-align: middle;
}

.thinking-indicator.yes {
  color: #4CAF50; /* Green for tick */
}

.thinking-indicator.no {
  color: #F44336; /* Red for cross */
}

body.dark-mode .thinking-indicator.yes {
  color: #81C784; /* Lighter green for dark mode */
}

body.dark-mode .thinking-indicator.no {
  color: #E57373; /* Lighter red for dark mode */
}

/* Responsive tables on small screens */
@media screen and (max-width: 768px) {
  #leaderboardTable,
  #detailedStatsTable {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* Prevent cells from wrapping too early and forcing layout breaks */
  #leaderboardTable th,
  #leaderboardTable td,
  #detailedStatsTable th,
  #detailedStatsTable td {
    white-space: nowrap;
  }
}

/* Dark mode styles for mobile navbar */
body.dark-mode .navbar-burger {
  color: #f0f0f0;
}

body.dark-mode .navbar-menu.is-active {
  background-color: #1a1a1a;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

body.dark-mode .navbar-menu.is-active .navbar-item {
  color: #f0f0f0;
}

/* Fix button positioning in mobile navbar */
@media screen and (max-width: 1023px) {
  .navbar-menu.is-active {
    padding: 0.5rem;
  }
  
  .navbar-menu.is-active .navbar-end {
    display: flex;
    justify-content: center;
  }
  
  .navbar-menu.is-active .navbar-item {
    display: flex;
    justify-content: center;
    padding: 0.75rem;
  }
  
  /* Add better spacing between buttons */
  #language-toggle, #dark-mode-toggle {
    margin: 0 0.5rem;
  }
}

/* Responsive CoT Viewer Styles for mobile */
@media screen and (max-width: 768px) {
  /* Stack the content vertically on mobile */
  .cot-container {
    flex-direction: column;
    max-height: none;
  }

  /* Make sidebar full width on mobile and limit height */
  .cot-sidebar {
    width: 100%;
    min-width: 100%;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid #dbdbdb;
  }

  /* Adjust content area for mobile */
  .cot-content {
    max-height: none;
    overflow-y: visible;
  }

  /* Make sure the proverb title doesn't get cut off */
  .cot-proverb-title {
    padding-right: 0;
    margin-bottom: 25px; /* Space for the tag below */
  }

  /* Position model tag below title instead of to the right */
  .cot-model-tag {
    top: 25px;
    right: 0;
  }

  /* Keep answer comparison stacked on mobile */
  .cot-answer-comparison {
    flex-direction: column;
  }
  
  /* Keep options list legible */
  .cot-options-list div {
    padding: 8px 10px;
  }

  /* Dark mode adjustments for mobile */
  body.dark-mode .cot-sidebar {
    border-bottom-color: #444;
  }
}

/* Table header vertical alignment */
#leaderboardTable thead th,
#detailedStatsTable thead th {
  vertical-align: middle;
}

/* Table body vertical alignment */
#leaderboardTable tbody td,
#detailedStatsTable tbody td {
  vertical-align: middle;
}

/* Ensure consistent table styling */
#leaderboardTable,
#detailedStatsTable {
  table-layout: auto;
}

#leaderboardTable thead tr,
#detailedStatsTable thead tr,
#leaderboardTable tbody tr,
#detailedStatsTable tbody tr {
  height: auto;
  min-height: 3em;
}