/* GME Timeline Frontend Styles */

.gme-timeline-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: transparent;
}

.gme-timeline {
    position: relative;
    padding: 40px 0;
}

/* Gepunktete Timeline-Linie HINTER den Icons */
.gme-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: calc(100% - 160px);
    background: repeating-linear-gradient(
        to bottom,
        #e9ecef 0px,
        #e9ecef 8px,
        transparent 8px,
        transparent 16px
    );
    top: 80px;
    bottom: 80px;
    z-index: 0;
}

.gme-timeline-item {
    position: relative;
    margin: 80px 0;
    min-height: 120px;
    display: flex;
    align-items: center;
}

/* Alternierende Positionierung - Links (ungerade) */
.gme-timeline-item:nth-child(odd) {
    flex-direction: row;
}

.gme-timeline-item:nth-child(odd) .gme-timeline-content {
    margin-right: 80px;
    text-align: right;
    max-width: 450px;
    margin-left: auto;
}

/* Sprechblasen-Pfeil für linke Seite - Box ist RECHTS vom Icon, Pfeil zeigt LINKS */
.gme-timeline-item:nth-child(odd) .gme-timeline-content::after {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-right: 20px solid white;
    border-top: 20px solid transparent;
    border-bottom: 20px solid transparent;
    z-index: 4;
}

.gme-timeline-item:nth-child(odd) .gme-timeline-content::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-right: 22px solid #e9ecef;
    border-top: 22px solid transparent;
    border-bottom: 22px solid transparent;
    z-index: 3;
}

/* Alternierende Positionierung - Rechts (gerade) */
.gme-timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}

.gme-timeline-item:nth-child(even) .gme-timeline-content {
    margin-left: 80px;
    text-align: left;
    max-width: 450px;
    margin-right: auto;
}

/* Sprechblasen-Pfeil für rechte Seite - Box ist LINKS vom Icon, Pfeil zeigt RECHTS */
.gme-timeline-item:nth-child(even) .gme-timeline-content::after {
    content: '';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid white;
    border-top: 20px solid transparent;
    border-bottom: 20px solid transparent;
    z-index: 4;
}

.gme-timeline-item:nth-child(even) .gme-timeline-content::before {
    content: '';
    position: absolute;
    right: -22px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 22px solid #e9ecef;
    border-top: 22px solid transparent;
    border-bottom: 22px solid transparent;
    z-index: 3;
}

.gme-timeline-content {
    background: white;
    padding: 25px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    flex: 0 0 auto;
}

