/* ========================================
   Custom SweetAlert2 Styling
   ======================================== */

/* Override SweetAlert2 default styling to match website theme */
:root {
    --swal-primary: #2d5f3f;
    --swal-primary-dark: #1a3d28;
    --swal-accent: #8ab893;
    --swal-success: #28a745;
    --swal-error: #dc3545;
    --swal-warning: #ffc107;
    --swal-info: #17a2b8;
}

/* Main popup container */
.swal2-popup {
    border-radius: 20px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important;
    padding: 2rem !important;
    font-family: 'Poppins', sans-serif !important;
}

/* Title styling */
.swal2-title {
    color: var(--swal-primary-dark) !important;
    font-weight: 600 !important;
    font-size: 1.75rem !important;
    margin-bottom: 0.5rem !important;
}

/* Content text */
.swal2-html-container {
    color: #4a5568 !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
}

/* Icon styling */
.swal2-icon {
    border-width: 3px !important;
    margin: 1.5rem auto !important;
}

/* Success icon */
.swal2-icon.swal2-success {
    border-color: var(--swal-success) !important;
}

.swal2-icon.swal2-success [class^='swal2-success-line'] {
    background-color: var(--swal-success) !important;
}

.swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(40, 167, 69, 0.3) !important;
}

/* Error icon */
.swal2-icon.swal2-error {
    border-color: var(--swal-error) !important;
}

.swal2-icon.swal2-error [class^='swal2-x-mark-line'] {
    background-color: var(--swal-error) !important;
}

/* Warning icon */
.swal2-icon.swal2-warning {
    border-color: var(--swal-warning) !important;
    color: var(--swal-warning) !important;
}

/* Info icon */
.swal2-icon.swal2-info {
    border-color: var(--swal-info) !important;
    color: var(--swal-info) !important;
}

/* Question icon */
.swal2-icon.swal2-question {
    border-color: var(--swal-primary) !important;
    color: var(--swal-primary) !important;
}

/* Confirm button */
.swal2-confirm {
    background: linear-gradient(135deg, var(--swal-primary) 0%, var(--swal-primary-dark) 100%) !important;
    border: none !important;
    border-radius: 50px !important;
    padding: 0.75rem 2rem !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    box-shadow: 0 4px 15px rgba(45, 95, 63, 0.3) !important;
    transition: all 0.3s ease !important;
}

.swal2-confirm:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(45, 95, 63, 0.4) !important;
}

.swal2-confirm:focus {
    box-shadow: 0 0 0 3px rgba(45, 95, 63, 0.3) !important;
}

/* Cancel button */
.swal2-cancel {
    background-color: #e2e8f0 !important;
    color: #4a5568 !important;
    border: none !important;
    border-radius: 50px !important;
    padding: 0.75rem 2rem !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    transition: all 0.3s ease !important;
}

.swal2-cancel:hover {
    background-color: #cbd5e0 !important;
    transform: translateY(-2px) !important;
}

/* Deny button */
.swal2-deny {
    background: linear-gradient(135deg, var(--swal-error) 0%, #c82333 100%) !important;
    border: none !important;
    border-radius: 50px !important;
    padding: 0.75rem 2rem !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3) !important;
    transition: all 0.3s ease !important;
}

.swal2-deny:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4) !important;
}

/* Actions container */
.swal2-actions {
    margin-top: 1.5rem !important;
    gap: 0.75rem !important;
}

/* Input fields */
.swal2-input,
.swal2-textarea {
    border: 2px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 0.75rem 1rem !important;
    font-size: 1rem !important;
    transition: all 0.3s ease !important;
}

.swal2-input:focus,
.swal2-textarea:focus {
    border-color: var(--swal-primary) !important;
    box-shadow: 0 0 0 3px rgba(45, 95, 63, 0.1) !important;
    outline: none !important;
}

/* Close button */
.swal2-close {
    color: #a0aec0 !important;
    font-size: 2rem !important;
    transition: all 0.3s ease !important;
}

.swal2-close:hover {
    color: var(--swal-primary) !important;
    transform: rotate(90deg) !important;
}

/* Progress steps */
.swal2-progress-steps .swal2-progress-step {
    background-color: var(--swal-primary) !important;
}

.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step {
    background-color: var(--swal-primary-dark) !important;
}

/* Validation message */
.swal2-validation-message {
    background-color: #fff5f5 !important;
    color: var(--swal-error) !important;
    border-left: 4px solid var(--swal-error) !important;
    border-radius: 8px !important;
    padding: 0.75rem 1rem !important;
}

/* Loading spinner */
.swal2-loader {
    border-color: var(--swal-primary) transparent var(--swal-primary) transparent !important;
}

/* Timer progress bar */
.swal2-timer-progress-bar {
    background: var(--swal-primary) !important;
}

/* Backdrop */
.swal2-container {
    backdrop-filter: blur(5px);
}

/* Toast styling */
.swal2-popup.swal2-toast {
    border-radius: 15px !important;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15) !important;
}

.swal2-popup.swal2-toast .swal2-title {
    font-size: 1rem !important;
    margin-bottom: 0 !important;
}

.swal2-popup.swal2-toast .swal2-icon {
    margin: 0 !important;
    width: 2rem !important;
    height: 2rem !important;
}

/* Animation enhancements */
@keyframes swal2-show {
    0% {
        transform: scale(0.7);
        opacity: 0;
    }

    45% {
        transform: scale(1.05);
        opacity: 1;
    }

    80% {
        transform: scale(0.95);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes swal2-hide {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(0.5);
        opacity: 0;
    }
}

.swal2-show {
    animation: swal2-show 0.3s !important;
}

.swal2-hide {
    animation: swal2-hide 0.2s !important;
}

/* Custom success animation */
@keyframes successPulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.swal2-icon.swal2-success {
    animation: successPulse 0.5s ease-in-out !important;
}

/* Custom error shake animation */
@keyframes errorShake {
    0%, 100% {
        transform: translateX(0);
    }

    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }

    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

.swal2-icon.swal2-error {
    animation: errorShake 0.5s ease-in-out !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .swal2-popup {
        padding: 1.5rem !important;
        width: 90% !important;
    }

    .swal2-title {
        font-size: 1.5rem !important;
    }

    .swal2-html-container {
        font-size: 0.9rem !important;
    }

    .swal2-confirm,
    .swal2-cancel,
    .swal2-deny {
        padding: 0.65rem 1.5rem !important;
        font-size: 0.9rem !important;
    }

    .swal2-actions {
        flex-direction: column !important;
        width: 100% !important;
    }

    .swal2-actions button {
        width: 100% !important;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .swal2-popup {
        background-color: #1a202c !important;
    }

    .swal2-title {
        color: #f7fafc !important;
    }

    .swal2-html-container {
        color: #e2e8f0 !important;
    }

    .swal2-input,
    .swal2-textarea {
        background-color: #2d3748 !important;
        border-color: #4a5568 !important;
        color: #f7fafc !important;
    }
}