/* =================================================================
   Phase 3: Interactive Timeline Visualization
   Enhanced career journey with animations and interactive elements
   ================================================================= */

/* ===== ENHANCED TIMELINE CONTAINER ===== */

.experience-timeline {
    position: relative;
    max-width: 1200px;
    margin: 3rem auto 0;
}

/* Timeline centerline */
.experience-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg,
        var(--strategy-accent) 0%,
        var(--platform-accent) 50%,
        var(--security-accent) 100%
    );
    border-radius: 2px;
}

/* ===== TIMELINE ITEMS ===== */

.timeline-item {
    position: relative;
    margin-bottom: 4rem;
    display: flex;
    align-items: flex-start;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animate in when visible class is added (progressive enhancement) */
.timeline-item:not(.visible) {
    opacity: 0;
    transform: translateY(50px);
}

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

/* Stagger animation */
.timeline-item:nth-child(1) { transition-delay: 0.1s; }
.timeline-item:nth-child(2) { transition-delay: 0.2s; }
.timeline-item:nth-child(3) { transition-delay: 0.3s; }
.timeline-item:nth-child(4) { transition-delay: 0.4s; }
.timeline-item:nth-child(5) { transition-delay: 0.5s; }

/* Alternate left-right layout */
.timeline-item:nth-child(odd) {
    flex-direction: row;
}

.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}

/* ===== TIMELINE MARKER ===== */

.timeline-marker {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    z-index: 10;
}

.timeline-icon {
    width: 100%;
    height: 100%;
    background: var(--card-bg);
    border: 4px solid var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--accent-primary);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 0 0 0 rgba(245, 128, 78, 0.4);
}

.timeline-item:hover .timeline-icon {
    transform: scale(1.1);
    box-shadow: 0 0 0 8px rgba(245, 128, 78, 0.2);
}

/* Pulse animation for current position - reduced intensity */
.timeline-item.current .timeline-icon {
    animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 128, 78, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(245, 128, 78, 0);
        transform: scale(1.05);
    }
}

/* Service-specific colors */
.timeline-item:nth-child(4n+1) .timeline-icon {
    border-color: var(--strategy-accent);
    color: var(--strategy-accent);
}

.timeline-item:nth-child(4n+2) .timeline-icon {
    border-color: var(--platform-accent);
    color: var(--platform-accent);
}

.timeline-item:nth-child(4n+3) .timeline-icon {
    border-color: var(--security-accent);
    color: var(--security-accent);
}

/* Current position badge */
.timeline-item.current .timeline-marker::after {
    content: 'Aktuell';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-primary);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

/* ===== TIMELINE CONTENT ===== */

.timeline-content {
    flex: 1;
    max-width: calc(50% - 60px);
    background: var(--card-bg);
    border: 2px solid var(--border-primary);
    border-radius: 20px;
    padding: 2.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-right: auto;
    transform-origin: right;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: auto;
    transform-origin: left;
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 40px;
    width: 0;
    height: 0;
    border-style: solid;
}

.timeline-item:nth-child(odd) .timeline-content::before {
    right: -12px;
    border-width: 12px 0 12px 12px;
    border-color: transparent transparent transparent var(--border-primary);
}

.timeline-item:nth-child(even) .timeline-content::before {
    left: -12px;
    border-width: 12px 12px 12px 0;
    border-color: transparent var(--border-primary) transparent transparent;
}

.timeline-content:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-primary);
}

/* Top color accent */
.timeline-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 20px 20px 0 0;
}

.timeline-item:nth-child(4n+1) .timeline-content::after {
    background: var(--strategy-accent);
}

.timeline-item:nth-child(4n+2) .timeline-content::after {
    background: var(--platform-accent);
}

.timeline-item:nth-child(4n+3) .timeline-content::after {
    background: var(--security-accent);
}

/* ===== TIMELINE HEADER ===== */

.timeline-header {
    margin-bottom: 1.5rem;
}

.timeline-header h3 {
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.timeline-content:hover .timeline-header h3 {
    color: var(--accent-primary);
}

.timeline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}

.company {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.company::before {
    content: '\f1ad';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 18px;
}

.period {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.period::before {
    content: '\f073';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--platform-accent);
}

.location {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.location::before {
    content: '\f3c5';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--strategy-accent);
}

/* ===== TIMELINE DESCRIPTION ===== */

.timeline-description {
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 1rem;
}

.timeline-description > p {
    margin-bottom: 1.25rem;
}

/* Achievements section */
.achievements {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-primary);
}

.achievements h4 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.achievements h4::before {
    content: '\f091';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--platform-accent);
}

.achievements ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.achievements li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.achievements li::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    color: var(--platform-accent);
    font-size: 14px;
}

/* Technologies section */
.technologies {
    margin-top: 2rem;
}

.technologies h4 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.technologies h4::before {
    content: '\f120';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--security-accent);
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tech-tag {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border-primary);
    transition: all 0.3s ease;
}

.tech-tag:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

/* ===== DURATION BADGE ===== */

.duration-badge {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-primary);
    border-radius: 12px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.duration-badge i {
    color: var(--accent-primary);
}

/* ===== EXPAND/COLLAPSE FUNCTIONALITY ===== */

.timeline-content.collapsed .achievements,
.timeline-content.collapsed .technologies {
    display: none;
}

.expand-btn {
    margin-top: 1.5rem;
    padding: 10px 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-primary);
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.expand-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-2px);
}

.expand-btn i {
    transition: transform 0.3s ease;
}

.timeline-content.collapsed .expand-btn i {
    transform: rotate(180deg);
}

/* ===== TIMELINE NAVIGATION ===== */

.timeline-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 3rem;
}

.timeline-filter-btn {
    background: var(--card-bg);
    border: 2px solid var(--border-primary);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 24px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timeline-filter-btn:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.timeline-filter-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 128, 78, 0.3);
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 1024px) {
    .timeline-content {
        padding: 2rem;
    }

    .timeline-header h3 {
        font-size: 1.5rem;
    }

    .timeline-meta {
        flex-direction: column;
        gap: 0.75rem;
    }
}

@media (max-width: 768px) {
    /* Single column layout */
    .experience-timeline::before {
        left: 40px;
    }

    .timeline-item {
        flex-direction: column !important;
        margin-bottom: 3rem;
        padding-left: 100px;
    }

    .timeline-marker {
        left: 40px;
        transform: none;
        width: 60px;
        height: 60px;
    }

    .timeline-icon {
        font-size: 24px;
    }

    .timeline-item.current .timeline-marker::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .timeline-content {
        max-width: 100%;
        margin: 0 !important;
        padding: 1.5rem;
    }

    .timeline-content::before {
        display: none;
    }

    .timeline-header h3 {
        font-size: 1.25rem;
    }

    .duration-badge {
        position: static;
        margin-top: 1rem;
        display: inline-flex;
    }

    .achievements li {
        padding-left: 1.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .timeline-item {
        padding-left: 80px;
    }

    .experience-timeline::before {
        left: 30px;
    }

    .timeline-marker {
        left: 30px;
        width: 50px;
        height: 50px;
    }

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

    .timeline-content {
        padding: 1.25rem;
    }

    .timeline-header h3 {
        font-size: 1.1rem;
    }

    .tech-tag {
        font-size: 0.75rem;
        padding: 6px 12px;
    }
}

/* ===== DARK THEME ADJUSTMENTS ===== */

[data-theme="dark"] .timeline-content {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .timeline-icon {
    background: rgba(15, 23, 42, 0.9);
}

[data-theme="dark"] .duration-badge {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .expand-btn {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .timeline-filter-btn {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .tech-tag {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}
