:root {
    --primary-color: #007bff;      /* Example: bright blue */
    --background-color: #ffffff;  /* Example: white */
}


.timeline-container {
    position: relative;
    padding: 2rem 0;
    max-width: 1000px;
    margin: 0 auto;
}

/* Timeline vertical line */
.timeline-container::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary-color), var(--primary-color));
    transform: translateX(-50%);
    z-index: 1;
    opacity: 0.8;
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    opacity: 0;
    width: calc(50% - 2rem);
    transform: translateY(30px);
    animation: slideInUp 0.6s ease forwards;
    z-index: 2;
}

/* Alternate left and right positioning */
.timeline-item:nth-child(odd) {
    left: 0;
    transform: translateX(-30px);
    animation: slideInLeft 0.6s ease forwards;
}

.timeline-item:nth-child(even) {
    left: calc(50% + 2rem);
    transform: translateX(30px);
    animation: slideInRight 0.6s ease forwards;
}

/* Timeline dots - Fixed positioning to center on line */
.timeline-dot {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 100%;
    background-color: var(--primary-color) !important;

    border: 4px solid var(--background-color);
    box-shadow: 0 0 0 3px var(--primary-color);
    z-index: 10;
    top: 1.5rem;
}


/* Position dots centered on the timeline line */
.timeline-item:nth-child(odd) .timeline-dot {
    right: calc(-2rem - 10px); /* Distance to center line (2rem gap) + half dot width (10px) */
}

.timeline-item:nth-child(even) .timeline-dot {
    left: calc(-2rem - 10px); /* Distance to center line (2rem gap) + half dot width (10px) */
}

/* Animation delays */
.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.experience-card {
    background-color: var(--secondary-color) !important;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0px 8px 56px rgb(15 80 100 / 16%);
    border: 1px solid var(--secondary-color) !important;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.experience-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    opacity: 0.8;
}

.experience-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 0 11px rgb(15 80 100 / 20%);
    transition: transform 0.3s;
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.job-info h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color) !important;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.2;
    opacity: 0.9;
}

.company-name {
    font-size: 1rem;
    color: var(--text-link-color) !important;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.company-name:hover {
    color: var(--primary-color) !important;
    opacity: 0.8;
}

.job-date {
    background-color: var(--background-color) !important;
    color: var(--text-color) !important;
    border: 1px solid var(--primary-color);
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0.9;
    transition: all 0.2s ease;
}

.job-content {
    color: var(--text-secondary-color) !important;
    line-height: 1.5;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    opacity: 0.9;
}

.job-content p {
    margin-bottom: 0.5rem;
}

.job-content p:last-child {
    margin-bottom: 0;
}

.featured-link {
    display: inline-block;
    background-color: var(--primary-color) !important;
    color: var(--secondary-color) !important;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    border: 1px solid var(--primary-color);
}

.featured-link:hover {
    transform: translateY(-2px);
    background-color: var(--background-color) !important;
    color: var(--primary-color) !important;
    box-shadow: 0px 8px 56px rgb(15 80 100 / 16%);
}

/* Floating animation */
.experience-card {
    animation: float 6s ease-in-out infinite;
}

.experience-card:nth-child(even) {
    animation-delay: -3s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.experience-card:hover {
    animation-play-state: paused;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .timeline-container::before {
        left: 1rem;
        transform: none;
    }

    .timeline-item {
        width: calc(100% - 3rem);
        left: 2rem !important;
        margin-bottom: 2rem;
    }

    .timeline-dot {
        left: calc(-1rem - 10px) !important; /* Line at 1rem, item at 2rem, so go back (2rem - 1rem) + 10px = 1rem + 10px */
        right: auto !important;
    }

    .experience-card {
        padding: 1rem;
    }

    .job-header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 0.75rem;
    }

    .job-date {
        align-self: flex-start;
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }

    .job-info h3 {
        font-size: 1.1rem;
    }

    .job-content {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .timeline-container::before {
        left: 0.75rem;
    }

    .timeline-item {
        width: calc(100% - 2rem);
        left: 1.5rem !important;
    }

    .timeline-dot {
        left: calc(-0.75rem - 8px) !important; /* Line at 0.75rem, item at 1.5rem, so go back (1.5rem - 0.75rem) + 8px = 0.75rem + 8px */
        width: 16px;
        height: 16px;
    }

    .experience-card {
        padding: 0.875rem;
        border-radius: 1rem;
    }

    .job-info h3 {
        font-size: 1rem;
    }

    .company-name {
        font-size: 0.9rem;
    }
}