/* Sweet Alert RTL Custom Styles */
.swal-rtl {
    direction: rtl !important;
    text-align: right !important;
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

.swal-title-rtl {
    text-align: center !important;
    font-weight: bold !important;
    font-size: 1.5rem !important;
    color: #2c3e50 !important;
}

.swal-content-rtl {
    text-align: right !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
}

/* Custom Button Styles */
.swal-confirm-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 12px 24px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3) !important;
    transition: all 0.3s ease !important;
}

.swal-confirm-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4) !important;
}

.swal-cancel-btn {
    background: linear-gradient(135deg, #6c757d 0%, #545b62 100%) !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 12px 24px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3) !important;
    transition: all 0.3s ease !important;
}

.swal-cancel-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(108, 117, 125, 0.4) !important;
}

/* Success Button Style */
.swal2-confirm.swal2-styled[style*="background-color: rgb(25, 135, 84)"] {
    background: linear-gradient(135deg, #198754 0%, #157347 100%) !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 12px 24px !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3) !important;
    transition: all 0.3s ease !important;
}

.swal2-confirm.swal2-styled[style*="background-color: rgb(25, 135, 84)"]:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(25, 135, 84, 0.4) !important;
}

/* Popup Container */
.swal2-popup {
    border-radius: 16px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
    padding: 2rem !important;
    max-width: 500px !important;
}

/* Icons */
.swal2-icon {
    margin: 1rem auto 1.5rem !important;
    border: none !important;
}

.swal2-icon.swal2-warning {
    border-color: transparent !important;
    color: #f39c12 !important;
}

.swal2-icon.swal2-success {
    border-color: transparent !important;
    color: #27ae60 !important;
}

.swal2-icon.swal2-error {
    border-color: transparent !important;
    color: #e74c3c !important;
}

/* Progress Bar */
.swal2-timer-progress-bar {
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4) !important;
    height: 4px !important;
}

/* Alert Components */
.alert.bg-warning-subtle {
    background-color: rgba(255, 193, 7, 0.1) !important;
    border: 1px solid rgba(255, 193, 7, 0.2) !important;
    color: #856404 !important;
}

.alert.bg-success-subtle {
    background-color: rgba(25, 135, 84, 0.1) !important;
    border: 1px solid rgba(25, 135, 84, 0.2) !important;
    color: #0f5132 !important;
}

/* Animation */
.swal2-show {
    animation: swal2-show-rtl 0.3s ease-out !important;
}

@keyframes swal2-show-rtl {
    0% {
        transform: scale(0.7) translateY(-20px);
        opacity: 0;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .swal2-popup {
        width: 90% !important;
        margin: 1rem !important;
        padding: 1.5rem !important;
    }
    
    .swal-title-rtl {
        font-size: 1.25rem !important;
    }
    
    .swal-content-rtl {
        font-size: 0.9rem !important;
    }
}

/* Loading Spinner */
.spinner-border {
    border: 4px solid rgba(0, 123, 255, 0.1);
    border-radius: 50%;
    border-top: 4px solid #007bff;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Flash Message Notifications */
.flash-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    max-width: 400px;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease-out;
    direction: rtl;
    text-align: right;
}

.flash-notification.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.flash-notification.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

@keyframes slideInRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

.flash-notification.closing {
    animation: slideOutRight 0.3s ease-in forwards;
}

/* Defensive: hide any stray dropdown elements that accidentally appear inside SweetAlert containers
   Some third-party scripts can inject dropdown toggles/menus into the DOM; if they end up inside
   a Swal popup they show as an empty, non-functional dropdown. Hide them inside Swal to avoid
   the visual glitch while preserving dropdowns elsewhere on the page. */
.swal2-container .dropdown,
.swal2-container .dropdown-menu,
.swal2-container .dropdown-toggle {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}