/* Scroll-Driven Journey Map Visualization */

/* View Toggle Buttons */
.experience-view-toggle {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    padding: 10px;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid #22A39F;
    background: #FFFFFF;
    color: #22A39F;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Open Sans', sans-serif;
}

.view-toggle-btn:hover {
    background: #f0f9f9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 163, 159, 0.2);
}

.view-toggle-btn.active {
    background: #22A39F;
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(34, 163, 159, 0.3);
}

.view-toggle-btn i {
    font-size: 18px;
}

/* View Containers */
.view-container {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.view-container.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Timeline View Styles */
#timeline-view {
    margin-top: 20px;
}

#timeline-view h3 {
    display: block;
}

#timeline-view .experiences {
    display: block;
}

#timeline-view hr {
    display: block;
}

/* Journey Map Section */
#journey-map-section {
    position: relative;
    min-height: 400vh; /* 4x viewport height for scroll-driven animation */
    background: linear-gradient(180deg, #F3EFE0 0%, #e8e4d6 50%, #F3EFE0 100%);
}

#journey-map-container {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#journey-canvas {
    position: relative;
    width: 95%;
    max-width: 1200px;
    aspect-ratio: 1 / 1;
    max-height: 80vh;
    background: #e8e4d6;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* Map is now rendered via SVG images, no CSS background needed */

/* SVG Map Layer */
#map-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* City Markers */
.city-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 3;
}

.city-dot {
    width: 20px;
    height: 20px;
    background: #22A39F;
    border-radius: 50%;
    border: 3px solid #FFFFFF;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

.city-dot.birthplace {
    background: #f39c12;
    width: 24px;
    height: 24px;
}

.city-dot.current {
    background: #e74c3c;
    width: 24px;
    height: 24px;
    animation: pulse-marker 2s ease-in-out infinite;
}

@keyframes pulse-marker {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 4px 16px rgba(231, 76, 60, 0.6);
    }
}

.city-label {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
    color: #434242;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 12px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Road/Route Lines */
.route-line {
    stroke: #22A39F;
    stroke-width: 6;
    fill: none;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    opacity: 0.8;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    stroke-linecap: round;
    stroke-linejoin: round;
}

.route-line.active {
    stroke-dashoffset: 0;
}

.route-line.dashed {
    stroke-dasharray: 20, 20;
}

/* Animated Vehicle */
#vehicle {
    position: absolute;
    z-index: 4;
    font-size: 40px;
    transform: translate(-50%, -50%);
    transition: all 2s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

#vehicle.driving {
    animation: car-bounce 0.5s ease-in-out infinite;
}

@keyframes car-bounce {
    0%, 100% {
        transform: translate(-50%, -50%) scaleX(-1) scaleY(var(--car-scale-y, 1)) translateY(0px) rotate(var(--car-rotation, 0deg));
    }
    50% {
        transform: translate(-50%, -50%) scaleX(-1) scaleY(var(--car-scale-y, 1)) translateY(-4px) rotate(var(--car-rotation, 0deg));
    }
}

/* Experience Card Popups */
.experience-popup {
    position: absolute;
    z-index: 5;
    background: #FFFFFF;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.experience-popup.active {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.experience-popup-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.experience-icon {
    font-size: 32px;
    line-height: 1;
}

.experience-popup h3 {
    margin: 0;
    font-size: 18px;
    color: #22A39F;
    font-weight: 700;
}

.experience-popup h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: #434242;
    font-weight: 600;
}

.experience-popup .period {
    font-size: 13px;
    color: #727878;
    font-style: italic;
    margin-bottom: 8px;
}

.experience-popup .description {
    font-size: 14px;
    color: #434242;
    line-height: 1.6;
    margin-bottom: 12px;
}

.experience-popup .gpa {
    font-size: 13px;
    color: #22A39F;
    font-weight: 600;
    margin-top: 8px;
}

.experience-popup .link {
    display: inline-block;
    margin-top: 8px;
    color: #22A39F;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s ease;
}

.experience-popup .link:hover {
    color: #1c8784;
    text-decoration: underline;
}

.experience-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

.experience-badge.education {
    background: #e3f2fd;
    color: #1976d2;
}

.experience-badge.work {
    background: #e8f5e9;
    color: #388e3c;
}

.experience-badge.leadership {
    background: #f3e5f5;
    color: #7b1fa2;
}

.experience-badge.milestone {
    background: #fff3e0;
    color: #f57c00;
}

/* Progress Indicator */
#journey-progress {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 30px;
    border-radius: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#journey-progress.visible {
    opacity: 1;
    pointer-events: auto;
}

#journey-progress .progress-bar {
    width: 200px;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

#journey-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #22A39F, #1c8784);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

#journey-progress .progress-text {
    font-size: 14px;
    font-weight: 600;
    color: #434242;
}

/* Journey Stats */
#journey-stats {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    z-index: 6;
    display: none; /* Hidden - stats overlay removed */
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 14px;
}

.stat-item:last-child {
    margin-bottom: 0;
}

.stat-icon {
    font-size: 20px;
}

.stat-value {
    font-weight: 700;
    color: #22A39F;
}

/* Distance Label on Routes */
.distance-label {
    position: absolute;
    background: rgba(34, 163, 159, 0.9);
    color: #FFFFFF;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    transform: translate(-50%, -50%);
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.distance-label.active {
    opacity: 1;
}

/* Mobile Responsiveness */
@media (max-width: 991px) {
    #journey-map-section {
        min-height: 300vh;
    }

    #journey-canvas {
        width: 95%;
        aspect-ratio: 1 / 1;
        max-height: 70vh;
    }

    .experience-popup {
        max-width: 350px;
        width: 90vw;
        padding: 15px;
        max-height: 60vh;
        overflow-y: auto;
    }

    #journey-stats {
        top: 10px;
        right: 10px;
        padding: 10px;
    }

    .city-label {
        font-size: 12px;
        padding: 3px 8px;
    }

    #vehicle {
        font-size: 30px;
    }
}

@media (max-width: 767px) {
    .experience-view-toggle {
        flex-direction: column;
        gap: 10px;
        margin: 20px 0;
    }

    .view-toggle-btn {
        width: 100%;
        justify-content: center;
        padding: 10px 20px;
        font-size: 14px;
    }

    .view-toggle-btn i {
        font-size: 16px;
    }

    #journey-map-section {
        min-height: 160vh;
    }

    #journey-canvas {
        aspect-ratio: 1 / 1;
        max-height: 60vh;
    }

    .experience-popup {
        max-width: 320px;
        width: 90vw;
        font-size: 13px;
        max-height: 55vh;
        overflow-y: auto;
    }

    .experience-popup h3 {
        font-size: 16px;
    }

    .experience-popup h4 {
        font-size: 14px;
    }

    #journey-progress {
        bottom: 20px;
        padding: 10px 20px;
    }

    #journey-progress .progress-bar {
        width: 150px;
    }

    #journey-progress .progress-text {
        font-size: 12px;
    }
}

/* Scroll Indicator */
.scroll-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #727878;
    font-size: 14px;
    animation: bounce-hint 2s ease-in-out infinite;
    z-index: 10;
}

@keyframes bounce-hint {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(10px);
    }
}

/* Loading State */
.journey-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 100;
}

.journey-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e0e0;
    border-top-color: #22A39F;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
