/* Shared UI for chapter-style pages (letter, sp, dk) */

/* Language selection */
.dropdown {
  position: relative;
  display: inline-block;
  color: white;
  text-align: center;
}

.dropdown-selected {
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  height: 50px;
  width: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropdown-selected:focus-visible,
.dropdown-option:focus-visible {
  outline: 3px solid #eb5c3d;
  outline-offset: 2px;
  position: relative;
  z-index: 1;
}

.dropdown-selected::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  border: 6px solid transparent;
  border-top-color: white;
  transition: transform 0.3s ease;
}

.dropdown.open .dropdown-selected::after {
  transform: translateY(-50%) rotate(180deg);
}

.dropdown-options {
  display: none;
  position: absolute;
  border: 1px solid var(--border);
  z-index: 10;
}

.dropdown-option {
  height: 50px;
  width: 200px;
  cursor: pointer;
  background-color: var(--white);
  color: gray;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropdown.open .dropdown-options {
  display: block;
}

.dropdown-option:hover {
  color: white;
}

.hidden-lang {
  display: none !important;
}

/* Exercise layout */
.exercise {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-shrink: 0;
  padding: 40px 20px;
  margin: 20px 0;
  width: 100%;
  box-sizing: border-box;
  background-color: #ffffff;
  border: 2px solid #e1e1e1;
  border-radius: 12px;
  box-shadow: 0 2px 4px #0000000f;
  transition: none;
}

.lang-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.alpha-letter {
  color: var(--alpha);
  font-weight: 600;
}

.active-letter {
  color: var(--alpha);
}

/* Navigation buttons */
.nav-buttons {
  display: flex;
  justify-content: space-between;
}

.nav-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--white);
  padding: 15px;
  border: 2px solid #e1e1e1;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.3s;
  box-shadow: 0 2px 4px #0000000f;
  user-select: none;
}

.nav-button:hover {
  background-color: #f0f0f0;
}

.nav-button-image {
  width: 16px;
  height: auto;
}

/* Shared chapter header UI */
.speaker-title {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.bar {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

.menu {
  width: 50px;
  padding: 15px;
  background-color: var(--white);
  border: 2px solid #e1e1e1;
  border-radius: 12px;
  transition: background-color 0.3s;
  box-shadow: 0 2px 4px #0000000f;
}

.menu:hover {
  background-color: #f0f0f0;
}

.progress-container-chapter {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 10px 14px 12px;
  background: rgb(255 255 255 / 0.94);
  z-index: 1000;
}

.chapter-progress-shell {
  width: min(1000px, 100%);
  margin: 0 auto;
}

.chapter-progress-header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.chapter-progress-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--alpha);
  color: var(--white);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1;
  box-shadow: 0 8px 20px #00000014;
}

.progress-bar-chapter {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0;
}

.chapter-progress-step {
  position: relative;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8f8f8f;
  cursor: pointer;
}

.chapter-progress-step::before {
  content: "";
  position: absolute;
  top: 12px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--border);
}

.chapter-progress-step:first-child::before {
  display: none;
}

.chapter-progress-step.is-complete::before,
.chapter-progress-step.is-current::before {
  background: var(--alpha);
}

.chapter-progress-dot {
  position: relative;
  z-index: 1;
  width: 16px;
  height: 16px;
  border: 2px solid #b9b9b9;
  border-radius: 50%;
  background: var(--white);
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.chapter-progress-number {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
}

.chapter-progress-step.is-complete,
.chapter-progress-step.is-current {
  color: #2d2d2d;
}

.chapter-progress-step.is-complete .chapter-progress-dot {
  border-color: var(--alpha);
  background: var(--alpha);
}

.chapter-progress-step.is-current .chapter-progress-dot {
  width: 18px;
  height: 18px;
  border-color: var(--alpha);
  background: var(--alpha);
  transform: scale(1.2);
}

.chapter-progress-step:hover .chapter-progress-dot,
.chapter-progress-step:focus-visible .chapter-progress-dot {
  border-color: var(--alpha);
  transform: scale(1.2);
}

body {
  padding-top: 60px;
}

@media screen and (max-width: 800px) {
  .dropdown-option,
  .dropdown-selected {
    font-size: 1rem;
  }

  .dropdown-selected,
  .dropdown-option {
    width: 150px;
  }

  .progress-container-chapter {
    padding: 8px 10px 10px;
  }

  .chapter-progress-header {
    margin-bottom: 6px;
  }

  .chapter-progress-letter {
    min-width: 60px;
    padding: 5px 10px;
    font-size: 0.9rem;
  }

  .chapter-progress-dot {
    width: 14px;
    height: 14px;
  }

  .chapter-progress-step::before {
    top: 11px;
  }

  .chapter-progress-step.is-current .chapter-progress-dot {
    width: 16px;
    height: 16px;
  }

  .chapter-progress-number {
    font-size: 0.75rem;
  }

  body {
    padding-top: 50px;
  }
}
