/**
 * SweetAlert2 Theme Integration
 * Adapts SweetAlert2 modals to match the site's dark/light theme
 */

/* Light Theme (default) */
.swal2-popup {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
}

.swal2-title {
    color: var(--bs-body-color) !important;
}

.swal2-html-container {
    color: var(--bs-body-color) !important;
}

.swal2-input,
.swal2-textarea,
.swal2-select {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
    border-color: var(--bs-border-color) !important;
}

.swal2-input:focus,
.swal2-textarea:focus,
.swal2-select:focus {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25) !important;
}

/* Dark Theme Adjustments */
[data-bs-theme="dark"] .swal2-popup {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
    border: 1px solid var(--bs-border-color);
}

[data-bs-theme="dark"] .swal2-title {
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .swal2-html-container {
    color: var(--bs-secondary-color) !important;
}

[data-bs-theme="dark"] .swal2-input,
[data-bs-theme="dark"] .swal2-textarea,
[data-bs-theme="dark"] .swal2-select {
    background-color: var(--bs-secondary-bg) !important;
    color: var(--bs-body-color) !important;
    border-color: var(--bs-border-color) !important;
}

[data-bs-theme="dark"] .swal2-close {
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .swal2-close:hover {
    color: var(--bs-danger) !important;
}

/* Icon colors remain consistent across themes */
.swal2-icon.swal2-success {
    border-color: #28a745 !important;
    color: #28a745 !important;
}

.swal2-icon.swal2-error {
    border-color: #dc3545 !important;
    color: #dc3545 !important;
}

.swal2-icon.swal2-warning {
    border-color: #fd7e14 !important;
    color: #fd7e14 !important;
}

.swal2-icon.swal2-info {
    border-color: #0dcaf0 !important;
    color: #0dcaf0 !important;
}

.swal2-icon.swal2-question {
    border-color: #6f42c1 !important;
    color: #6f42c1 !important;
}

/* Button theming handled by confirm-helper.js */
/* These are fallback styles */
.swal2-confirm {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
}

.swal2-cancel {
    background-color: var(--bs-secondary) !important;
    border-color: var(--bs-secondary) !important;
}

/* Dark theme overlay */
[data-bs-theme="dark"] .swal2-container {
    background-color: rgba(0, 0, 0, 0.7) !important;
}

/* Light theme overlay */
[data-bs-theme="light"] .swal2-container {
    background-color: rgba(0, 0, 0, 0.4) !important;
}
