/* ============ R25 Premium Alerts — SweetAlert2 ============ */

@keyframes r25-swal-in {
    from {
        opacity: 0;
        transform: scale(0.88) translateY(24px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes r25-swal-out {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.92) translateY(12px);
    }
}

@keyframes r25-icon-pop {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    60% {
        transform: scale(1.08);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes r25-icon-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.25);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(52, 211, 153, 0);
    }
}

@keyframes r25-toast-slide {
    from {
        opacity: 0;
        transform: translateY(100%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes r25-shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* Backdrop */
html body .swal2-container,
.swal2-container {
    background: rgba(3, 3, 4, 0.85) !important;
    padding: 1.25rem !important;
}

/* Popup shell */
html body .swal2-container .swal2-popup,
.swal2-popup {
    background: linear-gradient(
        168deg,
        rgba(22, 22, 28, 0.97) 0%,
        rgba(10, 10, 14, 0.99) 100%
    ) !important;
    border: 1px solid rgba(232, 185, 35, 0.14) !important;
    border-radius: 22px !important;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 28px 70px rgba(0, 0, 0, 0.6),
        0 0 100px rgba(232, 185, 35, 0.05) !important;
    padding: 2rem 1.75rem 1.65rem !important;
    font-family: 'Tajawal', sans-serif !important;
    overflow: hidden !important;
    position: relative !important;
    max-width: 26em !important;
}

.swal2-popup::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(232, 185, 35, 0.55),
        rgba(245, 208, 97, 0.35),
        transparent
    );
    pointer-events: none;
}

.swal2-popup::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 80% 50% at 50% -20%,
        rgba(232, 185, 35, 0.07),
        transparent 70%
    );
    pointer-events: none;
    z-index: 0;
}

.swal2-popup > * {
    position: relative;
    z-index: 1;
}

.swal2-show {
    animation: r25-swal-in 0.42s cubic-bezier(0.34, 1.45, 0.64, 1) !important;
}

.swal2-hide {
    animation: r25-swal-out 0.28s ease-in forwards !important;
}

/* Icons */
.swal2-icon {
    margin: 0.75rem auto 1.1rem !important;
    border: none !important;
    animation: r25-icon-pop 0.5s cubic-bezier(0.34, 1.45, 0.64, 1) 0.1s both !important;
}

.swal2-icon.swal2-success {
    width: 76px !important;
    height: 76px !important;
    border-radius: 50% !important;
    background: linear-gradient(
        145deg,
        rgba(52, 211, 153, 0.18),
        rgba(52, 211, 153, 0.04)
    ) !important;
    box-shadow:
        0 0 0 1px rgba(52, 211, 153, 0.2) inset,
        0 8px 32px rgba(52, 211, 153, 0.15) !important;
    animation: r25-icon-pop 0.5s cubic-bezier(0.34, 1.45, 0.64, 1) 0.1s both,
               r25-icon-glow 2.5s ease-in-out 0.6s infinite !important;
}

.swal2-icon.swal2-success .swal2-success-ring {
    border: 2px solid rgba(52, 211, 153, 0.35) !important;
    top: -2px !important;
    left: -2px !important;
    right: -2px !important;
    bottom: -2px !important;
}

.swal2-icon.swal2-success [class^='swal2-success-line'] {
    background-color: #34d399 !important;
    height: 4px !important;
    border-radius: 2px !important;
}

.swal2-icon.swal2-error {
    width: 76px !important;
    height: 76px !important;
    border-radius: 50% !important;
    background: linear-gradient(
        145deg,
        rgba(248, 113, 113, 0.18),
        rgba(248, 113, 113, 0.04)
    ) !important;
    box-shadow:
        0 0 0 1px rgba(248, 113, 113, 0.2) inset,
        0 8px 32px rgba(248, 113, 113, 0.12) !important;
}

.swal2-icon.swal2-error [class^='swal2-x-mark-line'] {
    background-color: #f87171 !important;
    height: 4px !important;
    border-radius: 2px !important;
    top: 36px !important;
}

.swal2-icon.swal2-warning {
    width: 76px !important;
    height: 76px !important;
    border-radius: 50% !important;
    background: linear-gradient(
        145deg,
        rgba(232, 185, 35, 0.18),
        rgba(232, 185, 35, 0.04)
    ) !important;
    box-shadow:
        0 0 0 1px rgba(232, 185, 35, 0.2) inset,
        0 8px 32px rgba(232, 185, 35, 0.12) !important;
    color: #e8b923 !important;
    border-color: transparent !important;
}

.swal2-icon.swal2-warning .swal2-icon-content {
    color: #e8b923 !important;
    font-weight: 800 !important;
}

.swal2-icon.swal2-info,
.swal2-icon.swal2-question {
    width: 76px !important;
    height: 76px !important;
    border-radius: 50% !important;
    background: linear-gradient(
        145deg,
        rgba(96, 165, 250, 0.18),
        rgba(96, 165, 250, 0.04)
    ) !important;
    box-shadow:
        0 0 0 1px rgba(96, 165, 250, 0.2) inset,
        0 8px 32px rgba(96, 165, 250, 0.12) !important;
    color: #60a5fa !important;
    border-color: transparent !important;
}

/* Typography */
.swal2-title {
    color: #f4f4f5 !important;
    font-size: 1.45rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.01em !important;
    padding: 0 0.5rem !important;
    margin: 0 0 0.35rem !important;
    line-height: 1.35 !important;
}

.swal2-html-container {
    color: #8b8b95 !important;
    font-size: 0.92rem !important;
    font-weight: 500 !important;
    line-height: 1.65 !important;
    padding: 0 0.5rem !important;
}

