.timeline-block {
padding: 3rem 0;

.section-header {
margin: 0 auto 3rem;
    max-width: 600px;
}

  .timeline-button {
	position: absolute;
	top: 1rem;
	right: 1rem;
  border: none;
  background-color: transparent;
  cursor: pointer;
  transition: transform 0.3s ease;

  i {
    color: #FF8E38;
    font-size: 2rem;
    transition: transform 0.3s ease;
  }

  &:hover i {
    transform: scale(1.1);
  }
}

  .timeline-steps {
    display: grid;
    grid-template-rows: repeat(5, 200px);
    margin-bottom: 100px;
  }

  .item-1 {
    grid-area: 1 / 2 / 2 / 3;
  }

  .item-2 {
    grid-area: 2 / 1 / 3 / 2;
  }

  .item-3 {
    grid-area: 3 / 2 / 4 / 3;
  }

  .item-4 {
    grid-area: 4 / 1 / 5 / 2;
  }

  .item-5 {
    grid-area: 5 / 2 / 6 / 3;
  }

  .item {
    position: relative;

    .timeline-count {
      position: absolute;
      width: 56px;
      height: 56px;
      line-height: 56px;
      text-align: center;
      font-family: Sora, sans-serif;
      font-weight: 700;
      font-size: 1.75rem;

      &::before {
        content: "";
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        box-sizing: border-box;
        z-index: -1;
        background-image: url("./step.svg");
        background-repeat: no-repeat;
        background-size: contain;
      }

      &::after {
        content: "";
        position: absolute;
        width: 0.25rem;
        height: 145px;
        top: 56px;
        left: 50%;
        border: 2px dashed #ff8e38ff;
        z-index: -2;
      }
    }

    &:nth-child(odd) {
      justify-self: start;
      margin-left: 106px;

      .timeline-count {
        top: 50%;
        left: -33.5%;
      }
    }

    &:nth-child(even) {
      justify-self: end;
      margin-right: 106px;

      .timeline-count {
        top: 50%;
        right: -33.5%;
      }
    }

    &:last-child .timeline-count::after {
      height: 200px;
    }
  }



  .timeline-files {
    margin: 0 auto;
    border-radius: 1rem;
    border: 4px solid #ff8e38;
    background: #fff;
    box-shadow: 0 6px 16px 0 rgb(44 93 133 / 15%);
    display: flex;
    width: 21.5rem;
    padding: 1rem 0.5rem 0.5rem;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;

    .timeline-file {
      flex: 1 1 0;
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 1rem;
      flex-direction: column;

      img {
        width: 48px;
      }

      .btn {
        width: 100%;
      }
    }
  }
}

  .timeline-step {
    border-radius: 1rem;
    box-shadow: 0 6px 16px 0 rgb(44 93 133 / 15%);
    min-height: 270px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    background: #fff;
    width: 400px;
  }

  .timeline-step-header {
    padding: 1.5rem;
  }

  .timeline-step-image {
    width: 24px;
    margin-bottom: 1rem;
  }

  .timeline-step-title {
    margin: 0;
  }

  .timeline-step-content {
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    background-color: #eef7fe;
  }

@media (width <= 1023px) {
  .timeline-block {
    margin-bottom: 100px;

    .timeline-steps {
      display: block;
    }

    .item {
      margin-left: auto !important;
      margin-right: auto !important;
      margin-top: 124px;

      .timeline-count {
        left: 45% !important;
        top: -85px !important;
        z-index: -1;

        &::after {
          height: 400px;
        }
      }

      &:last-child .timeline-count::after {
        height: 465px;
      }
    }
  }
}

@media (width >= 1024px) {
  .timeline-block {
    .timeline-steps {
      margin-bottom: 150px;
    }

    .item {
      &:nth-child(odd) {
        justify-self: start;
        margin-left: 50px;

        .timeline-count {
          top: 50%;
          left: -19.5%;
        }
      }

      &:nth-child(even) {
        justify-self: end;
        margin-right: 50px;

        .timeline-count {
          top: 50%;
          right: -19.5%;
        }
      }
    }
  }
}

@media (width >= 1440px) {
  .timeline-block {
    .item {
      &:nth-child(odd) {
        justify-self: start;
        margin-left: 106px;

        .timeline-count {
          top: 50%;
          left: -33.5%;
        }
      }

      &:nth-child(even) {
        justify-self: end;
        margin-right: 106px;

        .timeline-count {
          top: 50%;
          right: -33.5%;
        }
      }
    }
  }
}

/* Modal Styles */
.timeline-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.timeline-modal.active {
  opacity: 1;
  visibility: visible;
}

.timeline-modal-content {
  background: white;
  border-radius: 1rem;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.timeline-modal.active .timeline-modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  z-index: 10;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.modal-close:hover {
  background-color: #f5f5f5;
  color: #333;
}

.timeline-modal-step {
  padding: 2rem;
}

.timeline-modal-step .timeline-step-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.timeline-modal-step .timeline-step-image {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  border-radius: 1rem;
  overflow: hidden;
}

.timeline-modal-step .timeline-step-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.timeline-modal-step .timeline-step-title {
  margin: 0;
  font-size: 1.75rem;
  color: #0f395c;
  line-height: 1.3;
}

.timeline-modal-step .timeline-step-content {
  background: none;
  border-radius: 0;
  padding: 0;
}

.timeline-modal-step .timeline-step-description {
  font-size: 1rem;
  line-height: 1.6;
  color: #333;
}

.timeline-modal-step .timeline-step-description p {
  margin-bottom: 1rem;
}

.timeline-modal-step .timeline-step-description p:last-child {
  margin-bottom: 0;
}

.timeline-modal-step .timeline-step-cta {
  margin-top: 1.5rem;
  text-align: center;
}

.timeline-modal-step .timeline-step-cta .btn {
  display: inline-block;
}

/* Empêcher le scroll du body quand le modal est ouvert - géré dans _layout.scss */

/* Responsive */
@media (max-width: 768px) {
  .timeline-modal-content {
    width: 95%;
    margin: 1rem;
  }

  .timeline-modal-step {
    padding: 1.5rem;
  }

  .timeline-modal-step .timeline-step-header {
    flex-direction: column;
    text-align: center;
  }

  .timeline-modal-step .timeline-step-image {
    width: 100px;
    height: 100px;
    align-self: center;
  }

  .timeline-modal-step .timeline-step-title {
    font-size: 1.5rem;
  }
}
