/* Google Font - League Spartan */
@font-face {
  font-family: 'League Spartan';
  src: url('../assets/fonts/LeagueSpartan-VariableFont_wght.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: optional;
}

/* Prevent layout shift by setting fallback font metrics */
body {
  font-family: 'League Spartan', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Main Container */
.exercise-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0;
  padding-bottom: 8rem;
  align-items: flex-start;
  margin-top: 1rem;
}

/* Text Container */
.text-container {
  width: 100%;
  max-width: 44rem;
  display: flex;
  flex-direction: column;
}

.description-text {
  font-family: 'League Spartan', sans-serif;
  font-size: 1.2rem;
  line-height: 1.4;
  color: #333333;
  margin: 0;
}

/* Table Container */
.table-container {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  margin-bottom: 4rem;
  margin-top: 0;
}

/* Exercise Table */
.exercise-table {
  border-collapse: separate;
  margin: 0;
  table-layout: fixed;
  width: 68rem;
  max-width: 68rem;
}

.exercise-table td {
  width: 20%;
  text-align: center;
  vertical-align: middle;
  padding: 0.5rem;
  position: relative;
}

/* Images Row */
.images-row td {
  height: 10rem;
  min-height: 10rem;
  padding-bottom: 0.5rem;
}

.image-cell {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 0.5rem;
}

.person-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 0.5rem;
  object-fit: contain;
  border: 0.1rem solid #e0e0e0;
  padding: 0.25rem;
  background-color: #ffffff;
}

/* Dropdown Row */
.dropdown-row td {
  height: 4rem;
  min-height: 4rem;
  padding-top: 0;
  padding-bottom: 0;
  vertical-align: top;
}

/* Dropdown Container */
.dropdown-container {
  position: relative;
  width: 100%;
  max-width: 15rem;
  margin: 0 auto;
  font-family: 'League Spartan', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Dropdown Button */
.dropdown-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background-color: #FEE9B2;
  border: 0.2rem solid #FFBF00;
  border-radius: 2rem;
  color: #333333;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
  height: 2.2rem;
  padding: 0.5rem 1rem;
}

.dropdown-button:hover {
  background-color: #FFD966;
}

/* Dropdown Text */
.dropdown-text {
  flex-grow: 1;
  text-align: center;
  font-family: 'League Spartan', sans-serif;
  font-size: 1rem;
}

/* Dropdown Icon (triangle) */
.dropdown-icon {
  color: #FFBF00;
  font-size: 1rem;
  transition: transform 0.2s ease;
  margin-left: 0.5rem;
}

/* When only showing the icon in the button */
.dropdown-button.icon-only .dropdown-text {
  display: none;
}

.dropdown-button.icon-only .dropdown-icon {
  margin: 0;
}

/* Rotate icon when dropdown is open */
.dropdown-button.active .dropdown-icon {
  transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #FEE9B2;
  border: 0.2rem solid #FFBF00;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-0.5rem);
  transition: all 0.2s ease;
}

/* Show dropdown menu when active */
.dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Dropdown Items */
.dropdown-item {
  padding: 0 1rem;
  color: #333333;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 0.1rem solid #FFBF00;
  text-align: center;
  background-color: #FEE9B2;
  min-height: 2.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'League Spartan', sans-serif;
}

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

.dropdown-item:hover {
  background-color: #FFD966;
}

/* Selected Item Styling */
.dropdown-item.selected {
  background-color: #FFD966;
  font-weight: 600;
}

/* Correct and Incorrect States */
.dropdown-button.correct {
  border-color: #258174;
}

.dropdown-button.incorrect {
  border-color: #FF0000;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .exercise-table {
    border-spacing: 0.5rem;
  }
  
  .text-container {
    padding-left: 1rem;
  }
  
  .table-container {
    padding-left: 1rem;
  }
  
  .exercise-table {
    width: 100%;
    max-width: 100%;
  }
  
  .exercise-container {
    padding: 1rem;
  }
  
  .description-text {
    font-size: 1rem;
  }
  
  .images-row td {
    height: 10rem;
    min-height: 10rem;
  }
  
  .person-image {
    max-width: 90%;
    max-height: 90%;
  }
  
  .dropdown-container {
    max-width: 12rem;
  }
  
  .dropdown-button {
    font-size: 0.9rem;
    height: 2rem;
    padding: 0.4rem 0.8rem;
  }
  
  .dropdown-item {
    font-size: 1rem;
    min-height: 2rem;
  }
}

