/*==================== MODERN JOURNEY TIMELINE ====================*/

.journey__section {
    padding: 2rem 0 4rem;
    overflow: hidden;
}

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

/* The Central Line */
.timeline-container::after {
    content: '';
    position: absolute;
    width: 4px;
    background: var(--first-color-lighter);
    /* Fallback */
    background: linear-gradient(180deg,
            rgba(0, 0, 0, 0) 0%,
            var(--first-color) 15%,
            var(--first-color) 85%,
            rgba(0, 0, 0, 0) 100%);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
    border-radius: 2px;
}

/* Container for each timeline item */
.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
    box-sizing: border-box;
}

/* Left side items */
.timeline-item.left {
    left: 0;
}

/* Right side items */
.timeline-item.right {
    left: 50%;
}

/* The Content Card */
.timeline-content {
    padding: 1.5rem;
    background-color: var(--container-color);
    border-radius: 1rem;
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-color: var(--first-color);
}

/* The Dot/Marker */
.timeline-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--body-color);
    border: 4px solid var(--first-color);
    top: 20px;
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 0 0 4px rgba(var(--hue-color), 69%, 61%, 0.2);
    transition: all 0.3s ease;
}

.timeline-item.right .timeline-marker {
    left: -10px;
}

.timeline-item:hover .timeline-marker {
    background-color: var(--first-color);
    box-shadow: 0 0 0 6px rgba(var(--hue-color), 69%, 61%, 0.3);
    transform: scale(1.1);
}

/* Typography in the card */
.timeline-date {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--first-color-lighter);
    color: #fff;
    border-radius: 2rem;
    font-size: var(--smaller-font-size);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.timeline-title {
    font-size: var(--h3-font-size);
    margin-bottom: 0.25rem;
    color: var(--title-color);
}

.timeline-subtitle {
    font-size: var(--normal-font-size);
    color: var(--first-color);
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

.timeline-desc {
    font-size: var(--small-font-size);
    color: var(--text-color-light);
    line-height: 1.5;
}

/* Arrows pointing to the line */
.timeline-content::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    border: medium solid var(--container-color);
}

.timeline-item.left .timeline-content::before {
    right: -10px;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent var(--container-color);
}

.timeline-item.right .timeline-content::before {
    left: -10px;
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--container-color) transparent transparent;
}

/* MEDIA QUERIES - RESPONSIVENESS */
@media screen and (max-width: 767px) {
    .journey__section {
        padding: 1rem 0 3rem;
    }

    .timeline-container {
        display: block;
        padding: 1rem 0;
        max-width: 100%;
        margin: 0;
        overflow-x: hidden;
    }

    /* Central Line Restored */
    .timeline-container::after {
        display: block;
        content: '';
        position: absolute;
        width: 2px;
        background: linear-gradient(180deg,
                var(--first-color-lighter) 0%,
                var(--first-color) 50%,
                var(--first-color-lighter) 100%);
        top: 0;
        bottom: 0;
        left: 50%;
        margin-left: -1px;
        z-index: 0;
        /* Behind everything */
    }

    /* Items - Back to 50% for easy marker alignment */
    .timeline-item {
        width: 50%;
        margin-bottom: 2rem;
        position: relative;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
        z-index: 1;
        /* Above line */
    }

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

    /* LEFT ITEM Styling */
    .timeline-item.left {
        left: 0;
        /* Padding: Left=ScreenGap, Right=LineGap */
        padding-left: 12px;
        padding-right: 20px;
        text-align: left;
    }

    /* RIGHT ITEM Styling */
    .timeline-item.right {
        left: 50%;
        /* Padding: Left=LineGap, Right=ScreenGap */
        padding-left: 20px;
        padding-right: 12px;
        text-align: left;
    }

    /* Markers - Centered on line */
    .timeline-marker {
        display: block !important;
        width: 14px;
        /* Slightly bigger */
        height: 14px;
        top: 15px;
        border: 2px solid var(--first-color);
        background: var(--container-color);
        /* Hides the line behind */
        box-shadow: 0 0 0 2px rgba(var(--hue-color), 69%, 61%, 0.2);
        z-index: 10;
        /* Topmost layer */
    }

    /* Position Marker exactly on the edge of the 50% box */
    .timeline-item.left .timeline-marker {
        right: -7px;
        /* Half of 14px */
        left: auto !important;
    }

    .timeline-item.right .timeline-marker {
        left: -7px;
        right: auto !important;
    }

    /* Arrows */
    .timeline-content::before {
        display: block !important;
        top: 18px;
    }

    .timeline-item.left .timeline-content::before {
        right: -6px;
        left: auto !important;
        border-width: 6px 0 6px 6px !important;
        border-color: transparent transparent transparent rgba(255, 255, 255, 0.8) !important;
    }

    .timeline-item.right .timeline-content::before {
        left: -6px;
        right: auto !important;
        border-width: 6px 6px 6px 0 !important;
        border-color: transparent rgba(255, 255, 255, 0.8) transparent transparent !important;
    }

    /* Compact Content Card */
    .timeline-content {
        padding: 0.75rem;
        border-radius: 0.75rem;
        background: rgba(255, 255, 255, 0.8);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid rgba(255, 255, 255, 0.5);
        display: flex;
        flex-direction: column;
    }

    /* Date Positioning */
    .timeline-date {
        font-size: 0.55rem;
        padding: 0.15rem 0.5rem;
        margin-bottom: 0.35rem;
        align-self: flex-start;
    }

    /* Left item dates on right side */
    .timeline-item.left .timeline-date {
        align-self: flex-end;
        text-align: right;
    }

    /* Typography */
    .timeline-title {
        font-size: 0.8rem;
        line-height: 1.2;
    }

    .timeline-subtitle {
        font-size: 0.65rem;
        margin-bottom: 0.25rem;
    }

    .timeline-desc {
        font-size: 0.6rem;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .click-hint {
        font-size: 0.5rem;
        margin-top: 0.5rem;
    }
}

/*==================== JOURNEY DETAILS MODAL ====================*/
.journey-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 0 1rem;
}

