/* Accessibility fixes for SweetAlert2 elements */

/* Hide SweetAlert2 elements that are not in use to prevent accessibility warnings */
.swal2-input[style*="display: none"],
.swal2-file[style*="display: none"],
.swal2-textarea[style*="display: none"],
.swal2-checkbox[style*="display: none"],
.swal2-image[style*="display: none"] {
    display: none !important;
    visibility: hidden !important;
}

/* Ensure visible SweetAlert2 elements have proper focus styles */
.swal2-input:focus,
.swal2-file:focus,
.swal2-textarea:focus,
.swal2-select:focus {
    outline: 2px solid #3085d6;
    outline-offset: 2px;
}

/* Improve contrast for better accessibility */
.swal2-popup {
    color: #333;
}

.swal2-title {
    color: #333 !important;
}

.swal2-content {
    color: #666 !important;
}

/* Fix CSS performance issues by using transform instead of layout-triggering properties */
@keyframes swal2-show {
    0% {
        transform: scale(0.7) translateY(-100px);
        opacity: 0;
    }
    45% {
        transform: scale(1.05) translateY(0);
        opacity: 1;
    }
    80% {
        transform: scale(0.95) translateY(0);
        opacity: 1;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes swal2-hide {
    0% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    100% {
        transform: scale(0.5) translateY(-100px);
        opacity: 0;
    }
}

/* Override SweetAlert2 animations to use transform instead of layout properties */
.swal2-popup.swal2-show {
    animation: swal2-show 0.3s ease-out;
}

.swal2-popup.swal2-hide {
    animation: swal2-hide 0.15s ease-in;
}

/* Ensure proper user-select support across browsers */
.swal2-popup * {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.swal2-actions button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Prevent SweetAlert2 from breaking 100vh layouts by forcing body height back */
body.swal2-height-auto {
    height: 100vh !important;
}
