/* Base style for experience items */
.experience {
    padding: 20px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(50%);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.content {
    padding: 20px;
    background-color: var(--bg-block);
    border-radius: 8px;
    box-shadow: 0 4px 8px var(--shadow-color);
    border: 1px solid rgba(74, 95, 233, 0.08);
    transition: all 0.3s ease;
}

.content:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px var(--shadow-color);
    background-color: var(--hover-light);
    border-color: rgba(74, 95, 233, 0.12);
}

/* When in-view class is added, apply animation */
.experience.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Left side experience styling */
.experience.left {
    left: 0;
}

/* Right side experience styling */
.experience.right {
    left: 50%;
    margin-left: 20px;
}

/* Timeline styling */
.timeline {
    position: relative;
    padding: 2rem;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    width: 2px;
    height: 100%;
    background: var(--primary-color);
    opacity: 0.3;
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
}

.timeline-content {
    position: relative;
    width: calc(50% - 2rem);
    padding: 1.5rem;
    background: var(--bg-block);
    border-radius: 8px;
    box-shadow: 0 4px 8px var(--shadow-color);
    border: 1px solid rgba(74, 95, 233, 0.08);
    transition: all 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px var(--shadow-color);
    background-color: var(--hover-light);
    border-color: rgba(74, 95, 233, 0.12);
}

.timeline-date {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.timeline-title {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.timeline-description {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
}

.timeline-marker {
    position: absolute;
    top: 1rem;
    width: 15px;
    height: 15px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 2px solid var(--bg-white);
    box-shadow: 0 0 0 4px var(--hover-light);
}

.timeline-item:nth-child(odd) .timeline-content {
    left: 50%;
    margin-left: 2rem;
}

.timeline-item:nth-child(odd) .timeline-marker {
    left: calc(50% - 7.5px);
}

.timeline-item:nth-child(even) .timeline-content {
    left: 0;
    margin-right: 2rem;
}

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

@media (max-width: 768px) {
    .timeline::before {
        left: 20px;
    }

    .experience {
        width: 100%;
        padding: 15px;
        transform: translateY(20%);
    }

    .experience.left,
    .experience.right {
        left: 0;
        margin-left: 32px;
    }

    .experience.left .content,
    .experience.right .content {
        margin-left: 0;
        margin-right: 0;
    }

    .role {
        font-size: 18px;
    }

    .github-icon {
        margin-left: 15px;
        margin-bottom: 10px;
    }

    .location {
        font-size: 0.9rem;
        margin-left: 5px;
    }
}

/* Animation classes */
.timeline-item {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Dot at timeline position */
.experience.left .content::after,
.experience.right .content::after {
    content: '';
    position:fixed;
    top: 0;
    width: 5px;
    height: 5px;
    background-color: #2c2b2b;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(70, 117, 142, 0.6);
}

/* Positioning for dot */
.experience.left .content::after {
    left: 100%;
    margin-left: -2px;
}

.experience.right .content::after {
    right: 100%;
    margin-right: 17px;
}

.experience.left .content {
    margin-left: calc(10px + 5px);
}

.experience.right .content {
    margin-left: calc(-10px - 5px);
}

/* Hover effect */
.experience:hover .content {
    background-color: var(--hover-light);
    transform: scale(1.02);
    transition: background-color 0.1s ease 0.15s, transform 0.3s ease;
}

/* Dot color on hover */
.experience.right:hover .content::after {
    transition: background-color 0.1s ease 0.1s ; /* Delay dot color transition by 1 second */
    opacity: 0; /* Fade out the dots */
    transition: opacity 0.8s ease; /* Smooth transition for opacity */
    transition: opacity 0s ease; /* Smooth transition for opacity */
}
.experience.left:hover .content::after {
    transition: background-color 0.1s ease 0.1s ; /* Delay dot color transition by 1 second */
    opacity: 0; /* Fade out the dots */
    transition: opacity 0s ease; /* Smooth transition for opacity */
}

/* Role styling */
.role-container {
    display: flex;
    align-items: center;
    margin-bottom: 0;
}
    
.role {
    font-size: 20px;
    margin-left: 5px;
    color: var(--text-dark);
    font-weight: bold;
    margin-top: 0;
}

/* GitHub icon styling */
.github-icon {
    color: var(--text-dark);
    transition: color 0.3s ease;
    cursor: pointer;
    margin-left: 30px;
    margin-bottom: 17px;
}

/* Hover effect on GitHub icon */
.github-icon:hover {
    color: var(--primary-color);
}

/* Company styling */
.company {
    display: block;
    font-size: 0.9rem;
    color: var(--text-light);
    padding-top: 0;
    margin-top: 0;
    margin-bottom: 0px;
    margin-left: 5px;
}

/* Project name styling */
.project-name {
    font-weight: 400;
    margin-bottom: 5px;
    margin-top: 10px;
    color: var(--text-dark);
}

/* Project type styling */
.project-type {
    display: block;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 10px;
    margin-left: 5px;
}

/* Location styling */
.location {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 10px;
    margin-left: 5px;
}

.date_container {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0px;
    margin-left: 5px;
    padding-top: 2px;
}

/* Timeline title styling */
.timeline-title::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 0px;
    background-color: var(--text-light);
    z-index: -1;
}

.timeline-title span {
    background-color: var(--bg-light);
    padding: 25px 25px;
}
