/* Custom Styles for Payment Page */

/* Font Family */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa; /* Light grey background */
}

/* Card Styling */
.card {
    border: none;
    background-color: #ffffff;
}

.card-header {
    border-bottom: none;
    background-color: #0d6efd; /* Bootstrap primary color */
    color: white;
}

/* Form Control Styling */
.form-control,
.form-select {
    border-radius: 50rem !important; /* Pill shape for inputs */
    padding: 0.75rem 1.25rem;
    border: 1px solid #ced4da;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #0d6efd; /* Primary color on focus */
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Button Styling */
.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 50rem !important; /* Pill shape for button */
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-2px); /* Slight lift on hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Invalid Feedback Styling */
.form-control:invalid:focus,
.form-select:invalid:focus {
    border-color: #dc3545; /* Red for invalid */
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

.invalid-feedback {
    font-size: 0.875em;
    margin-top: 0.25rem;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 767.98px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .card {
        margin-left: -15px; /* Adjust to full width on small screens */
        margin-right: -15px;
        border-radius: 0; /* No rounded corners on very small screens for full width */
    }

    .card-header {
        border-radius: 0; /* No rounded corners on very small screens for full width */
    }
}
        /* Custom CSS for the loader spinner */
        .loader {
            border: 4px solid #f3f3f3; /* Light grey */
            border-top: 4px solid #3498db; /* Blue */
            border-radius: 50%;
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* Overlay for the loader */
        .loader-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(255, 255, 255, 0.8); /* Semi-transparent white */
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 10; /* Ensure it's above the form content */
        }

        /* Payment Gateway Sorting Styles */
        .sort-order {
            width: 80px;
            min-width: 80px;
        }

        .sort-controls {
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 5px;
        }

        .sort-handle {
            display: flex;
            align-items: center;
            gap: 5px;
            cursor: grab;
            padding: 2px;
            border-radius: 4px;
            transition: background-color 0.2s ease;
        }

        .sort-handle:hover {
            background-color: rgba(0, 0, 0, 0.05);
        }

        .sort-handle:active {
            cursor: grabbing;
        }

        .sort-number {
            font-weight: bold;
            color: #6c757d;
            min-width: 20px;
            text-align: center;
        }

        .sort-buttons {
            display: flex;
            flex-direction: row;
            gap: 2px;
        }

        .sort-buttons .btn {
            padding: 2px 6px;
            font-size: 0.75rem;
            line-height: 1;
        }

        /* Drag and Drop Styles */
        .dragging {
            opacity: 0.5;
            transform: rotate(2deg);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
            z-index: 1000;
            position: relative;
        }

        .drop-above {
            border-top: 3px solid #0d6efd !important;
            background-color: rgba(13, 110, 253, 0.1);
        }

        .drop-below {
            border-bottom: 3px solid #0d6efd !important;
            background-color: rgba(13, 110, 253, 0.1);
        }

        /* Table row hover effect for sorting */
        #paymentGatewaysTable tbody tr {
            transition: all 0.2s ease;
            cursor: grab;
            min-height: 70px;
        }

        #paymentGatewaysTable tbody tr td {
            vertical-align: middle;
            padding: 16px 8px;
            line-height: 1.4;
        }

        #paymentGatewaysTable tbody tr:hover {
            background-color: rgba(13, 110, 253, 0.05);
        }

        #paymentGatewaysTable tbody tr:active {
            cursor: grabbing;
        }

        /* Disabled button styles */
        .sort-buttons .btn:disabled {
            opacity: 0.3;
            cursor: not-allowed;
        }

        /* Save order button animation */
        .btn-saving {
            animation: pulse 1.5s infinite;
        }

        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.05); }
            100% { transform: scale(1); }
        }

        /* Responsive adjustments for sorting */
        @media (max-width: 768px) {
            .sort-controls {
                flex-direction: row;
                gap: 10px;
            }

            .sort-buttons {
                flex-direction: row;
            }

            .sort-order {
                width: 100px;
                min-width: 100px;
            }
        }

/* Smooth flip-out-top animation for alert close */
.flip-out-top {
    animation: flipOutTop 1s cubic-bezier(0.4, 0.2, 0.2, 1) forwards;
}
@keyframes flipOutTop {
    0% {
        transform: perspective(400px) translateY(0) rotateX(0deg);
        opacity: 1;
    }
    40% {
        transform: perspective(400px) translateY(-10px) rotateX(-20deg);
        opacity: 1;
    }
    100% {
        transform: perspective(400px) translateY(-60px) rotateX(90deg);
        opacity: 0;
    }
}
