/* How It Works Section */
.how-it-works-section {
  padding: 60px 0;
  position: relative;
}

/* Desktop: Professional Progress Timeline */
.progress-timeline {
  display: block;
  margin-top: 50px;
  position: relative;
  padding: 0 5%;
}

.timeline-track {
  position: absolute;
  top: 50px;
  left: 10%;
  right: 10%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.timeline-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #06b6d4, #0ea5e9, #10b981, #f59e0b, #ef4444);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
}

.timeline-nodes {
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.timeline-node {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  cursor: pointer;
}

.node-circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.01);
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 20px;
  transition: all 1.2s cubic-bezier(0.45, 0.5, 0.45, 1);
  position: relative;
  z-index: 3;
  transform: scale(1) translateY(0);
}

/* Рандомная анимация подпрыгивания для каждого кружка */
.timeline-node[data-step="1"] .node-circle {
  animation: randomBounce1 8s ease-in-out infinite;
  width: 60px;
  height: 60px;
  font-size: 20px;
}

.timeline-node[data-step="2"] .node-circle {
  animation: randomBounce2 10s ease-in-out infinite;
  width: 65px;
  height: 65px;
  font-size: 22px;
}

.timeline-node[data-step="3"] .node-circle {
  animation: randomBounce3 12s ease-in-out infinite;
  width: 70px;
  height: 70px;
  font-size: 24px;
}

.timeline-node[data-step="4"] .node-circle {
  animation: randomBounce4 9s ease-in-out infinite;
  width: 75px;
  height: 75px;
  font-size: 26px;
}

.timeline-node[data-step="5"] .node-circle {
  animation: randomBounce5 11s ease-in-out infinite;
  width: 80px;
  height: 80px;
  font-size: 28px;
}

/* Останавливаем анимацию при активном состоянии */
.timeline-node.active .node-circle {
  animation: none !important;
}

.node-circle span {
  position: relative;
  color: transparent;
}

/* Desktop: Show number by default */
.node-circle span::before {
  content: attr(data-number);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  color: #ffffff;
  font-size: 18px;
  opacity: 1;
  transition: all 0.8s cubic-bezier(0.45, 0.5, 0.45, 1);
}

/* Desktop: "Нажми" hint */
.node-circle span::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
  color: rgba(255, 255, 255, 1);
  text-shadow: none;
  pointer-events: none;
}

.timeline-node:not(.active) .node-circle.show-hint {
  border-radius: 12px;
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition-delay: 0.4s;
  border-color: rgba(255, 255, 255, 0.08);
}

.timeline-node[data-step="1"]:not(.active) .node-circle.show-hint {
  width: 85px;
  height: 60px;
}

.timeline-node[data-step="2"]:not(.active) .node-circle.show-hint {
  width: 90px;
  height: 65px;
}

.timeline-node[data-step="3"]:not(.active) .node-circle.show-hint {
  width: 95px;
  height: 70px;
}

.timeline-node[data-step="4"]:not(.active) .node-circle.show-hint {
  width: 100px;
  height: 75px;
}

.timeline-node[data-step="5"]:not(.active) .node-circle.show-hint {
  width: 105px;
  height: 80px;
}

.timeline-node:not(.active) .node-circle:not(.show-hint) {
  border-radius: 50%;
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition-delay: 0s;
}

.timeline-node:not(.active) .node-circle span.show-hint::before {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
  transition-delay: 0s;
}

.timeline-node:not(.active) .node-circle span:not(.show-hint)::before {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  transition-delay: 0.4s;
}

.timeline-node:not(.active) .node-circle span.show-hint::after {
  content: 'Нажми';
  opacity: 0.5;
  transform: translate(-50%, -50%) scale(1.3);
  transition-delay: 0.4s;
}

.timeline-node:not(.active) .node-circle span:not(.show-hint)::after {
  content: 'Нажми';
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
  transition-delay: 0s;
}

