/* =========================================================
   BOTÓN LÍNEA DE TIEMPO
   ========================================================= */

.timeline-toggle {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: rgba(255, 255, 255, 0.96);
    color: #305496;
    border: 1px solid #e1e7ed;
    border-radius: 7px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
    transition:
        height 0.18s ease-out,
        border-radius 0.18s ease-out,
        background-color 0.12s ease,
        color 0.12s ease;
}

.timeline-toggle:hover {
    background: #f3f6f9;
    color: #17365d;
}

.timeline-toggle.activo {
    background: #305496;
    color: #ffffff;
}

.timeline-toggle img {
    width: 18px;
    height: 18px;

    display: block;

    object-fit: contain;

    filter:
        invert(32%)
        sepia(18%)
        saturate(1180%)
        hue-rotate(177deg)
        brightness(87%)
        contrast(90%);
}

.timeline-toggle.activo img {
    filter:
        brightness(0)
        invert(1);
}

.timeline-toggle.activo:hover {
    background: #305496;
    color: #ffffff;
}

.timeline-toggle.activo:hover img {
    filter:
        brightness(0)
        invert(1);
}

.timeline-toggle.activo:active {
    background: #e9edf1;
    color: #17365d;
}

.timeline-toggle.activo:active img {
    filter:
        invert(32%)
        sepia(18%)
        saturate(1180%)
        hue-rotate(177deg)
        brightness(87%)
        contrast(90%);
}

/* =========================================================
   PANEL
   ========================================================= */

.timeline-panel {
    width: 0;
    height: 88px;
    padding: 0;
    overflow: hidden;
    opacity: 0;
    box-sizing: border-box;
    background: rgba(255, 255, 255, .96);
    border: 0 solid #d8e0e8;
    border-radius: 0 9px 9px 0;
    box-shadow: 4px 4px 14px rgba(0, 0, 0, .14);
    pointer-events: none;
    white-space: nowrap;
    transition:
        width .16s ease-in,
        padding .16s ease-in,
        opacity .1s ease-in;
}
/* =========================================================
   CONTROL COMPLETO DEL TIMELINE
   ========================================================= */

.timeline-control {
    position: fixed;

    left: var(--desplazamiento-panel);
    bottom: 25px;

    display: flex;
    align-items: flex-end;

    width: calc(100vw - var(--desplazamiento-panel));

    z-index: 1200;
}

/* ABIERTO */

.timeline-panel.visible {
    opacity: 1;
    visibility: visible;
}

.timeline-control.abierto .timeline-toggle {
    height: 88px;
    border-radius:
        9px 0 0 9px;
    box-shadow:
        -2px 4px 14px
        rgba(0, 0, 0, .14);
}


.timeline-control.abierto .timeline-panel {
    width: calc(
        100vw -
        var(--desplazamiento-panel) -
        38px
    );

    padding: 9px 12px 8px;

    opacity: 1;

    border-width: 1px;

    pointer-events: auto;

    transition:
        width .2s ease-out,
        padding .2s ease-out,
        opacity .1s ease-out .04s;
}

@media (prefers-reduced-motion: reduce) {
    .timeline-toggle,
    .timeline-panel,
    .timeline-control.abierto .timeline-panel {
        transition: none;
    }
}


/* =========================================================
   CABECERA
   ========================================================= */

.timeline-toolbar {

    position: relative;

    display: flex;
    align-items: center;

    min-height: 30px;

    margin-bottom: 5px;
}


/* =========================================================
   CONTROLES IZQUIERDA
   ========================================================= */

.timeline-actions {

    display: flex;

    gap: 5px;
}


.timeline-btn {

    width: 30px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    background: #ffffff;

    border: 1px solid #ccd5df;
    border-radius: 4px;

    color: #26384d;

    cursor: pointer;
}


.timeline-btn:hover {

    background: #f3f6f9;
}


/* =========================================================
   FECHA ACTUAL
   ========================================================= */

.timeline-current {

    position: absolute;

    left: 50%;

    transform: translateX(-50%);

    font-size: 13px;
    font-weight: 600;

    color: #26384d;

    white-space: nowrap;
}


/* =========================================================
   VELOCIDAD
   ========================================================= */

.timeline-speed {

    margin-left: auto;

    display: flex;

    gap: 2px;
}


.timeline-speed-btn {

    min-width: 31px;
    height: 24px;

    padding: 0 6px;

    background: #ffffff;

    border: 1px solid #bfc9d4;

    color: #26384d;

    font-size: 11px;

    cursor: pointer;
}


.timeline-speed-btn:first-child {
    border-radius: 4px 0 0 4px;
}

.timeline-speed-btn:last-child {
    border-radius: 0 4px 4px 0;
}


.timeline-speed-btn.active {

    background: #26384d;

    color: #ffffff;
}


/* =========================================================
   SLIDER
   ========================================================= */

.timeline-slider-container {

    position: relative;

    height: 19px;
}


.timeline-slider {

    width: 100%;

    margin: 0;

    accent-color: #1976d2;

    cursor: pointer;
}


/* =========================================================
   FECHAS
   ========================================================= */

.timeline-ticks {

    position: relative;

    height: 18px;

    margin-top: 0;

    font-size: 9px;

    color: #687585;
}


.timeline-tick {

    position: absolute;

    top: 2px;

    transform: translateX(-50%);

    white-space: nowrap;
}
