/* Experience Section */
.experience {
    padding: 5rem 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    position: relative;
    overflow: hidden;
}

.experience::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(102, 126, 234, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(118, 75, 162, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

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

.timeline::before {
    content: '';
    position: absolute;
    width: 4px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
    z-index: 1;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
    animation: timelineGlow 3s ease-in-out infinite;
}

@keyframes timelineGlow {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.6);
    }
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
    margin-bottom: 4rem;
    opacity: 0;
    animation: slideInTimeline 0.8s ease-out forwards;
    animation-delay: calc(var(--item-index, 0) * 0.3s);
}

.timeline-item::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 4px solid #ffffff;
    top: 10px;
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.timeline-item:hover::before {
    transform: scale(1.3);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-item:nth-child(even)::before {
    left: -10px;
}

.timeline-date {
    position: absolute;
    top: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.7rem 1.2rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.timeline-date:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.timeline-item:nth-child(odd) .timeline-date {
    left: 50%;
    transform: translateX(-50%);
}

.timeline-item:nth-child(even) .timeline-date {
    left: 50%;
    transform: translateX(-50%);
}

.timeline-content {
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: relative;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-top: 3rem;
    overflow: hidden;
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.timeline-content:hover::before {
    opacity: 1;
}

.timeline-content:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.timeline-content h3 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.employment-tag {
    display: inline-block;
    padding: 0.3em 0.7em;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
    margin-left: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.employment-tag-full-time {
    color: #ffffff;
    background-color: #2563eb;
}

.employment-tag-part-time {
    color: #ffffff;
    background-color: #10b981;
}

.employment-tag-freelance {
    color: #ffffff;
    background-color: #f59e0b;
}

.timeline-content h4 {
    color: #667eea;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.timeline-content ul {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

.timeline-content ul li {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.2em;
}

.timeline-content ul li::before {
    content: "•";
    color: #667eea;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1.2em;
    position: absolute;
}

/* Animation keyframes */
@keyframes slideInTimeline {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* Set animation delays for timeline items */
.timeline-item:nth-child(1) {
    --item-index: 1;
}

.timeline-item:nth-child(2) {
    --item-index: 2;
}

.timeline-item:nth-child(3) {
    --item-index: 3;
}

.timeline-item:nth-child(4) {
    --item-index: 4;
}

.timeline-item:nth-child(5) {
    --item-index: 5;
}

.timeline-item:nth-child(6) {
    --item-index: 6;
}

/* Responsive Timeline for Mobile */
@media screen and (max-width: 768px) {
    .timeline::before {
        left: 30px;
        margin-left: 0;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }

    .timeline-item:nth-child(even) {
        left: 0%;
    }

    .timeline-item::before {
        left: 20px;
        right: auto;
        transform: translateX(-50%);
    }

    .timeline-item:nth-child(even)::before {
        left: 20px;
        transform: translateX(-50%);
    }

    .timeline-date {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        display: inline-block;
        margin-bottom: 1rem;
        margin-left: -40px;
    }

    .timeline-item:nth-child(odd) .timeline-date,
    .timeline-item:nth-child(even) .timeline-date {
        position: relative;
        left: auto;
        transform: none;
        margin-left: -40px;
    }

    .timeline-content {
        margin-top: 0;
    }

    .timeline-content h3 {
        font-size: 1.2rem;
    }

    .employment-tag {
        font-size: 0.7rem;
        margin-left: 0.5rem;
        margin-top: 0.25rem;
    }
}