/* Redesigned Milestones Section */
.milestones-container {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    position: relative;
}

.milestones-container::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    transform: translateX(-50%);
    z-index: 1;
}

.milestone-card {
    display: flex;      
    align-items: center;
    gap: 3rem;
    position: relative;
    background: #ffffff;
    border-radius: 5px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.milestone-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.milestone-card:nth-child(even) {
    flex-direction: row-reverse;
}

.milestone-image {
    flex: 1;
    position: relative;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.milestone-image img {
    width: 100%;
    /* height: 250px; */
    object-fit: cover;
    transition: transform 0.3s ease;
}

.milestone-image:hover img {
    transform: scale(1.05);
}

.milestone-year-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(59, 93, 124, 0.3);
    z-index: 2;
}

.milestone-content {
    flex: 1;
    position: relative;
}

.milestone-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 6px 20px rgba(59, 93, 124, 0.3);
}

.milestone-content h3 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    position: relative;
    font-family: Math;
}

.milestone-content p {
    font-size: 1rem;
    line-height: 1.7;
    color: #64748b;
    margin: 0;
}

/* Timeline connector dots */
.milestone-card::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border: 4px solid #ffffff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 4px rgba(59, 93, 124, 0.2);
    z-index: 2;
}

/* Responsive Design */
@media (max-width: 991px) {
    .milestones-container {
        gap: 2rem;
        padding-left: 22px;
        /* Space for timeline on left */
    }

    .milestones-container::before {
        left: 20px;
        /* Move line to left */
        transform: none;
        /* simple position */
        width: 3px;
    }

    .milestone-card,
    .milestone-card:nth-child(even) {
        flex-direction: column;
        /* Stack content */
        gap: 1.5rem;
        text-align: left;
        /* Reset text alignments */
        margin-left: 15px;
    }

    /* Ensure Image is always on top on mobile */
    .milestone-image {
        order: 1;
        width: 100%;
    }

    .milestone-content {
        order: 2;
        width: 100%;
    }

    /* Override alternating HTML structure for even items */
    .milestone-card:nth-child(even) .milestone-image {
        order: 1;
    }

    .milestone-card:nth-child(even) .milestone-content {
        order: 2;
    }

    /* Timeline Dot Position */
    .milestone-card::after {
        left: -26px;
        /* Position relative to the card */
        top: 30px;
        /* Align near the top */
        transform: none;
        /* Reset transform */
    }

    /* Adjust image height for mobile */
    .milestone-image img {
        height: 200px;
    }

    .milestone-content h3 {
        font-size: 1.3rem;
    }
}