/* Style for the value badge on the right */
.page-guide-badge {
    min-width: 40px;
    text-align: center;
    background-color: var(--scroll-thumb-color); /* Using your existing variable for the badge background */
    color: white; /* White text for contrast */
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
}

/* ---------------------------------------------------- */
/* --- SLIDER STYLING: Green Knob/Fill, Grey Track ---- */
/* ---------------------------------------------------- */

.custom-range-slider {
    /* Use the injected variable to calculate the progress fill percentage */
    --webkit-range-progress: calc( (var(--slider-value) / 150) * 100% );
    /* Base styles */
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--scroll-track-color); /* Default background is grey */
    border-radius: 3px;
    outline: none;
    transition: opacity .2s;
}

    /* ------------------ Webkit (Chrome, Safari) ------------------ */

    .custom-range-slider::-webkit-slider-runnable-track {
        width: 100%;
        height: 6px;
        cursor: pointer;
        /* Create the green fill using linear-gradient based on --webkit-range-progress */
        background: linear-gradient(to right, var(--slider-fill-color) var(--webkit-range-progress), /* Green Filled part */
         var(--scroll-track-color) var(--webkit-range-progress) /* Grey Unfilled part */
        );
        border-radius: 3px;
    }

    .custom-range-slider::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        margin-top: -5px;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background: var(--slider-fill-color); /* Green thumb */
        border: 1px solid var(--slider-fill-color);
        cursor: grab;
        box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    }

    .custom-range-slider:active::-webkit-slider-thumb {
        background: #ffffff; /* White thumb when active */
        border-color: var(--slider-fill-color);
        box-shadow: 0 0 0 6px rgba(40, 167, 69, 0.2);
    }

    /* ------------------ Mozilla (Firefox) ------------------ */

    .custom-range-slider::-moz-range-track {
        width: 100%;
        height: 6px;
        cursor: pointer;
        background:  var(--scroll-track-color); /* Grey track */
        border-radius: 3px;
    }

    .custom-range-slider::-moz-range-progress {
        background: var(--slider-fill-color); /* Green filled part */
        height: 6px;
        border-radius: 3px;
    }

    .custom-range-slider::-moz-range-thumb {
        width: 16px;
        height: 16px;
        border: none;
        border-radius: 50%;
        background: var(--slider-fill-color); /* Green thumb */
        cursor: grab;
        box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    }

    /* ------------------ Microsoft (IE/Edge) ------------------ */

    .custom-range-slider::-ms-track {
        width: 100%;
        height: 6px;
        cursor: pointer;
        background: transparent;
        border-color: transparent;
        border-width: 5px 0;
        color: transparent;
    }

    .custom-range-slider::-ms-fill-lower {
        background: var(--slider-fill-color); /* Green filled part */
        border-radius: 3px;
    }

    .custom-range-slider::-ms-fill-upper {
        background:  var(--scroll-track-color); /* Grey unfilled part */
        border-radius: 3px;
    }

    .custom-range-slider::-ms-thumb {
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background: var(--slider-fill-color); /* Green thumb */
        border: none;
        cursor: grab;
        box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    }
