/**
 * Confirmation Slider - Enhanced iPhone Style Slide to Confirm
 * Polished, responsive, iPhone-shaped modal
 */

/* Modal Dialog - iPhone-like shape */
#confirmationSliderModal .modal-dialog {
    max-width: 380px;
    margin: 1.75rem auto;
}

#confirmationSliderModal .modal-content {
    border-radius: 28px;
    border: none;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    background: #ffffff;
}

/* Modal Header - Frosted glass effect */
#confirmationSliderModal .modal-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.25rem 1.5rem;
}

#confirmationSliderModal .modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1c1c1e;
    letter-spacing: -0.02em;
}

#confirmationSliderModal .modal-title i {
    font-size: 1.3rem;
    vertical-align: middle;
}

/* Modal Body */
#confirmationSliderModal .modal-body {
    padding: 1.5rem;
    background: #f2f2f7;
}

/* Alert Boxes - iOS style */
#confirmationSliderModal .alert {
    border-radius: 14px;
    border: none;
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

#confirmationSliderModal .alert-danger {
    background: linear-gradient(135deg, #fee 0%, #fdd 100%);
    color: #c7254e;
}

#confirmationSliderModal .alert-danger .alert-title {
    color: #c7254e;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

#confirmationSliderModal .alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #0f5132;
}

#confirmationSliderModal .alert i.icon {
    font-size: 1.5rem;
}

/* Details Card - Clean iOS table style */
#confirmationSliderModal .card {
    border-radius: 14px;
    border: none;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

#confirmationSliderModal .table {
    margin-bottom: 0;
}

#confirmationSliderModal .table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #f2f2f7;
    font-size: 0.9rem;
}

#confirmationSliderModal .table tr:last-child td {
    border-bottom: none;
}

#confirmationSliderModal .table .text-muted {
    color: #8e8e93 !important;
    font-weight: 500;
}

#confirmationSliderModal .table strong {
    color: #1c1c1e;
    font-weight: 600;
}

/* Slider Container */
.slider-container {
    padding: 1.25rem 0;
}

.slider-track {
    position: relative;
    width: 100%;
    height: 56px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 28px;
    overflow: hidden;
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.06),
        0 1px 2px rgba(0, 0, 0, 0.04);
    border: 1.5px solid #e5e5ea;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider-track:active {
    box-shadow:
        inset 0 2px 6px rgba(0, 0, 0, 0.08),
        0 2px 4px rgba(0, 0, 0, 0.06);
}

