/* Carousel Timeline Component */
.timeline-carousel-wrapper {
    width: 80vw;
    height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #93c5fd 0%, #3b82f6 50%, #1e3c72 100%);
    perspective: 1200px;
    overflow: hidden;
    border-radius: 16px;
    margin: 130px auto;
    position: relative;
    z-index: 100 !important; /* ensure timeline sits above the full-screen particles canvas */
    touch-action: pan-y;
}

.timeline-carousel-container {
    touch-action: pan-y;
}

/* Animated Background */
.timeline-animated-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: timelineBgShift 15s ease-in-out infinite;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-left: 60px; /* keep SVG aligned to left of the card */
    pointer-events: none;
}

.timeline-animated-bg svg {
    display: block;
    width: auto;
    height: 100%;
    max-height: 100%; /* never exceed container height */
    max-width: 40%; /* prevent SVG from occupying whole card */
    object-fit: contain;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
}

/* Responsive adjustments for SVGs inside the timeline card */
@media (max-width: 1024px) and (min-width: 769px) {
    .timeline-animated-bg {
        justify-content: center;
        padding-left: 0;
        align-items: center;
    }

    .timeline-animated-bg svg {
        max-width: 58%;
        width: 58%;
        height: auto;
        max-height: 64%;
        margin-top: 10px;
        margin-left: 18px;
    }
}

@media (max-width: 768px) {
    .timeline-animated-bg {
        justify-content: center;
        padding-left: 20px;
        align-items: center;
    }

    .timeline-animated-bg svg {
        max-width: 70%;
        width: 70%;
        height: 60%;
        max-height: 60%;
        margin-top: 8px;
    }
}

/* Keep the first and second slide SVGs at the same size as the others */
.timeline-carousel-container .timeline-carousel-slide:nth-child(1) .timeline-animated-bg svg,
.timeline-carousel-container .timeline-carousel-slide:nth-child(2) .timeline-animated-bg svg {
    max-width: 40%;
    width: auto;
    height: 100%;
    max-height: 100%;
    transform: none;
    object-fit: contain;
    margin-left: 30px;
}

@media (max-width: 1024px) {
    .timeline-carousel-container .timeline-carousel-slide:nth-child(1) .timeline-animated-bg svg,
    .timeline-carousel-container .timeline-carousel-slide:nth-child(2) .timeline-animated-bg svg {
        max-width: 55%;
        width: auto;
        height: 100%;
        max-height: 100%;
        transform: none;
    }
}

@media (max-width: 768px) {
    .timeline-carousel-container .timeline-carousel-slide:nth-child(1) .timeline-animated-bg svg,
    .timeline-carousel-container .timeline-carousel-slide:nth-child(2) .timeline-animated-bg svg {
        max-width: 80%;
        width: auto;
        height: auto;
        max-height: 60%;
        transform: none;
        margin-left: 30px;
    }
}



/* Carousel Slides */
.timeline-carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 10;
}

.timeline-carousel-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: start;
    justify-content: start;
    padding: 40px;
    opacity: 0;
    transform: translateX(-100px) rotateY(-45deg) scale(0.8);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.320, 1);
    pointer-events: none;

}

.timeline-carousel-slide.active {
    opacity: 1;
    transform: translateX(0) rotateY(0deg) scale(1);
    pointer-events: auto;
}

.timeline-carousel-slide.prev {
    transform: translateX(100px) rotateY(45deg) scale(0.8);
}

.timeline-carousel-slide.next {
    transform: translateX(-100px) rotateY(-45deg) scale(0.8);
}

