/**
 * Confirmation Slider - iPhone Style Slide to Confirm
 * Centralized confirmation system styling
 */

/* Slider Container */
.slider-container {
    padding: 20px 0;
}

.slider-track {
    position: relative;
    width: 100%;
    height: 60px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    border-radius: 30px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 2px solid #dee2e6;
    transition: all 0.3s ease;
}

.slider-track:hover {
    border-color: #adb5bd;
}

.slider-track.confirmed {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #28a745;
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.3);
}

/* Slider Fill (background that follows the thumb) */
.slider-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 60px;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border-radius: 30px;
    transition: width 0.3s ease, background 0.3s ease;
    z-index: 1;
}

.slider-track.confirmed .slider-fill {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
}

/* Slider Text */
.slider-text {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-weight: 600;
    font-size: 16px;
    z-index: 2;
    pointer-events: none;
    user-select: none;
    transition: opacity 0.3s ease;
}

.slider-text i {
    font-size: 20px;
    animation: slideHintPulse 1.5s ease-in-out infinite;
}

@keyframes slideHintPulse {
    0%, 100% {
        transform: translateX(0);
        opacity: 1;
    }
    50% {
        transform: translateX(5px);
        opacity: 0.7;
    }
}

/* Slider Thumb (draggable button) */
.slider-thumb {
    position: absolute;
    left: 0;
    top: 0;
    width: 60px;
    height: 100%;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    z-index: 3;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15),
        0 1px 3px rgba(0, 0, 0, 0.1);
    border: 2px solid #fff;
    transition: box-shadow 0.2s ease, transform 0.3s ease;
}

.slider-thumb:hover {
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.2),
        0 2px 4px rgba(0, 0, 0, 0.15);
}

.slider-thumb:active {
    cursor: grabbing;
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.2),
        0 1px 2px rgba(0, 0, 0, 0.1);
}

.slider-thumb i {
    font-size: 24px;
    color: #6c757d;
    transition: color 0.3s ease;
}

.slider-thumb.confirmed {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    border-color: #28a745;
}

.slider-thumb.confirmed i {
    color: #fff;
}

/* Modal Customizations */
#confirmationSliderModal .modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

#confirmationSliderModal .modal-header {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
}

#confirmationSliderModal .modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

#confirmationSliderModal .alert {
    border-radius: 8px;
}

#confirmationSliderModal .alert-danger {
    background-color: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}

#confirmationSliderModal .alert-success {
    background-color: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

#confirmationSliderModal .card {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#confirmationSliderModal .table td {
    padding: 0.75rem;
    vertical-align: middle;
}

/* Responsive */
@media (max-width: 576px) {
    .slider-track {
        height: 50px;
    }

    .slider-thumb {
        width: 50px;
    }

    .slider-fill {
        width: 50px;
    }

    .slider-text {
        font-size: 14px;
    }

    .slider-text i {
        font-size: 18px;
    }

    .slider-thumb i {
        font-size: 20px;
    }
}

/* Animation for modal entrance */
#confirmationSliderModal.fade .modal-dialog {
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

#confirmationSliderModal.show .modal-dialog {
    transform: scale(1);
}

/* Prevent text selection while dragging */
.slider-container * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Touch feedback */
.slider-thumb:active {
    transform: scale(0.95);
}

/* Success animation */
@keyframes successPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.slider-track.confirmed {
    animation: successPulse 0.5s ease-out;
}
