/* Roadmap Timeline Section */
.roadmap__container {
  max-width: 120rem;
  margin: 0 auto;
  padding: 2rem 0;
  position: relative;
}

/* Central Vertical Line */
.roadmap__container::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: var(--roadmap-line-width);
  background-image: repeating-linear-gradient(
    to bottom,
    var(--roadmap-line-color) 0,
    var(--roadmap-line-color) 10px,
    transparent 10px,
    transparent 20px
  );
  transform: translateX(-50%);
  z-index: 0;
}

.roadmap__timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  z-index: 1;
}

/* Timeline Item - карточки чередуются */
.roadmap__item {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: 1fr;
  grid-auto-rows: 0;
  column-gap: 3rem;
  row-gap: 0;
  position: relative;
  padding-bottom: 6rem;
  align-items: start;
}

.roadmap__item--last {
  padding-bottom: 0;
}

/* Нечетные элементы - карточка справа */
.roadmap__item:nth-child(odd) .roadmap__date-wrapper {
  grid-column: 1 !important;
  grid-row: 1 !important;
  justify-self: end;
  text-align: right;
}

.roadmap__item:nth-child(odd) .roadmap__line-wrapper {
  grid-column: 2 !important;
  grid-row: 1 !important;
}

.roadmap__item:nth-child(odd) .roadmap__card {
  grid-column: 3 !important;
  grid-row: 1 !important;
}

/* Четные элементы - карточка слева */
.roadmap__item:nth-child(even) .roadmap__card {
  grid-column: 1 !important;
  grid-row: 1 !important;
}

.roadmap__item:nth-child(even) .roadmap__line-wrapper {
  grid-column: 2 !important;
  grid-row: 1 !important;
}

.roadmap__item:nth-child(even) .roadmap__date-wrapper {
  grid-column: 3 !important;
  grid-row: 1 !important;
  justify-self: start;
  text-align: left;
}

/* Date */
.roadmap__date-wrapper {
  display: flex;
  align-items: flex-start;
  padding-top: 50px;
}

.roadmap__date {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--roadmap-date-color);
  line-height: 1.2;
}

/* Line wrapper */
.roadmap__line-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 500;
  isolation: isolate;
  min-width: 20px;
  padding-top: 50px;
}

/* Dot */
.roadmap__dot {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  background-color: #bcbcbc !important;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  position: relative;
  display: block !important;
  visibility: visible !important;
  flex-shrink: 0;
}

/* Линия от точки к карточке */
.roadmap__dot::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 3rem;
  height: 1px;
  background-color: var(--roadmap-line-color);
  transform: translateY(-50%);
}

/* Для нечетных - линия вправо */
.roadmap__item:nth-child(odd) .roadmap__dot::after {
  left: 100%;
}

/* Для четных - линия влево */
.roadmap__item:nth-child(even) .roadmap__dot::after {
  right: 100%;
}

/* Card */
.roadmap__card {
  background-color: var(--roadmap-card-background);
  border-radius: 12px;
  padding: 2.4rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08),
              0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  height: fit-content;
  min-height: var(--roadmap-card-min-height, auto);
  min-width: 400px;
  width: 100%;
}

/* Content alignment */
.roadmap__card--align-left {
  text-align: left;
}

.roadmap__card--align-center {
  text-align: center;
}

.roadmap__card--align-right {
  text-align: right;
}

.roadmap__card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12),
              0 2px 6px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.roadmap__card-image {
  margin-bottom: 1.6rem;
  border-radius: 8px;
  overflow: hidden;
}

.roadmap__card-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.roadmap__card-content {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.roadmap__card-heading {
  color: var(--roadmap-heading-color);
  margin: 0;
  font-weight: 700;
  line-height: 1.3;
}

.roadmap__card-text {
  color: var(--roadmap-text-color);
  margin: 0;
  line-height: 1.6;
}

.roadmap__card-text p {
  margin: 0 0 0.8rem 0;
}

.roadmap__card-text p:last-child {
  margin-bottom: 0;
}

.roadmap__card-button {
  align-self: flex-start;
  margin-top: 0.4rem;
}

/* Mobile Styles */
@media screen and (max-width: 749px) {
  /* Скрыть центральную линию */
  .roadmap__container::before {
    display: none;
  }

  /* Простой вертикальный layout */
  .roadmap__item {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 3rem;
  }

  /* Скрыть точки и линии */
  .roadmap__line-wrapper {
    display: none !important;
  }

  /* Дата для всех */
  .roadmap__item:nth-child(odd) .roadmap__date-wrapper,
  .roadmap__item:nth-child(even) .roadmap__date-wrapper {
    padding-top: 0;
    text-align: left;
  }

  .roadmap__date {
    font-size: 1.4rem;
  }

  /* Карточки для всех */
  .roadmap__item:nth-child(odd) .roadmap__card,
  .roadmap__item:nth-child(even) .roadmap__card {
    padding: 1.6rem;
    min-width: 0;
    width: 100%;
  }

  .roadmap__card-image {
    margin-bottom: 1.2rem;
  }

  .roadmap__card-content {
    gap: 1rem;
  }
}

/* Tablet Styles */
@media screen and (min-width: 750px) and (max-width: 989px) {
  .roadmap__item {
    gap: 2rem;
  }

  .roadmap__date {
    font-size: 1.6rem;
  }

  .roadmap__dot::after {
    width: 2rem;
  }
}

/* Desktop Large */
@media screen and (min-width: 990px) {
  .roadmap__container {
    padding: 3rem 0;
  }

  .roadmap__item {
    padding-bottom: 5rem;
  }

  .roadmap__card {
    padding: 3rem;
  }
}

/* Reduce animation on mobile */
@media screen and (max-width: 749px) {
  .roadmap__card {
    animation-duration: 0.5s;
  }
  
  .roadmap__date-wrapper {
    animation-duration: 0.4s;
  }
  
  .roadmap__dot {
    animation-duration: 0.4s;
  }
}

/* Disable animations if user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .roadmap__card,
  .roadmap__date-wrapper,
  .roadmap__dot {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  
  .roadmap__card:hover {
    transform: none;
  }
}
