body {
    background: #111;
    color: #fff;
    overflow-x: hidden;
    margin: 0;
    scroll-behavior: smooth;
}

.timeline-header{
    max-width: 700px;
    margin: 140px auto 60px auto;
    text-align: center;
    padding: 0 20px;
}

.timeline-header h1 {
    font-size: 5.4rem;
    color: #fff;
    margin-bottom: 18px;
    font-weight: 700;
    border-bottom: 4px solid #F28C28;
}

.timeline-header p {
    font-size: 1.2rem;
    color: #ccc;
    margin-bottom: 40px;
}

.scroll-down {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 40px;
    animation: bounce 2s infinite;
}

.scroll-down span {
    color: white;
    font-size: 16px;
}

.scroll-down img {
    width: 24px;
    height: 24px;
    margin-top: 10px;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* WRAPPER */
.timeline-wrapper {
    height: 500vh; /* dužina skrola */
    position: relative;
}

/* STICKY HORIZONTAL TRACK */
.timeline-track {
    position: sticky;
    top: 80px; /* Spusti ispod headera, povecaj po potrebi */
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 200px;
    padding-left: 10vw;
    /* Center children vertically in viewport */
    z-index: 10;
}

/* PROGRESS LINE */
.timeline-progress {
    position: absolute;
    top: 50%;
    left: 0;
    height: 4px;
    width: 0;
    background: #F28C28;
    z-index: 1;
    transition: width 0.2s linear;
}

/* DOTS */
.timeline-item {
    position: relative;
}

.timeline-item::before {
    content: "";
    width: 22px;
    height: 22px;
    background: #222;
    border: 4px solid #F28C28;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

/* CARD BASE */
.card {
    width: 180px; /* SMALL PREVIEW */
    height: 180px;
    background: #1b1b1b;
    padding: 35px;
    border-radius: 32px; /* Veći radius za lepši efekat */
    border: 1px solid #333;
    cursor: default;

    display: flex;
    flex-direction: column;

    overflow: hidden;
    opacity: 0.5;

    /* Center card vertically in viewport, accounting for header height (if any) */
    position: relative;
    top: 50%;
    left: 0;
    transform: translateY(-50%);

    transition:
        width 0.5s ease,
        height 0.5s ease,
        opacity 0.5s ease,
        border-radius 0.5s ease,
        transform 0.5s ease;
}

/* CARD CONTENT */
.card h1 {
    font-size: 18px;
    margin: 0 0 10px 0;
}
.card p {
    display: none;
}
.card a {
    display: none;
}

.card-number{
  -webkit-text-stroke: 2px #F28C28;
    -webkit-text-fill-color: transparent;
    color: transparent;
    margin-right: 10px;
    font-size: 50px;
}

/* ACTIVE CARD → EXPANDED ACCORDION */
.timeline-item.active .card {
    width: 600px;
    height: 300px;

    opacity: 1;
    /* Keep card vertically centered when expanded */
    transform: translateY(-50%);

    border-radius: 32px; /* Održi radius i kada je otvorena */
}

/* SHOW CONTENT ONLY WHEN ACTIVE */
.timeline-item.active .card p{
    display: block;
    font-size: 24px;
}

.timeline-item.active .card h1 {
    font-size: 26px;
}

.timeline-item.active .card a {
    display: inline-block;
    margin-top: auto;
    font-size: 18px;
    margin-right:10px;
}
.final-card-title{
    /* -webkit-text-stroke: 2px #F28C28;
    -webkit-text-fill-color: transparent; */
    color: white;
    margin-right: 10px;
    font-size: 40px !important;
}

/* SMALL CARDS (PREVIEWS) */
.timeline-item:not(.active) .card {
    /* Ukloni clip-path da ne "seče" karticu, zadrži border-radius */
    /* clip-path: none; */
}

/* Prikaz samo na desktopu */
.timeline-wrapper-desktop { display: block; }
.timeline-wrapper-mobile { display: none; }

@media (max-width: 768px) {
  .timeline-header {
    margin: 80px auto 32px auto;
    padding: 0 8px;
    text-align: center;
  }

  .timeline-header h1 {
    font-size: 3rem;
    margin-bottom: 12px;
    width: fit-content;
    margin: 0 auto 12px auto;
  } 

  .timeline-header p {
    font-size: 1rem;
    margin-bottom: 24px;
    width: 80%;
    margin:0 auto;
  }

  .timeline-track {
    flex-direction: column;
    height: auto;
    gap: 48px;
    padding-left: 0;
    align-items: flex-start;
    position: relative;
    top: 0;
  }
  .timeline-item {
    width: 100%;
    display: flex;
    align-items: flex-start;
    position: relative;
    min-height: 120px;
  }
  .timeline-item::before {
    left: 24px;
    top: 32px;
    transform: none;
  }
  .card {
    width: 90vw;
    min-width: 0;
    height: auto;
    margin-left: 48px;
    transform: none !important;
    top: 0;
    opacity: 1 !important;
    clip-path: none !important;
  }
  .timeline-item.active .card {
    width: 90vw;
    height: auto;
    font-size: 1rem;
    transform: none;
  }
  .timeline-progress {
    left: 34px;
    top: 0;
    width: 4px;
    height: 100%;
    min-height: 100px;
    transition: height 0.2s linear;
  }
  .our-services-holder {
    margin-top: 32px;
    padding: 0 8px;
  }

  .timeline-wrapper-desktop {
    display: block !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100vw;
    height: 340px;
    position: relative;
    margin-bottom: 32px;
  }
  .timeline-wrapper-desktop .timeline-track {
    flex-direction: row;
    height: 320px;
    align-items: center;
    gap: 32px;
    padding-left: 24px;
    padding-right: 24px;
    min-width: 600px;
    width: max-content;
    position: static;
    top: 0;
  }
  .timeline-wrapper-desktop .timeline-item {
    min-width: 220px;
    width: 220px;
    flex: 0 0 auto;
    position: relative;
  }
  .timeline-wrapper-desktop .card {
    width: 220px;
    height: 180px;
    margin: 0;
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    top: 0;
  }
  .timeline-wrapper-desktop .timeline-item.active .card {
    width: 220px;
    height: 180px;
    font-size: 1rem;
    transform: none;
  }
  .timeline-wrapper-desktop .timeline-progress {
    top: 90%;
    left: 0;
    height: 4px;
    width: 0;
    min-width: 0;
    transition: width 0.2s linear;
  }
  .timeline-wrapper-mobile {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .timeline-wrapper-desktop { display: none !important; }
  .timeline-wrapper-mobile { display: block !important; }

  .timeline-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
    position: relative;
    margin: 32px 0 200px 00px;
    padding-left: 18px; /* povećaj padding da linija bude centrirana ispod kružića */
    padding-right: 18px;
}
  .timeline-mobile-item {
    display: flex;
    align-items: flex-start;
    position: relative;
    min-height: 80px;
  }
  .timeline-mobile-dot {
    width: 22px;
    height: 22px;
    background: #222;
    border: 4px solid #F28C28;
    border-radius: 50%;
    margin-right: 4px;
    margin-top: 8px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    left: -12px; /* centriraj kružić na liniju */
  }
  .timeline-mobile-list::before {
    content: "";
    position: absolute;
    
    top: 0;
    width: 4px;
    height: 100%;
    background: #F28C28;
    z-index: 1;
  }
  .timeline-mobile-card {
    background: #1b1b1b;
    border-radius: 24px;
    border: 1px solid #333;
    padding: 18px 18px 18px 18px;
    color: #fff;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 2px 12px 0 rgba(0,0,0,0.08);
    opacity: 0.5;
    transition: opacity 0.4s, box-shadow 0.4s;
  }
  .timeline-mobile-item.active .timeline-mobile-card {
    opacity: 1;
    box-shadow: 0 4px 24px 0 rgba(242,140,40,0.18);
  }
  .timeline-mobile-card h1 {
    font-size: 1.2rem;
    margin: 0 0 8px 0;
  }
  .timeline-mobile-card p {
    font-size: 1rem;
    margin: 0 0 8px 0;
    color: #ccc;
  }

  .card-cta-holder{
    margin-top: 16px;
    display: flex;
    gap: 12px;
  }
  
}