.node-circle::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, transparent, transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.timeline-node[data-step="1"] .node-circle::before {
  background: linear-gradient(135deg, #06b6d4, #0ea5e9);
}

.timeline-node[data-step="2"] .node-circle::before {
  background: linear-gradient(135deg, #0ea5e9, #9333ea);
}

.timeline-node[data-step="3"] .node-circle::before {
  background: linear-gradient(135deg, #10b981, #14b8a6);
}

.timeline-node[data-step="4"] .node-circle::before {
  background: linear-gradient(135deg, #f59e0b, #f97316);
}

.timeline-node[data-step="5"] .node-circle::before {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.timeline-node.active .node-circle {
  border-color: transparent;
  color: #ffffff;
  transform: scale(1.2) translateY(0);
  box-shadow: 0 8px 24px rgba(6, 182, 212, 0.4);
  animation: moveCircleUpDesktop 0.6s ease-out 1.2s forwards;
}

.timeline-node.active .node-circle span::before {
  color: #ffffff;
  opacity: 1;
}

.timeline-node.active .node-circle span::after {
  content: '';
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
}

@keyframes moveCircleUpDesktop {
  from {
    transform: scale(1.2) translateY(0);
  }

  to {
    transform: scale(1.2) translateY(-10px);
  }
}

.timeline-node.active .node-circle::before {
  opacity: 1;
}

.timeline-node:hover .node-circle {
  transform: scale(1.15) translateY(-5px);
  border-color: rgba(6, 182, 212, 0.5);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 12px 40px rgba(6, 182, 212, 0.25),
    0 0 0 8px rgba(6, 182, 212, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.node-content {
  text-align: center;
  opacity: 1;
  transition: all 1.2s cubic-bezier(0.45, 0.5, 0.45, 1);
  max-height: 100px;
  overflow: hidden;
}

.timeline-node.active .node-content {
  opacity: 1;
  max-height: 500px;
}

/* How It Works Section */
.how-it-works-section {
  padding: 60px 0;
  position: relative;
}

.how-it-works-section .node-content h4 {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  margin-bottom: 6px !important;
  opacity: 1;
  transform: translateY(0);
  transition: all 0.4s cubic-bezier(0.45, 0.5, 0.45, 1);
}

.how-it-works-section .node-time {
  font-size: 11px !important;
  color: #ffffff !important;
  margin-bottom: 12px !important;
  opacity: 0.9;
  transform: translateY(0);
  transition: all 0.4s cubic-bezier(0.45, 0.5, 0.45, 1);
}

.how-it-works-section .node-details {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.4s cubic-bezier(0.45, 0.5, 0.45, 1);
  font-size: 10px !important;
  color: #ffffff !important;
  line-height: 1.5 !important;
  text-align: left;
}

.how-it-works-section .node-details p {
  margin: 2px 0 !important;
  text-align: left;
  font-size: 10px !important;
  color: #ffffff !important;
}

.how-it-works-section .node-details strong {
  display: block;
  text-align: left;
  font-size: 10px !important;
  margin-top: 6px !important;
  margin-bottom: 3px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
}

.timeline-node.active .node-details {
  max-height: 350px;
  opacity: 1;
  margin-top: 6px;
  transform: translateY(0);
}

.cards-timeline {
  display: none;
}

/* Рандомные анимации подпрыгивания для кружков */
@keyframes randomBounce1 {
  0%,
  100% {
    transform: scale(1) translateY(0);
  }

  15% {
    transform: scale(1.05) translateY(-6px);
  }

  20% {
    transform: scale(1) translateY(0);
  }
}

@keyframes randomBounce2 {
  0%,
  100% {
    transform: scale(1) translateY(0);
  }

  35% {
    transform: scale(1.12) translateY(-12px);
  }

  40% {
    transform: scale(1) translateY(0);
  }
}

@keyframes randomBounce3 {
  0%,
  100% {
    transform: scale(1) translateY(0);
  }

  55% {
    transform: scale(1.08) translateY(-8px);
  }

  60% {
    transform: scale(1) translateY(0);
  }
}

@keyframes randomBounce4 {
  0%,
  100% {
    transform: scale(1) translateY(0);
  }

  25% {
    transform: scale(1.15) translateY(-15px);
  }

  30% {
    transform: scale(1) translateY(0);
  }
}

@keyframes randomBounce5 {
  0%,
  100% {
    transform: scale(1) translateY(0);
  }

  45% {
    transform: scale(1.06) translateY(-5px);
  }

  50% {
    transform: scale(1) translateY(0);
  }
}

/* Mobile: Cards Timeline (only for small screens) */
@media (max-width: 768px) {
  .cards-timeline {
    display: none !important;
  }

  .progress-timeline {
    display: block;
    margin-top: 60px;
    padding: 0 20px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .timeline-track {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    bottom: 0;
    width: 4px;
    height: auto;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
  }

  .timeline-progress {
    width: 100%;
    height: 0%;
    background: linear-gradient(180deg, #06b6d4, #0ea5e9, #10b981, #f59e0b, #ef4444);
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
  }

  .timeline-nodes {
    display: block;
    position: relative;
  }

  .timeline-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 50px;
    position: relative;
    cursor: pointer;
    transition: all 3.2s cubic-bezier(0.45, 0.5, 0.45, 1);
  }

  .timeline-node:last-child {
    margin-bottom: 0;
  }

  .node-circle {
    position: relative;
    left: 0;
    top: 0;
    width: 55px;
    height: 55px;
    margin-bottom: 16px;
    flex-shrink: 0;
    transition: all 3.2s cubic-bezier(0.45, 0.5, 0.45, 1);
    transform: scale(1) translateX(0) translateY(0);
    border-radius: 50%;
  }

  /* Усиленная анимация для мобильных */
  .timeline-node:not(.active)[data-step="1"] .node-circle {
    animation: randomBounce1 8s ease-in-out infinite !important;
  }

  .timeline-node:not(.active)[data-step="2"] .node-circle {
    animation: randomBounce2 10s ease-in-out infinite !important;
  }

  .timeline-node:not(.active)[data-step="3"] .node-circle {
    animation: randomBounce3 12s ease-in-out infinite !important;
  }

  .timeline-node:not(.active)[data-step="4"] .node-circle {
    animation: randomBounce4 9s ease-in-out infinite !important;
  }

  .timeline-node:not(.active)[data-step="5"] .node-circle {
    animation: randomBounce5 11s ease-in-out infinite !important;
  }

  .timeline-node:not(.active) .node-circle.show-hint {
    width: 130px;
    height: 75px;
    border-radius: 12px;
    transition: all 2.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-delay: 1.2s;
  }

  .timeline-node:not(.active) .node-circle:not(.show-hint) {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    transition: all 2.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-delay: 0s;
  }

  .timeline-node.active .node-circle {
    margin-bottom: 0;
    margin-right: 16px;
    transform: scale(1) translateX(0) translateY(0);
    animation: none;
  }

  .node-circle span {
    font-size: 20px;
    display: inline-block;
    position: relative;
    color: transparent;
    transition: all 1.6s cubic-bezier(0.45, 0.5, 0.45, 1);
  }

  .node-circle span::before {
    content: attr(data-number);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    color: #ffffff;
    font-size: 20px;
    opacity: 1;
    transition: all 2.4s cubic-bezier(0.45, 0.5, 0.45, 1);
  }

  .timeline-node:not(.active) .node-circle span.show-hint::before {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
    transition-delay: 0s;
  }

  .timeline-node:not(.active) .node-circle span:not(.show-hint)::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    transition-delay: 1.2s;
  }

  .node-circle span::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: all 2.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    color: rgba(255, 255, 255, 1);
    text-shadow: none;
    pointer-events: none;
  }

  .timeline-node:not(.active) .node-circle span.show-hint::after {
    content: 'Нажми';
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(1.5);
    transition-delay: 1.2s;
  }

  .timeline-node:not(.active) .node-circle span:not(.show-hint)::after {
    content: 'Нажми';
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
    transition-delay: 0s;
  }

  .timeline-node.active .node-circle span::before {
    opacity: 1;
  }

  .timeline-node.active .node-circle span::after {
    content: '';
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
  }

  .node-content {
    text-align: center;
    opacity: 1;
    transition: all 3.2s cubic-bezier(0.45, 0.5, 0.45, 1);
    width: 100%;
    max-height: 100px;
    overflow: hidden;
  }

  .timeline-node.active .node-content {
    text-align: left;
    display: flex;
    flex-direction: column;
    max-height: 1000px;
  }

  .how-it-works-section .node-content h4 {
    font-size: 18px !important;
    margin-bottom: 6px !important;
    color: #ffffff !important;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s cubic-bezier(0.45, 0.5, 0.45, 1);
    font-weight: 700 !important;
  }

  .how-it-works-section .timeline-node.active .node-content h4 {
    margin-left: 0;
    font-size: 18px !important;
    opacity: 1;
    transform: translateY(0);
  }

  .how-it-works-section .node-time {
    font-size: 14px !important;
    margin-bottom: 12px !important;
    color: #ffffff !important;
    opacity: 0.9;
    transform: translateY(0);
    transition: all 0.6s cubic-bezier(0.45, 0.5, 0.45, 1);
    font-weight: 600 !important;
  }

  .how-it-works-section .timeline-node.active .node-time {
    margin-left: 0;
    font-size: 14px !important;
    margin-bottom: 10px !important;
    opacity: 1;
    transform: translateY(0);
  }

  .how-it-works-section .node-details {
    font-size: 12px !important;
    line-height: 1.5 !important;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.6s cubic-bezier(0.45, 0.5, 0.45, 1);
    margin-left: 0;
    font-weight: 500 !important;
  }

  .how-it-works-section .node-details strong {
    color: #ffffff !important;
    display: block;
    margin-top: 6px !important;
    margin-bottom: 3px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
  }

  .how-it-works-section .node-details p {
    margin: 2px 0 !important;
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 500 !important;
  }

  .how-it-works-section .timeline-node.active .node-details {
    max-height: 600px;
    opacity: 1;
    transform: translateY(0);
    margin-top: 12px;
    margin-left: 0;
  }

  .how-it-works-section {
    padding: 10px 0 60px 0 !important;
  }

  .how-it-works-section .section-header {
    margin-bottom: 15px !important;
  }
}

