/* SweetAlert2 Custom Modern Styling - Shared across all pages */

/* Ensure SweetAlert appears above all content */
.swal2-container {
    z-index: 9999999 !important;
}
.swal2-popup {
    z-index: 9999999 !important;
}
.swal2-backdrop {
    z-index: 9999998 !important;
}

/* Fast modal animations for better performance */
.swal2-fast-modal {
    animation: swal2-fast-show 0.15s ease-out !important;
}

.swal2-fast-hide {
    animation: swal2-fast-hide 0.1s ease-in !important;
}

@keyframes swal2-fast-show {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes swal2-fast-hide {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.95);
        opacity: 0;
    }
}

.swal2-backdrop-show {
    animation: backdrop-show 0.15s ease-out !important;
}

.swal2-backdrop-hide {
    animation: backdrop-hide 0.1s ease-in !important;
}

@keyframes backdrop-show {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes backdrop-hide {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* Faster button transitions */
.swal2-confirm-fast,
.swal2-cancel-fast {
    transition: all 0.15s ease !important;
}

.swal2-confirm-fast:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 49, 105, 0.3) !important;
}

.swal2-cancel-fast:hover {
    transform: translateY(-1px);
}

/* Toast notification styling for better visibility */
.swal2-toast {
    border-radius: 8px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
    font-size: 14px !important;
}

.swal2-toast.swal2-success {
    background-color: #10b981 !important;
    color: white !important;
}

.swal2-toast.swal2-error {
    background-color: #ef4444 !important;
    color: white !important;
}

/* Ensure only confirm button shows when explicitly requested via custom class */
.swal2-confirm-only {
    display: inline-block !important;
}

/* Improved modal UI */
.swal2-popup {
    border-radius: 12px !important;
    padding: 24px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
}

.swal2-title {
    font-size: 20px !important;
    font-weight: 600 !important;
    color: #1f2937 !important;
    margin-bottom: 12px !important;
}

.swal2-content {
    font-size: 14px !important;
    color: #1f2937 !important;
    line-height: 1.5 !important;
}

.swal2-html-container {
    color: #1f2937 !important;
    font-size: 14px !important;
}

.swal2-confirm,
.swal2-cancel {
    padding: 10px 24px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
}

.swal2-confirm {
    background-color: #003169 !important;
    border: none !important;
    color: #ffffff !important;
}

.swal2-confirm:hover {
    background-color: #0080c9 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 49, 105, 0.3) !important;
    color: #ffffff !important;
}

.swal2-cancel {
    background-color: #f3f4f6 !important;
    color: #374151 !important;
    border: 1px solid #d1d5db !important;
}

.swal2-cancel:hover {
    background-color: #e5e7eb !important;
    transform: translateY(-1px);
    color: #374151 !important;
}

/* Ensure all button text is visible with maximum specificity */
.swal2-popup .swal2-actions .swal2-confirm,
.swal2-popup .swal2-confirm {
    color: #ffffff !important;
}

.swal2-popup .swal2-actions .swal2-cancel,
.swal2-popup .swal2-cancel {
    color: #374151 !important;
}

/* Deny button styling (if used) */
.swal2-deny {
    background-color: #ef4444 !important;
    border: none !important;
    color: #ffffff !important;
    padding: 10px 24px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
}

.swal2-deny:hover {
    background-color: #dc2626 !important;
    transform: translateY(-1px);
    color: #ffffff !important;
}

/* Delete confirmation button - red color */
.swal2-confirm-delete,
.swal2-popup .swal2-confirm-delete {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
}

.swal2-confirm-delete:hover,
.swal2-popup .swal2-confirm-delete:hover {
    background-color: #b91c1c !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3) !important;
}

/* Mobile Responsive Styles for SweetAlert */
@media (max-width: 768px) {
    .swal2-popup {
        width: 90% !important;
        max-width: 90% !important;
        padding: 20px !important;
        margin: 0 5% !important;
    }
    
    .swal2-title {
        font-size: 18px !important;
        margin-bottom: 10px !important;
    }
    
    .swal2-content,
    .swal2-html-container {
        font-size: 13px !important;
    }
    
    .swal2-actions {
        flex-direction: column !important;
        width: 100% !important;
        gap: 10px !important;
        margin-top: 20px !important;
    }
    
    .swal2-confirm,
    .swal2-cancel,
    .swal2-deny {
        width: 100% !important;
        margin: 0 !important;
        padding: 12px 16px !important;
        font-size: 14px !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Ensure buttons stack properly */
    .swal2-actions button {
        flex: 1 1 auto !important;
    }
    
    /* Adjust modal width for very small screens */
    @media (max-width: 480px) {
        .swal2-popup {
            width: 95% !important;
            max-width: 95% !important;
            padding: 16px !important;
        }
        
        .swal2-title {
            font-size: 16px !important;
        }
        
        .swal2-content,
        .swal2-html-container {
            font-size: 12px !important;
        }
    }
}

