.progress {
  width: 100%;
  height: 8px;
  background-color: var(--theme-purple-color);
  position: relative;
  border-radius: 12px;
  overflow: hidden;

  &::before {
    content: '';
    background-color: var(--theme-green-color);
    width: calc(var(--pool-epoch-tranche-percentage) * 1%);
    position: absolute;
    left: 0;
    right: 0;
    height: 100%;
  }
}

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;

  @media (max-width: 1024px) {
    grid-template-columns: 1fr;
  }
}

.epochCard {
  background-color: var(--theme-card-color);
  border-radius: 4px;
  // padding: 44px 24px 16px;
  position: relative;

  &.epochCardPrimary {
    // box-shadow: 0 0 0 1px rgba(6, 10, 13, 0.03), 0 2px 4px rgba(6, 10, 13, 0.04);
    // background-color: var(--theme-body-color);
    border: 1px solid var(--theme-border-color);
  }

  &.epochCardSecondary {
    background-color: var(--theme-body-color);
    border: 1px solid var(--theme-border-color);
  }
}

.epochCardTitleWrap {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  border: 1px solid var(--theme-card-color);
  padding: 3px;
  border-radius: 64px;
  // background-color: var(--theme-card-color);

  .epochCardPrimary & {
    background-color: var(--theme-card-color);
  }

  .epochCardSecondary & {
    background-color: var(--theme-body-color);
    border-color: var(--theme-border-color);
  }
}

.epochCardTitle {
  border-radius: 32px;
  padding: 8px 24px;

  .epochCardPrimary & {
    background-color: rgba(var(--theme-red-color-rgb), 0.08);
  }

  .epochCardSecondary & {
    background-color: rgba(var(--theme-secondary-color-rgb), 0.08);
  }
}

.epochCardHeader {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding-top: 16px;

  @media (max-width: 1024px) {
    grid-template-columns: 1fr;
  }
}

.epochCardHeaderItem {
  border-bottom: 1px solid var(--theme-border-color);
  padding: 24px;

  &:nth-of-type(odd) {
    border-right: 1px solid var(--theme-border-color);
  }
}

.epochCardDlRow {
  display: flex;
  align-items: center;
  margin-bottom: 24px;

  dt {
    margin-right: 8px;
  }

  dd {
    margin-left: auto;
  }
}

.epochProgress {
  display: grid;
  grid-template-columns: 24% 1fr 24%;
  align-items: center;
  padding-top: 16px;

  @media (max-width: 1024px) {
    grid-template-columns: 1fr;
  }
}

.epochProgressLineBefore {
  position: relative;
  height: 4px;
  margin-right: 4px;

  &::before {
    content: '';
    position: absolute;
    left: 8px;
    width: 4px;
    height: 4px;
    border-radius: 4px;
    background-color: var(--theme-red-color);
    box-shadow: -8px 0 0 0 var(--theme-red-color), 0 0 0 0 var(--theme-red-color), 8px 0 0 0 var(--theme-red-color);
  }

  &::after {
    content: '';
    position: absolute;
    left: 24px;
    right: 0;
    height: 4px;
    border-radius: 4px;
    background-color: var(--theme-red-color);
  }

  @media (max-width: 1024px) {
    display: none;
  }
}

.epochProgressLineAfter {
  position: relative;
  height: 4px;
  margin-left: 4px;

  &::before {
    content: '';
    position: absolute;
    right: 8px;
    width: 4px;
    height: 100%;
    border-radius: 4px;
    background-color: var(--theme-border-color);
    box-shadow: -8px 0 0 0 var(--theme-border-color), 0 0 0 0 var(--theme-border-color),
      8px 0 0 0 var(--theme-border-color);
  }

  &::after {
    content: '';
    position: absolute;
    right: 24px;
    left: 0;
    height: 100%;
    border-radius: 4px;
    background-color: var(--theme-border-color);
  }

  @media (max-width: 1024px) {
    display: none;
  }
}

.epochProgressLineMiddle {
  height: 4px;
  border-radius: 4px;
  background-color: var(--theme-border-color);
  flex-grow: 1;
  margin: 0 4px;
  position: relative;

  &::before {
    content: '';
    position: absolute;
    width: calc(var(--epoch-progress) * 1%);
    height: 100%;
    background-color: var(--theme-red-color);
    border-radius: 4px;
  }

  &::after {
    content: '';
    position: absolute;
    left: calc(var(--epoch-progress) * 1%);
    top: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background-color: var(--theme-white-color);
    border: 2px solid var(--theme-red-color);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(var(--theme-red-color-rgb), 0.32);
  }
}

.epochProgressCurrent {
  color: var(--theme-white-color);
  background-color: var(--theme-red-color);
  padding: 4px 4px 4px 12px;
  border-radius: 12px;
  font: var(--font-sm-bold);
  position: relative;

  &::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 8px;
    background-color: var(--theme-red-color);
  }
}

.epochProgressNext {
  color: var(--theme-secondary-color);
  // background-color: var(--theme-red-color);
  border: 1px solid var(--theme-border-color);
  padding: 3px 12px;
  border-radius: 12px;
  font: var(--font-sm-bold);
  position: relative;

  &::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 8px;
    background-color: var(--theme-border-color);
  }
}

.epochSpinner {
  display: flex;
  justify-content: center;
  align-items: center;

  width: 16px;
  height: 16px;
  border-radius: 50%;

  background: conic-gradient(from 180deg at 50% 50%, rgba(255, 255, 255, 0) 0deg, #fff 360deg);
  animation: rotating 2s linear infinite;

  &::after {
    content: '';
    border-radius: 50%;
    width: 12px;
    height: 12px;
    background: var(--theme-red-color);
  }
}

@keyframes rotating {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}