.gme-timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Timeline Marker - über der Timeline-Linie */
.gme-timeline-marker {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: var(--accent-color, #2c5aa0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    border: 4px solid white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.gme-timeline-marker svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* Datum über dem Marker - höchster z-index */
.gme-timeline-date {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -160%);
    background: var(--date-color, #dc3545);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    z-index: 6;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
    white-space: nowrap;
}

.gme-timeline-title {
    color: var(--accent-color, #2c5aa0);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.gme-timeline-description {
    color: #6c757d;
    line-height: 1.6;
    font-size: 15px;
}

.gme-timeline-description p {
    margin-bottom: 10px;
}

.gme-timeline-description p:last-child {
    margin-bottom: 0;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .gme-timeline-container {
        padding: 20px 15px;
    }

    .gme-timeline {
        padding: 20px 0;
    }

    /* Mobile gepunktete Timeline-Linie - HINTER den Icons */
    .gme-timeline::before {
        left: 40px;
        transform: none;
        height: calc(100% - 120px);
        background: repeating-linear-gradient(
            to bottom,
            #e9ecef 0px,
            #e9ecef 6px,
            transparent 6px,
            transparent 12px
        );
        top: 60px;
        bottom: 60px;
        z-index: 0;
    }

    .gme-timeline-item {
        margin: 60px 0;
        min-height: auto;
        padding-left: 120px;
        display: block;
    }

    /* Alle Items linksbündig in Mobile */
    .gme-timeline-item:nth-child(odd),
    .gme-timeline-item:nth-child(even) {
        flex-direction: unset;
    }

    .gme-timeline-item:nth-child(odd) .gme-timeline-content,
    .gme-timeline-item:nth-child(even) .gme-timeline-content {
        margin: 0;
        text-align: left;
        max-width: none;
    }

    /* Entferne Desktop Pfeile */
    .gme-timeline-item:nth-child(odd) .gme-timeline-content::after,
    .gme-timeline-item:nth-child(odd) .gme-timeline-content::before,
    .gme-timeline-item:nth-child(even) .gme-timeline-content::after,
    .gme-timeline-item:nth-child(even) .gme-timeline-content::before {
        display: none;
    }

    /* Mobile Sprechblasen-Pfeil - zeigt ZUM Icon HIN */
    .gme-timeline-content::after {
        content: '';
        position: absolute;
        left: -20px;
        top: 30px;
        width: 0;
        height: 0;
        border-right: 20px solid white;
        border-top: 20px solid transparent;
        border-bottom: 20px solid transparent;
        z-index: 4;
    }

    .gme-timeline-content::before {
        content: '';
        position: absolute;
        left: -22px;
        top: 30px;
        width: 0;
        height: 0;
        border-right: 22px solid #e9ecef;
        border-top: 22px solid transparent;
        border-bottom: 22px solid transparent;
        z-index: 3;
    }

    /* Mobile Marker links positioniert - über Timeline */
    .gme-timeline-marker {
        left: 40px;
        top: 40px;
        transform: translate(-50%, 0);
        width: 50px;
        height: 50px;
        z-index: 5;
    }

    .gme-timeline-marker svg {
        width: 20px;
        height: 20px;
    }

    /* Mobile Datum über linkem Marker */
    .gme-timeline-date {
        left: 40px;
        top: 40px;
        transform: translate(-50%, -130%);
        font-size: 12px;
        padding: 6px 12px;
        z-index: 6;
    }

    .gme-timeline-content {
        padding: 20px;
    }

    .gme-timeline-title {
        font-size: 18px;
    }

    .gme-timeline-description {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .gme-timeline-container {
        padding: 15px 10px;
    }

    .gme-timeline-item {
        padding-left: 100px;
    }

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

    .gme-timeline-date {
        left: 30px;
        font-size: 11px;
        padding: 4px 10px;
    }

    .gme-timeline-content {
        padding: 15px;
    }

    .gme-timeline-content::after {
        top: 25px;
    }

    .gme-timeline-content::before {
        top: 25px;
    }

    .gme-timeline-title {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .gme-timeline-description {
        font-size: 13px;
        line-height: 1.5;
    }
}

/* Animation für bessere UX */
@keyframes timelineItemFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gme-timeline-item {
    animation: timelineItemFadeIn 0.6s ease-out;
    animation-fill-mode: both;
}

.gme-timeline-item:nth-child(1) { animation-delay: 0.1s; }
.gme-timeline-item:nth-child(2) { animation-delay: 0.2s; }
.gme-timeline-item:nth-child(3) { animation-delay: 0.3s; }
.gme-timeline-item:nth-child(4) { animation-delay: 0.4s; }
.gme-timeline-item:nth-child(5) { animation-delay: 0.5s; }
.gme-timeline-item:nth-child(6) { animation-delay: 0.6s; }
.gme-timeline-item:nth-child(7) { animation-delay: 0.7s; }
.gme-timeline-item:nth-child(8) { animation-delay: 0.8s; }

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    .gme-timeline-item {
        animation: none;
    }
    
    .gme-timeline-content {
        transition: none;
    }
}

/* Print Styles */
@media print {
    .gme-timeline-container {
        background: white;
        box-shadow: none;
    }
    
    .gme-timeline-content {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .gme-timeline-content:hover {
        transform: none;
    }
}