/* Slide Content */
.timeline-slide-inner {
    text-align: right;
    max-width: 500px;
    position: relative;
    z-index: 2;
    pointer-events: auto;
    animation: timelineSlideContentIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes timelineSlideContentIn {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Icon Container */
.timeline-icon-container {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: timelineIconPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

@keyframes timelineIconPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.timeline-icon-container img {
    width: 50px;
    height: 50px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* Typography */
.timeline-slide-number {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 12px;
    animation: timelineFadeInUp 0.6s ease-out 0.1s both;
}

.timeline-slide-title {
    font-size: 42px;
    font-weight: 900;
    color: white;
    margin-bottom: 15px;
    line-height: 1.2;
    animation: timelineFadeInUp 0.6s ease-out 0.2s both;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.timeline-slide-description {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 20px;
    line-height: 1.7;
    animation: timelineFadeInUp 0.6s ease-out 0.3s both;
}

.timeline-slide-timeline {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    letter-spacing: 0.5px;
    animation: timelineFadeInUp 0.6s ease-out 0.4s both;
}

.timeline-roadmap-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 18px;
    padding: 12px 20px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffffff 0%, #dbeafe 100%);
    color: #1d4ed8;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: timelineFadeInUp 0.6s ease-out 0.5s both;
    position: relative;
    z-index: 20;
    pointer-events: auto;
}

.timeline-roadmap-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

@keyframes timelineFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Controls */
.timeline-carousel-controls {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    align-items: center;
    z-index: 100;
}

/* Navigation Dots */
.timeline-carousel-dots {
    display: flex;
    gap: 10px;
}

.timeline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.timeline-dot.active {
    width: 25px;
    border-radius: 5px;
    background: white;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

.timeline-dot:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* Navigation Arrows */
.timeline-carousel-arrow {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-weight: bold;
}

.timeline-carousel-arrow:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* Progress Bar */
.timeline-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    z-index: 99;
    animation: timelineProgress 5s linear forwards;
    border-radius: 0 0 16px 0;
}

@keyframes timelineProgress {
    from { width: 0%; }
    to { width: 100%; }
}

@media (max-width: 1024px) {
    .timeline-carousel-wrapper {
        width: min(92vw, 100%);
        height: auto;
        min-height: 560px;
        margin: 400px auto 32px;
        border-radius: 20px;
        padding-bottom: 92px;
    }

    .timeline-carousel-container {
        min-height: 520px;
    }
}

@media (max-width: 768px) {
    .timeline-carousel-wrapper {
        width: min(94vw, 120%);
        height: auto;
        min-height: 560px;
        margin: 400px auto 32px;
        border-radius: 20px;
        padding-bottom: 92px;
    }

    .timeline-carousel-container {
        min-height: 520px;
    }

    .timeline-carousel-slide {
        padding: 24px 20px 110px;
        align-items: stretch;
        justify-content: flex-start;
        transform: translateX(0) translateY(18px) scale(0.98);
    }

    .timeline-carousel-slide.active {
        transform: translateX(0) translateY(0) scale(1);
    }

    .timeline-slide-inner {
        max-width: 100%;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        text-align: right;
    }

    .timeline-slide-title {
        font-size: clamp(24px, 5vw, 32px);
        margin-bottom: 12px;
    }

    .timeline-slide-description {
        font-size: 14px;
        line-height: 1.6;
        margin-bottom: 14px;
    }

    .timeline-slide-timeline {
        font-size: 13px;
    }

    .timeline-icon-container {
        width: 72px;
        height: 72px;
        margin-bottom: 14px;
    }

    .timeline-icon-container img {
        width: 36px;
        height: 36px;
    }

    .timeline-animated-bg {
        justify-content: center;
        padding-left: 0;
        opacity: 0.95;
        align-items: center;
        filter: saturate(1.1);
    }

    .timeline-animated-bg svg {
        max-width: 72%;
        width: 72%;
        height: auto;
        max-height: 60%;
        transform: none;
        display: block;
        margin: 200px -30px 0px 0;
        filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.3)) brightness(1.05) contrast(1.03);
    }

    .timeline-carousel-controls {
        bottom: 18px;
        width: auto;
        gap: 10px;
        justify-content: center;
        align-items: center;
        flex-wrap: nowrap;
        padding-top: 4px;
    }

    .timeline-carousel-dots {
        order: 2;
        width: auto;
        justify-content: center;
    }

    .timeline-carousel-controls .timeline-carousel-arrow:first-child {
        order: 1;
    }

    .timeline-carousel-controls .timeline-carousel-arrow:last-child {
        order: 3;
    }

    .timeline-carousel-arrow {
        width: 42px;
        height: 42px;
        font-size: 15px;
        margin: 0;
    }

    .timeline-roadmap-btn {
        width: 100%;
        max-width: 220px;
        padding: 11px 16px;
        margin-top: 12px;
        font-size: 14px;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
    }
}

.tl-panel.hidden { display: none; }

#timeline-inner {
    position: relative;
    min-height: 200px;
}