/* Actions */
.swal2-actions {
    gap: 0.75rem !important;
    margin-top: 1.35rem !important;
    padding: 0 !important;
}

html body .swal2-container button.swal2-confirm,
.swal2-confirm {
    background: linear-gradient(
        135deg,
        #c99a15 0%,
        #e8b923 40%,
        #f5d061 100%
    ) !important;
    background-size: 200% auto !important;
    color: #0a0a0c !important;
    border: none !important;
    border-radius: 14px !important;
    padding: 0.82rem 2.2rem !important;
    font-family: 'Tajawal', sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.92rem !important;
    min-width: 110px !important;
    box-shadow:
        0 4px 22px rgba(232, 185, 35, 0.32),
        0 0 0 1px rgba(255, 255, 255, 0.12) inset !important;
    transition: transform 0.22s ease, box-shadow 0.22s ease, background-position 0.4s ease !important;
    cursor: pointer !important;
}

.swal2-confirm:hover {
    transform: translateY(-2px) !important;
    background-position: right center !important;
    box-shadow:
        0 8px 30px rgba(232, 185, 35, 0.42),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset !important;
}

.swal2-confirm:active {
    transform: translateY(0) !important;
}

html body .swal2-container button.swal2-cancel,
.swal2-cancel {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #a1a1aa !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 14px !important;
    padding: 0.82rem 2rem !important;
    font-family: 'Tajawal', sans-serif !important;
    font-weight: 600 !important;
    font-size: 0.92rem !important;
    transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease !important;
    cursor: pointer !important;
}

.swal2-cancel:hover {
    transform: translateY(-2px) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
    color: #d4d4d8 !important;
}

.swal2-deny {
    background: linear-gradient(135deg, #dc2626, #ef4444) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 14px !important;
    padding: 0.82rem 2rem !important;
    font-family: 'Tajawal', sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.92rem !important;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3) !important;
    transition: transform 0.22s ease !important;
}

.swal2-deny:hover {
    transform: translateY(-2px) !important;
}

/* Timer bar */
.swal2-timer-progress-bar {
    background: linear-gradient(90deg, #e8b923, #f5d061) !important;
    height: 3px !important;
}

.swal2-timer-progress-bar-container {
    background: rgba(255, 255, 255, 0.06) !important;
    border-radius: 0 0 22px 22px !important;
}

/* Validation */
.swal2-validation-message {
    background: rgba(248, 113, 113, 0.1) !important;
    color: #f87171 !important;
    border: 1px solid rgba(248, 113, 113, 0.22) !important;
    border-radius: 10px !important;
    font-family: 'Tajawal', sans-serif !important;
    font-size: 0.88rem !important;
    margin-top: 0.75rem !important;
}

/* Input fields inside modals */
.swal2-input,
.swal2-textarea,
.swal2-select {
    background: rgba(0, 0, 0, 0.35) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 10px !important;
    color: #f4f4f5 !important;
    font-family: 'Tajawal', sans-serif !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
}

.swal2-input:focus,
.swal2-textarea:focus,
.swal2-select:focus {
    border-color: rgba(232, 185, 35, 0.45) !important;
    box-shadow: 0 0 0 3px rgba(232, 185, 35, 0.1) !important;
}

/* Toast notifications */
.swal2-popup.swal2-toast,
.custom-toast {
    background: linear-gradient(
        135deg,
        rgba(18, 18, 24, 0.96),
        rgba(12, 12, 16, 0.98)
    ) !important;
    border: 1px solid rgba(232, 185, 35, 0.12) !important;
    border-radius: 14px !important;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 12px 40px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(232, 185, 35, 0.04) !important;
    padding: 0.85rem 1.1rem !important;
    animation: r25-toast-slide 0.38s cubic-bezier(0.34, 1.45, 0.64, 1) !important;
}

.swal2-popup.swal2-toast .swal2-title,
.custom-toast .swal2-title {
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    color: #e4e4e7 !important;
    margin: 0 !important;
}

.swal2-popup.swal2-toast .swal2-icon,
.custom-toast .swal2-icon {
    width: 1.75rem !important;
    height: 1.75rem !important;
    min-width: 1.75rem !important;
    margin: 0 0 0 0.65rem !important;
    animation: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Legacy class aliases (dashboard pages) */
.custom-swal-popup {
    border-radius: 22px !important;
    border: 1px solid rgba(232, 185, 35, 0.14) !important;
}

.custom-swal-title {
    font-size: 1.35rem !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
}

.custom-swal-confirm {
    padding: 0.82rem 2.2rem !important;
    font-size: 0.92rem !important;
    border-radius: 14px !important;
    font-weight: 700 !important;
    transition: transform 0.22s ease, box-shadow 0.22s ease !important;
}

.custom-swal-confirm:hover {
    transform: translateY(-2px) !important;
}

.custom-swal-cancel {
    padding: 0.82rem 2rem !important;
    font-size: 0.92rem !important;
    border-radius: 14px !important;
    font-weight: 600 !important;
    transition: transform 0.22s ease !important;
}

.custom-swal-cancel:hover {
    transform: translateY(-2px) !important;
}

@media (max-width: 480px) {
    .swal2-popup {
        padding: 1.65rem 1.25rem 1.35rem !important;
        border-radius: 18px !important;
        margin: 0 0.5rem !important;
    }

    .swal2-title {
        font-size: 1.25rem !important;
    }

    .swal2-confirm,
    .swal2-cancel {
        padding: 0.75rem 1.5rem !important;
        font-size: 0.88rem !important;
    }
}
