/* ==========================================================
   ATATÜRK ATLASI — timeline.css
   noUiSlider full custom skin + preview bubble + container
   ========================================================== */

/* --- TIMELINE GLASS CONTAINER --- */
.timeline-container {
    position: absolute;
    bottom: 24px;
    left: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    padding: 16px 24px;
    z-index: 450;
}

.timeline-track-wrapper {
    position: relative;
    flex-grow: 1;
    display: flex;
    align-items: center;
    /* Extra top space for the preview bubble, bottom space for pip labels */
    padding-top: 2px;
    padding-bottom: 30px;
}

/* --- PREVIEW BUBBLE --- */
.timeline-preview {
    position: absolute;
    /* Horizontally centered on the handle — set by JS */
    top: 0;
    left: 0;
    transform: translateX(-50%);
    background: white;
    padding: 6px;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    border: 1px solid rgba(226, 232, 240, 0.8);
    z-index: 500;
}
.timeline-preview.show {
    opacity: 1;
    visibility: visible;
}
.timeline-preview::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: white transparent transparent transparent;
}

.timeline-preview-year {
    font-size: 0.78rem;
    font-weight: 900;
    padding: 2px 10px;
    border-radius: 99px;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

/* ==========================================================
   noUiSlider — FULL CUSTOM SKIN
   Override all default .noUi-* classes to match the
   original design (coloured gradient track + round thumb)
   ========================================================== */

/* Slider root element */
#yearSlider.noUi-target {
    width: 100%;
    height: 6px;
    border: none;
    border-radius: 4px;
    background: #e2e8f0; /* overridden by JS gradient */
    box-shadow: none;
    cursor: pointer;
}

/* The filled/unfilled track parts — we hide noUi's default connect
   because we draw the gradient directly on the base */
#yearSlider .noUi-connects {
    border-radius: 4px;
    overflow: hidden;
}
#yearSlider .noUi-connect {
    /* Hide the "fill" overlay — gradient is on base */
    background: transparent;
}

/* Touch area (make thumb easier to grab on mobile) */
#yearSlider .noUi-origin {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

/* THUMB */
#yearSlider .noUi-handle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--thumb-color, #10b981);
    border: 2px solid white;
    box-shadow: 0 2px 8px var(--thumb-shadow, rgba(16, 185, 129, 0.4));
    cursor: pointer;
    top: 50%;
    /* noUiSlider positions from left edge by default */
    right: -11px; /* half of thumb width */
    transform: translateY(-50%);
    transition: transform 0.1s, background-color 0.3s ease, box-shadow 0.3s ease;
    /* Remove default noUi decorators */
    outline: none;
}
/* Remove default ::before / ::after lines inside handle */
#yearSlider .noUi-handle::before,
#yearSlider .noUi-handle::after {
    display: none;
}
#yearSlider .noUi-handle:hover,
#yearSlider .noUi-handle:focus {
    transform: translateY(-50%) scale(1.15);
}
/* Active (dragging) */
#yearSlider .noUi-handle.noUi-active {
    transform: translateY(-50%) scale(1.2);
}

/* noUiSlider injects a tooltip by default — we use our own bubble */
#yearSlider .noUi-tooltip { display: none; }

/* --- PIPS (year scale labels) — küçük font, taşmayı önle --- */
#yearSlider .noUi-pips {
    font-family: 'Inter', sans-serif;
    color: #94a3b8;
    height: auto;
    padding: 7px 0 0;
    top: 100%;
}
#yearSlider .noUi-marker-horizontal.noUi-marker {
    width: 1px;
    height: 4px;
    background: #cbd5e1;
}
#yearSlider .noUi-marker-horizontal.noUi-marker-large {
    height: 6px;
}
#yearSlider .noUi-value {
    font-size: 0.6rem;
    font-weight: 700;
    padding-top: 4px;
    color: #94a3b8;
}

/* --- MOBILE --- */
@media (max-width: 768px) {
    .timeline-container { bottom: 16px; left: 16px; right: 16px; padding: 12px 16px; }
    .timeline-track-wrapper { padding-top: 48px; }
    #yearSlider .noUi-value { font-size: 0.55rem; }
}
