/* Experience Section - Modern Timeline Design */
.experience {
    background: var(--bg-primary);
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
}

/* Subtle background accent */
.experience::before {
    content: '';
    position: absolute;
    top: 0;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(52, 152, 219, 0.05) 0%, transparent 70%);
    animation: pulse-bg 12s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

[data-theme="dark"] .experience::before {
    background: radial-gradient(circle, rgba(96, 165, 250, 0.08) 0%, transparent 70%);
}

@keyframes pulse-bg {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

.experience .container {
    position: relative;
    z-index: 1;
}

/* Timeline Container */
.experience-timeline {
    max-width: 950px;
    margin: 0 auto;
    position: relative;
    padding-left: 3rem;
}

/* Timeline Marker (left side) */
.timeline-marker {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.timeline-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 3px solid var(--accent-primary);
    box-shadow: 0 0 0 4px var(--bg-primary), 0 0 20px rgba(52, 152, 219, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.timeline-dot.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px var(--bg-primary), 0 0 25px rgba(52, 152, 219, 0.6);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 4px var(--bg-primary), 0 0 25px rgba(52, 152, 219, 0.6);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 4px var(--bg-primary), 0 0 35px rgba(52, 152, 219, 0.8);
    }
}

.timeline-line {
    width: 2px;
    flex: 1;
    background: linear-gradient(180deg, var(--accent-primary) 0%, rgba(52, 152, 219, 0.3) 100%);
    margin-top: 8px;
    min-height: 40px;
}

[data-theme="dark"] .timeline-line {
    background: linear-gradient(180deg, rgba(96, 165, 250, 1) 0%, rgba(96, 165, 250, 0.3) 100%);
}

/* Timeline Entry */
.timeline-entry {
    position: relative;
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateX(-20px);
    animation: fadeInSlide 0.6s ease-out forwards;
}

.timeline-entry:nth-child(1) { animation-delay: 0.1s; }
.timeline-entry:nth-child(2) { animation-delay: 0.2s; }
.timeline-entry:nth-child(3) { animation-delay: 0.3s; }
.timeline-entry:nth-child(4) { animation-delay: 0.4s; }

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

.timeline-entry:last-child {
    margin-bottom: 0;
}

.timeline-entry:last-child .timeline-line {
    display: none;
}

/* Timeline Content Card */
.timeline-content {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem;
    margin-left: 2.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px var(--shadow-sm);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.timeline-content::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 24px;
    padding: 2px;
    background: var(--gradient-accent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

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

.timeline-content:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 12px 40px var(--shadow-xl);
    transform: translateY(-4px);
}

.timeline-entry:hover .timeline-dot {
    transform: scale(1.3);
    box-shadow: 0 0 0 4px var(--bg-primary), 0 0 30px rgba(52, 152, 219, 0.7);
}

/* Experience Header */
.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    gap: 2rem;
    flex-wrap: wrap;
}

.experience-title-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 250px;
}

.experience-role {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.experience-company {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Duration Badges */
.experience-duration {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.duration-badge {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1.5px solid var(--card-border);
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all 0.3s ease;
}

.duration-badge.current {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.15) 0%, rgba(52, 152, 219, 0.08) 100%);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

[data-theme="dark"] .duration-badge.current {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2) 0%, rgba(96, 165, 250, 0.1) 100%);
    border-color: rgba(96, 165, 250, 0.6);
    color: rgba(96, 165, 250, 1);
}

.timeline-content:hover .duration-badge {
    border-color: var(--accent-primary);
}

.duration-separator {
    color: var(--text-muted);
    font-weight: 600;
}

/* Experience Description */
.experience-description {
    color: var(--text-muted);
    line-height: 1.8;
    font-size: 1.05rem;
    margin-bottom: 1.75rem;
}

/* Achievements */
.experience-achievements {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-light);
}

.achievement-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.achievement-icon {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.15) 0%, rgba(52, 152, 219, 0.08) 100%);
    border: 1.5px solid rgba(52, 152, 219, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-weight: 700;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

[data-theme="dark"] .achievement-icon {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2) 0%, rgba(96, 165, 250, 0.1) 100%);
    border-color: rgba(96, 165, 250, 0.4);
    color: rgba(96, 165, 250, 1);
}

.timeline-content:hover .achievement-icon {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: scale(1.1);
}

.achievement-text {
    flex: 1;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.timeline-content:hover .achievement-text {
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .experience {
        padding: 4rem 0;
    }

    .experience-timeline {
        padding-left: 2rem;
    }

    .timeline-marker {
        left: 0;
    }

    .timeline-dot {
        width: 14px;
        height: 14px;
        border-width: 2.5px;
    }

    .timeline-content {
        margin-left: 2rem;
        padding: 2rem 1.5rem;
    }

    .experience-header {
        flex-direction: column;
        gap: 1rem;
    }

    .experience-title-group {
        min-width: auto;
        width: 100%;
    }

    .experience-role {
        font-size: 1.5rem;
    }

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

    .experience-duration {
        width: 100%;
    }

    .duration-badge {
        font-size: 0.8rem;
        padding: 0.45rem 0.875rem;
    }

    .experience-description {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .achievement-item {
        font-size: 0.95rem;
        gap: 0.875rem;
    }

    .achievement-icon {
        width: 22px;
        height: 22px;
        min-width: 22px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .experience-timeline {
        padding-left: 1.75rem;
    }

    .timeline-content {
        margin-left: 1.5rem;
        padding: 1.75rem 1.25rem;
    }

    .experience-role {
        font-size: 1.35rem;
    }

    .achievement-item {
        flex-direction: row;
        align-items: flex-start;
    }
}
