/* === ZÁKLADNÍ PROMĚNNÉ === */
:root {
    --efepr-green: #5dbc00;
    --text-color: #333;
    --text-gray: #666;
    /* Barva pro neaktivní text */
    --line-thickness: 4px;
    --dot-size: 24px;
    --line-offset: 12px;
    /* Polovina velikosti dotu - klíčové pro centrování */
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#efepr-timeline {
    width: 100%;
    padding: 0 50px;
    margin: 0 auto;
    box-sizing: border-box;
}

#efepr-timeline>h3 {
    color: var(--efepr-green);
    /* Nadpis zelený dle obrázku */
    margin-bottom: 60px;
    font-size: 2rem;
    text-transform: uppercase;
    font-weight: 700;
}

.timeline-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    position: relative;
}

.timeline-item {
    position: relative;
    flex: 1;
}

/* === SPOJOVACÍ ČÁRA === */
.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    background-color: #bce595;
    /* Světlejší zelená pro čáru dle obrázku */
    z-index: 1;
}

/* === PUNTÍK / TLAČÍTKO === */
.dot-btn {
    position: absolute;
    background-color: var(--efepr-green);
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 0 0 4px #fff;
    /* Bílý okraj */

    /* Výchozí rozměry (puntík) */
    width: var(--dot-size);
    height: var(--dot-size);

    /* Flex pro centrování textu */
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;

    /* Animace */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Text v tlačítku */
.dot-btn span {
    display: block;
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

/* Definice animace pulzování */
@keyframes pulse-btn {
    0% {
        box-shadow: 0 0 0 0 rgba(93, 188, 0, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(93, 188, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(93, 188, 0, 0);
    }
}

/* Aplikace animace na aktivní tlačítko */
.timeline-item.active-phase .dot-btn {
    animation: pulse-btn 2s infinite;
}

/* === TEXTOVÝ OBSAH === */
.content-wrap {
    transition: margin 0.3s ease;
}

/* Nadpis události (vždy zelený) */
.timeline-item h2 {
    color: var(--efepr-green);
    font-size: 1.2rem;
    margin: 0 0 5px 0;
    font-weight: 700;
    line-height: 1.2;
}

/* Info (Datum a cena) - defaultně šedé */
.timeline-info {
    color: var(--text-gray);
    font-size: 0.95rem;
    font-weight: 400;
    display: block;
    line-height: 1.4;
}

.timeline-info .timeline-date {
    display: block;
    font-size: 0.95rem;
}

.timeline-info .timeline-price {
    display: block;
    font-weight: 700;
    margin-top: 0.15rem;
    color: #111;
    font-size: 0.95rem;
}

/* === STAV: AKTIVNÍ FÁZE === */

/* 1. Tlačítko se roztáhne */
.timeline-item.active-phase .dot-btn {
    width: auto;
    min-width: 130px;
    height: auto;
    padding: 8px 20px;
    border-radius: 50px;
    /* Pill shape */
}

/* 2. Text v tlačítku se zobrazí */
.timeline-item.active-phase .dot-btn span {
    opacity: 1;
    width: auto;
}

/* 3. Texty pod bodem (Datum/Cena) zzelenají a ztuční */
.timeline-item.active-phase .timeline-info {
    font-weight: 700;
}

/* Hover efekt na tlačítko */
.timeline-item.active-phase .dot-btn:hover {
    background-color: #4ca300;
    transform: translate(-50%, -50%) scale(1.05) !important;
    /* !important přebíjí media query transformy */
}


/* === MEDIA QUERY: DESKTOP (HORIZONTÁLNÍ) === */
@media (min-width: 901px) {
    .timeline-list {
        flex-direction: row;
        text-align: center;
        padding-top: 40px;
        /* Místo pro texty nahoře, pokud by byly, nebo odsazení */
    }

    .timeline-item {
        padding: 0 10px;
    }

    /* ZAROVNÁNÍ TLAČÍTKA NA STŘED ČÁRY */
    .dot-btn {
        left: 50%;
        top: var(--line-offset);
        /* Umístíme fyzicky na linku (12px) */
        /* Posuneme o -50% své vlastní velikosti zpět -> perfektní střed */
        transform: translate(-50%, -50%);
    }

    /* U aktivního tlačítka zachováme stejný transform, jen se změní rozměry */
    .timeline-item.active-phase .dot-btn {
        transform: translate(-50%, -50%);
    }

    /* Obsah pod čárou */
    .content-wrap {
        margin-top: 40px;
        /* Dostatečné místo, aby tlačítko nepřekrylo text */
    }

    /* Horizontální čára */
    .timeline-item:not(:last-child)::after {
        height: var(--line-thickness);
        width: 100%;
        top: calc(var(--line-offset) - (var(--line-thickness) / 2));
        /* 12px - 2px = 10px */
        left: 50%;
    }
}


/* === MEDIA QUERY: MOBIL (VERTIKÁLNÍ) === */
@media (max-width: 992px) {
    .timeline-list {
        flex-direction: column;
        padding-left: 0;
    }

    .timeline-item {
        padding-left: 50px;
        /* Odsazení textu od čáry */
        padding-bottom: 40px;
        text-align: left;
    }

    .timeline-item:last-child {
        padding-bottom: 0;
    }

    /* ZAROVNÁNÍ TLAČÍTKA NA VERTIKÁLNÍ ČÁRU */
    .dot-btn {
        left: var(--line-offset);
        /* Umístíme na linku (12px zleva) */
        top: 0;
        /* Zarovnáme s horním okrajem textu */
        transform: translate(-50%, 0);
        /* Vycentrujeme horizontálně na lince */
    }

    /* Aktivní tlačítko na mobilu */
    .timeline-item.active-phase .dot-btn {
        /* Na mobilu chceme, aby tlačítko začínalo vlevo a rostlo doprava */
        left: 0;
        transform: none;
        border-radius: 30px;
    }

    /* Fix pro hover na mobilu (aby neposkakoval transform) */
    .timeline-item.active-phase .dot-btn:hover {
        transform: scale(1.02) !important;
    }

    /* Posun obsahu na mobilu u aktivní fáze (aby text nebyl pod tlačítkem) */
    .timeline-item.active-phase .content-wrap {
        padding-top: 45px;
        /* Text se odsune dolů */
        margin-top: 0;
    }

    /* Vertikální čára */
    .timeline-item:not(:last-child)::after {
        width: var(--line-thickness);
        height: 100%;
        left: calc(var(--line-offset) - (var(--line-thickness) / 2));
        top: var(--line-offset);
        /* Začíná od středu bodu */
    }

    .timeline-item h2 {
        margin-top: 5px;
        /* Jemná korekce zarovnání s puntíkem */
    }
}

/* === KONTEJNERY (RESPONZIVITA) === */
@media (min-width: 768px) {
    #efepr-timeline {
        width: 750px;
    }
}

@media (min-width: 992px) {
    #efepr-timeline {
        width: 970px;
    }
}

@media (min-width: 1200px) {
    #efepr-timeline {
        width: 1100px;
    }
}