/**
 * ============================================================
 * shared/components/Timeline/Timeline.css - СТИЛИ ТАЙМЛАЙНА
 * (палитра синхронизирована с Header.css)
 * ============================================================
 */

.timeline-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 16px;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    height: 56px;
    min-height: 56px;
    margin-top: 16px;
    width: 100%;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Тёмная тема контейнера — как у .header-pill в тёмной теме */
:root[data-theme="dark"] .timeline-bar {
    background: #232429;
    border-color: #34363c;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ---------- Подпись "Прогноз" ---------- */

.timeline-label {
    /* Цвет как у обычного текста в хедере */
    color: var(--text-primary, #111827);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: -0.01em;
    white-space: nowrap;
    border-right: 1px solid var(--border-color);
    padding-right: 16px;
    height: 32px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

:root[data-theme="dark"] .timeline-label {
    color: #f4f5f7;
}

.timeline-wrapper {
    position: relative;
    flex-grow: 1;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: visible;
}

.static-track {
    display: flex;
    width: 100%;
    justify-content: space-between;
    position: relative;
    z-index: 1;
    padding: 0 6px;
}

/* ---------- Статические метки месяцев ---------- */

.static-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    min-width: 20px;
    border-radius: 8px;
    padding: 4px 2px;
}

.static-item:hover:not(.hidden) {
    transform: translateY(-1px) scale(1.05);
    background: var(--bg-hover);
}

.static-item.hidden {
    display: none;
}

.static-item .month-name {
    font-size: 7px;
    text-transform: uppercase;
    color: var(--text-tertiary, #9ca3af);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 1px;
}

.static-item .month-number {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #111827);
    line-height: 1;
}

/* ---------- Активный "бегунок" ---------- */
/* Сделан в стиле активного чипа chip--sky + brand-акцент */

.active-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 64px;

    /* как chip--sky: фон — переменная sky, текст — sky-text */
    background: var(--sky);
    color: var(--sky-text);

    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    /* тень как у активного чипа */
    box-shadow:
        inset 0 0 0 1.5px currentColor,
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        0 2px 6px -2px rgba(15, 23, 42, 0.15);

    z-index: 10;
    cursor: grab;
    touch-action: none;
    transition: left 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
    left: 0%;
}

/* Тёмная тема — инверсия как у chip--sky в хедере */
:root[data-theme="dark"] .active-thumb {
    background: var(--sky-text);
    color: var(--sky);
    box-shadow:
        inset 0 0 0 1.5px currentColor,
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 2px 8px -2px rgba(0, 0, 0, 0.4);
}

.active-thumb:active {
    cursor: grabbing;
}

.active-thumb .month-name {
    font-size: 8px;
    text-transform: uppercase;
    color: currentColor;
    opacity: 0.8;
    font-weight: 600;
    margin-bottom: 1px;
}

.active-thumb .month-number {
    font-size: 18px;
    font-weight: 600;
    color: currentColor;
    line-height: 1;
}

.active-thumb .month-year {
    font-size: 7px;
    font-weight: 500;
    color: currentColor;
    opacity: 0.7;
    margin-top: 1px;
}

/* ---------- Счётчик (как header-pill__count) ---------- */

.timeline-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 7px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    white-space: nowrap;
    text-align: center;
    transition: background 0.15s ease,
                color 0.15s ease,
                border-color 0.15s ease;
}

:root[data-theme="dark"] .timeline-counter {
    background: #2a2b31;
    border-color: #45474e;
    color: #f4f5f7;
}

.timeline-counter code {
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: inherit;
    margin-right: 3px;
    background: transparent;
    padding: 0;
    display: inline-block;
    min-width: 16px;
    text-align: center;
}

/* ---------- Мобильная версия ---------- */

@media (max-width: 600px) {
    .timeline-bar {
        height: 44px;
        min-height: 44px;
        padding: 0 10px;
        gap: 8px;
        margin-top: 10px;
        border-radius: 10px;
    }

    .timeline-label {
        font-size: 0.8rem;
        padding-right: 8px;
        height: 24px;
    }

    .active-thumb {
        width: 44px;
        height: 52px;
        border-radius: 12px;
    }

    .active-thumb .month-number {
        font-size: 14px;
    }

    .active-thumb .month-name {
        font-size: 6px;
    }

    .active-thumb .month-year {
        font-size: 6px;
    }

    .static-item .month-number {
        font-size: 14px;
    }

    .static-item .month-name {
        font-size: 6px;
    }

    .timeline-counter {
        font-size: 10px;
        min-width: 22px;
        height: 22px;
        padding: 0 6px;
        border-radius: 6px;
    }

    .timeline-counter code {
        font-size: 10px;
    }
}