.journey-modal.active-modal {
    opacity: 1;
    visibility: visible;
}

/* The fixed container holding content and close button */
.journey-modal-content {
    position: relative;
    background-color: var(--container-color);
    padding: 0;
    /* Clear padding, handled by inner */
    border-radius: 1.5rem;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    /* Max height for modal */
    display: flex;
    flex-direction: column;
    /* Stack close button and content */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    /* clip corners */
}

/* Scroll area for the text content */
.journey-modal-scroll-area {
    padding: 3rem 2rem 8rem;
    /* Extra large bottom padding to fix mobile cut-off */
    overflow-y: auto;
    /* Scrollable */
    flex: 1;
    /* Grow to fill available space */
    width: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--first-color) transparent;
    box-sizing: border-box;
}

/* Custom Scrollbar */
.journey-modal-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.journey-modal-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.journey-modal-scroll-area::-webkit-scrollbar-thumb {
    background-color: var(--first-color-lighter);
    border-radius: 20px;
}

.journey-modal.active-modal .journey-modal-content {
    transform: translateY(0) scale(1);
}

.journey-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--title-color);
    cursor: pointer;
    background: var(--container-color);
    /* Matches bg to hide scrolling content */
    border-radius: 50%;
    border: 1px solid rgba(var(--hue-color), 10%, 10%, 0.1);
    /* Subtle border */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    z-index: 20;
    /* Keep on top of scroll area */
}

.journey-modal-close:hover {
    transform: rotate(90deg);
    color: var(--first-color);
    background: var(--body-color);
}

.journey-modal-title {
    font-size: var(--h2-font-size);
    margin-bottom: 0.5rem;
    color: var(--title-color);
}

.journey-modal-subtitle {
    display: block;
    font-size: var(--normal-font-size);
    color: var(--first-color);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.journey-modal-date {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--first-color-lighter);
    color: #fff;
    border-radius: 1rem;
    font-size: var(--small-font-size);
    margin-bottom: 1.5rem;
}

.journey-modal-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 2rem;
}

.journey-modal-item {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    font-size: var(--small-font-size);
    color: var(--text-color);
    line-height: 1.6;
}

.journey-modal-icon {
    min-width: 20px;
    color: var(--first-color);
    margin-top: 3px;
}

/* Skills Tags in Modal */
.journey-modal-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.journey-modal-skill {
    font-size: var(--smaller-font-size);
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    background-color: var(--first-color-lighter);
    color: #fff;
    opacity: 0.9;
}

/* Make content clickable */
.timeline-content {
    cursor: pointer;
}

.click-hint {
    font-size: var(--smaller-font-size);
    color: var(--first-color);
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    opacity: 0.7;
    font-weight: 500;
}

/* Scrollbar for modal */
.journey-modal-content::-webkit-scrollbar {
    width: 6px;
}

.journey-modal-content::-webkit-scrollbar-thumb {
    background-color: var(--first-color-lighter);
    border-radius: 3px;
}