:root {
    --slider-height: 40px;
    --slider-bg: #ddd;
    --progress-bg: #4CAF50;
    --handle-bg: #333;
    --text-color: #666;
    --success-color: #4CAF50;
    --overlay-bg: rgba(0, 0, 0, 0.7);
    --notification-bg: #4CAF50;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden; /* Prevent scrolling while locked */
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 350px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    text-align: center;
    position: relative;
}

.modal h2 {
    font-size: 16px;
    color: #333;
    margin-bottom: 20px;
}

.slider {
    width: 100%;
    position: relative;
    height: var(--slider-height);
    background: var(--slider-bg);
    border-radius: 20px;
    overflow: hidden;
    margin: 20px 0;
    cursor: pointer;
}

.slider-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--progress-bg);
    transition: width 0.1s ease;
    z-index: 1; /* Ensure progress is below the handle and text */
}

@keyframes move-right-left {
    0% {
        transform: translateX(50%);
    }
    50% {
        transform: translateX(calc(100% - 50px)); /* Adjust based on element width */
    }
    100% {
        transform: translateX(50%);
    }
}

.slider-handle {
    position: absolute;
    left: 0;
    width: 50px;
    height: 40px; /* Adjust as needed */
    background: var(--handle-bg);
    color: #fff;
    border-radius: 20px;
    text-align: center;
    line-height: 40px; /* Vertically center text */
    cursor: pointer;
    transition: background 0.3s ease;
    user-select: none;
    z-index: 3; /* Ensure handle is above other elements */
    animation: move-right-left 2s ease-in-out infinite; /* Adjust timing for a smoother effect */
}

.slider-handle:hover {
    animation-play-state: paused; /* Pause animation on hover */
}

.slider-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-color);
    font-size: 14px;
    pointer-events: none;
    z-index: 2; /* Ensure text is below the handle but above progress */
    
}

.slider-text.success {
    color: var(--success-color);
}

.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--notification-bg);
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    display: none;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    z-index: 10000;
    display: none;
}
