html {
  background-color: #f6f6f6;
  font-family: sans-serif;
  overflow-x: hidden;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23000' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 10px 6px;
}

header {
  width: 100%;
  height: 110px;
  padding: 15px 20px;
  display: flex;
  align-items: center;
}

  header .logo {
    height: 4.25rem;
  }

.page {
  max-width: 1200px;
  margin: 0 auto;
}

.player {
  width: 100%;
  height: 100%;
  max-width: 1016px;
  margin: 0 auto;
  aspect-ratio: 16/9;
  position: relative;
}

  .player::before {
    content: "";
    background-color: #000;
    height: 100%;
    left: -500%;
    position: absolute;
    width: 1000%;
  }

.details {
  margin-top: 24px;
  padding: 24px;
  min-height: 200px;
  background-color: #FFFFFF;
  border-radius: 4px;
  white-space: normal;
}

.details__title {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 600;
}

.details__stats {
  display: flex;
  align-items: center;
  font-weight: 400;
  gap: 20px;
  color: #767676;
  font-size: 0.9rem;
  margin: 11px 0 0;
  padding: 0 0 9px 0;
  border-bottom: 1px solid #e5e5e5;
}

  .details__stats svg {
    fill: #a2a2a2;
    margin-right: 9px;
    max-width: 22px;
  }

.details__stats--date, .details__stats--time {
  display: flex;
  align-items: center;
}

.details__desc {
  padding: 20px 0;
}

  .details__desc p {
    margin: 0;
  }

.time-code {
  background-color: transparent;
  color: #1e1ee0;
  text-decoration: underline;
  cursor: pointer;
}

/* Tabs Styles */
.tabs {
  display: flex;
  justify-content: space-around;
  border-bottom: 2px solid #e5e5e5;
  margin-bottom: 24px;
  gap: 0;
}

.tabs__item {
  background: none;
  border: none;
  padding: 12px 24px;
  font-size: 1rem;
  width: 100%;
  color: #000000;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  margin-bottom: -2px;
  position: relative;
}

.tabs__item--active {
  border-bottom-color: #1e1ee0;
  font-weight: 600;
}

/* Tab Content */
.tab-content {
  display: none;
}

.tab-content--active {
  display: block;
}

/* Captions Styles */
.captions-container {
  min-height: 20rem;
}

.captions__header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  gap: 8px;
  flex-wrap: wrap;
}

.captions__language-select {
  min-width: 166px;
  padding: 10px 16px;
  font-size: 1rem;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  background-color: white;
  cursor: pointer;
  outline: none;
}

  .captions__language-select:focus {
    border-color: #1e1ee0;
  }

.captions__search-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
  height: 40px;
}

.captions__search-input {
  width: 100%;
  padding: 10px 0 10px 45px;
  box-sizing: border-box;
  font-size: 1rem;
  background-color: #f5f5f5;
  outline: none;
  border: none;
  border-radius: 20px;
}

  .captions__search-input:focus {
    background-color: #ebebeb;
  }

.captions__search-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  color: #414141;
  pointer-events: none;
}

.captions__search-clear {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  background-color: transparent;
  border: 0;
  cursor: pointer;
  padding: 4px;
  display: none;
}

  .captions__search-clear:hover {
    opacity: 0.7;
  }

  .captions__search-clear svg {
    display: block;
  }

.captions__matches-walker {
  color: #777;
  font-size: 1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
}

.captions__walker-btn {
  border: 0;
  padding: 8px 4px;
  background-color: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

  .captions__walker-btn:hover {
    opacity: 0.5;
  }

  .captions__walker-btn svg {
    display: block;
    color: #414141;
  }

.captions__matches-count {
  display: inline-block;
  vertical-align: middle;
  color: #000000;
  min-width: 60px;
  text-align: center;
}

.captions__scroll {
  max-height: 32rem;
  overflow-y: auto;
  overflow-x: hidden;
  transform: translate3d(0, 0, 0);
  padding-right: 8px;
}

  .captions__scroll::-webkit-scrollbar {
    width: 8px;
  }

  .captions__scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
  }

  .captions__scroll::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
  }

    .captions__scroll::-webkit-scrollbar-thumb:hover {
      background: #a8a8a8;
    }

.captions__item {
  font-size: 0.8125rem;
  line-height: 1rem;
  font-weight: 400;
  padding: 8px 0;
  color: #a2a2a2;
  display: flex;
  cursor: pointer;
  transition: color 0.2s ease;
}

@media (min-width: 640px) {
  .captions__item {
    font-size: 1rem;
    line-height: 1.5rem;
  }
}

.captions__item:hover {
  color: #333333;
}

.captions__item--current {
  color: #414141;
  font-weight: 600;
}

  .captions__item--current .captions__match {
    color: #414141;
  }

.captions__time {
  width: 100px;
  flex-shrink: 0;
}

.captions__data {
  flex: 1;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.captions__item-title {
  font-weight: 600;
  line-height: 0.875rem;
  padding-bottom: 0.25rem;
}

.captions__text {
  /* Normal text styling */
}

.captions__match {
  background-color: #ffecb3;
  color: #a2a2a2;
  padding: 0 2px;
  border-radius: 2px;
}

.captions__match--current {
  background-color: #ffd54f;
  color: #333333;
  font-weight: 600;
}

.captions__no-timedata-message {
  margin-top: 3rem;
  color: #7f7f7f;
  font-weight: 500;
  font-size: 1.25rem;
  text-align: center;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .captions__header {
    align-items: stretch;
  }

  .captions__language-select {
    width: 100%;
    flex: 0 1 100%;
  }

  .captions__search-wrapper {
    min-width: unset;
    flex: 1;
  }

  .captions__matches-walker {
    justify-content: center;
  }

  .tabs__item {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
  }
}

/* TOC Table Styles */
.toc-table {
  width: 100%;
  margin-top: 20px;
  border-collapse: separate;
  border-spacing: 0;
}

.toc-table tr:last-child {
  border-bottom: none;
}

.toc-table tr:hover {
  background-color: #fafafa;
}

.toc-table td {
  white-space: nowrap;
  word-wrap: normal;
  vertical-align: top;
  padding-bottom: 5px;
  line-height: 21px;
  text-wrap: auto;
}

.toc-table td:first-child {
  width: 10px;
  font-weight: 400;
  white-space: nowrap;
}

.toc-table td:first-child .time-code {
  color: #1e1ee0;
  cursor: pointer;
  background-color: transparent;
  text-decoration: none;
  font-weight: 400;
}

.toc-table td:first-child .time-code:hover {
  text-decoration: underline;
}

.toc-table td:nth-child(2) {
  color: #a0a0a0;
  text-align: center;
  padding: 0 0 0 10px;
  width: 0px;
}

.toc-table td:last-child {
  color: #333333;
  line-height: 1.5;
  padding-left: 12px;
}