.slider-track.confirmed {
    background: linear-gradient(135deg, #34c759 0%, #30d158 100%);
    border-color: #34c759;
    box-shadow:
        0 0 0 2px rgba(52, 199, 89, 0.2),
        0 4px 12px rgba(52, 199, 89, 0.3);
}

/* Slider Fill */
.slider-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 56px;
    background: linear-gradient(135deg, #ff3b30 0%, #ff2d55 100%);
    border-radius: 28px;
    transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    opacity: 0.15;
}

.slider-track.confirmed .slider-fill {
    background: linear-gradient(135deg, #34c759 0%, #30d158 100%);
    opacity: 1;
}

/* Slider Text */
.slider-text {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8e8e93;
    font-weight: 600;
    font-size: 15px;
    z-index: 2;
    pointer-events: none;
    user-select: none;
    transition: opacity 0.2s ease;
    letter-spacing: -0.02em;
}

.slider-text i {
    font-size: 18px;
    animation: slideHintPulse 2s ease-in-out infinite;
    margin-right: 6px;
}

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

/* Slider Thumb - iOS style button */
.slider-thumb {
    position: absolute;
    left: 3px;
    top: 3px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    z-index: 3;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 -1px 1px rgba(0, 0, 0, 0.05);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider-thumb:hover {
    transform: scale(1.05);
    box-shadow:
        0 6px 16px rgba(0, 0, 0, 0.2),
        0 3px 6px rgba(0, 0, 0, 0.15),
        inset 0 -1px 1px rgba(0, 0, 0, 0.05);
}

.slider-thumb:active {
    cursor: grabbing;
    transform: scale(0.98);
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.2),
        0 1px 3px rgba(0, 0, 0, 0.15);
}

.slider-thumb i {
    font-size: 22px;
    color: #8e8e93;
    transition: all 0.3s ease;
}

.slider-thumb.confirmed {
    background: linear-gradient(135deg, #34c759 0%, #30d158 100%);
    box-shadow:
        0 4px 12px rgba(52, 199, 89, 0.4),
        0 2px 4px rgba(52, 199, 89, 0.3);
}

.slider-thumb.confirmed i {
    color: #ffffff;
    transform: rotate(360deg) scale(1.1);
}

/* Modal Footer */
#confirmationSliderModal .modal-footer {
    background: #f2f2f7;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 1.5rem;
}

#confirmationSliderModal .modal-footer .btn-link {
    color: #007aff;
    font-weight: 500;
    text-decoration: none;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

#confirmationSliderModal .modal-footer .btn-link:hover {
    color: #0051d5;
}

/* Responsive Design */
@media (max-width: 576px) {
    #confirmationSliderModal .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }

    #confirmationSliderModal .modal-content {
        border-radius: 24px;
    }

    .slider-track {
        height: 52px;
        border-radius: 26px;
    }

    .slider-thumb {
        width: 46px;
        height: 46px;
        border-radius: 23px;
    }

    .slider-fill {
        width: 46px;
        border-radius: 26px;
    }

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

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

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

    #confirmationSliderModal .modal-header,
    #confirmationSliderModal .modal-body,
    #confirmationSliderModal .modal-footer {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}

/* iPad / Tablet */
@media (min-width: 577px) and (max-width: 991px) {
    #confirmationSliderModal .modal-dialog {
        max-width: 420px;
    }
}

/* Animation for modal entrance */
#confirmationSliderModal.fade .modal-dialog {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease-out;
    transform: scale(0.9) translateY(-20px);
    opacity: 0;
}

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

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

/* Touch feedback */
@media (hover: none) and (pointer: coarse) {
    .slider-thumb:active {
        transform: scale(0.95);
    }
}

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

@keyframes successGlow {
    0% {
        box-shadow:
            0 0 0 0 rgba(52, 199, 89, 0.4),
            0 4px 12px rgba(52, 199, 89, 0.3);
    }
    50% {
        box-shadow:
            0 0 0 8px rgba(52, 199, 89, 0),
            0 4px 16px rgba(52, 199, 89, 0.4);
    }
    100% {
        box-shadow:
            0 0 0 0 rgba(52, 199, 89, 0),
            0 4px 12px rgba(52, 199, 89, 0.3);
    }
}

.slider-track.confirmed {
    animation: successPulse 0.6s cubic-bezier(0.4, 0, 0.2, 1), successGlow 1s ease-out;
}

/* Haptic-like feedback animation */
@keyframes hapticFeedback {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-2px);
    }
    75% {
        transform: translateX(2px);
    }
}

.slider-thumb:active {
    animation: hapticFeedback 0.1s ease-out;
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    #confirmationSliderModal .modal-content {
        background: #1c1c1e;
    }

    #confirmationSliderModal .modal-header {
        background: linear-gradient(135deg, #2c2c2e 0%, #1c1c1e 100%);
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }

    #confirmationSliderModal .modal-title {
        color: #ffffff;
    }

    #confirmationSliderModal .modal-body {
        background: #000000;
    }

    #confirmationSliderModal .modal-footer {
        background: #000000;
        border-top-color: rgba(255, 255, 255, 0.1);
    }

    .slider-track {
        background: linear-gradient(135deg, #2c2c2e 0%, #1c1c1e 100%);
        border-color: #38383a;
    }

    .slider-text {
        color: #8e8e93;
    }

    #confirmationSliderModal .card {
        background: #1c1c1e;
    }

    #confirmationSliderModal .table td {
        border-bottom-color: #38383a;
    }

    #confirmationSliderModal .table .text-muted {
        color: #8e8e93 !important;
    }

    #confirmationSliderModal .table strong {
        color: #ffffff;
    }
}

/* Loading state (optional) */
.slider-thumb.loading {
    pointer-events: none;
}

.slider-thumb.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
