/**
 * Theme-Aware Toast Alert Styles
 * Complements the ToastAlerts utility with theme-specific styling
 */

/* Base toast styles */
.swal2-popup.swal2-toast {
    border-radius: var(--radius-lg, 0.5rem) !important;
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1)) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(8px) !important;
}

/* Toast title styling */
.swal2-popup.swal2-toast .toast-title {
    font-weight: var(--font-weight-medium, 500) !important;
    font-size: var(--font-size-sm, 0.875rem) !important;
    line-height: var(--line-height-normal, 1.5) !important;
}

/* Progress bar styling */
.swal2-popup.swal2-toast .toast-progress-bar {
    background: rgba(255, 255, 255, 0.3) !important;
    height: 3px !important;
}

/* Close button styling */
.swal2-popup.swal2-toast .swal2-close {
    color: inherit !important;
    opacity: 0.7 !important;
    transition: var(--transition-opacity, opacity 0.15s ease-in-out) !important;
}

.swal2-popup.swal2-toast .swal2-close:hover {
    opacity: 1 !important;
}

/* Theme-specific toast styles */

/* Sunset Theme */
.toast-theme-sunset {
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600)) !important;
    color: var(--color-text-primary) !important;
}

.toast-theme-sunset.toast-success {
    background: linear-gradient(135deg, var(--color-success-500), var(--color-success-600)) !important;
}

.toast-theme-sunset.toast-error {
    background: linear-gradient(135deg, var(--color-danger-500), var(--color-danger-600)) !important;
}

.toast-theme-sunset.toast-warning {
    background: linear-gradient(135deg, var(--color-warning-500), var(--color-warning-600)) !important;
}

/* Oceanic Theme */
.toast-theme-oceanic {
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600)) !important;
    color: white !important;
}

/* Midnight Theme */
.toast-theme-midnight {
    background: linear-gradient(135deg, var(--color-gray-800), var(--color-gray-700)) !important;
    color: var(--color-text-primary) !important;
    border-color: var(--color-border) !important;
}

/* Aurora Theme */
.toast-theme-aurora {
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600)) !important;
    color: white !important;
}

/* Sunny Day Theme */
.toast-theme-sunny-day {
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600)) !important;
    color: var(--color-text-primary) !important;
}

/* Minimal White Theme */
.toast-theme-minimal-white {
    background: var(--color-surface) !important;
    color: var(--color-text-primary) !important;
    border: 1px solid var(--color-border) !important;
    box-shadow: var(--shadow-lg) !important;
}

.toast-theme-minimal-white.toast-success {
    background: var(--color-success-500) !important;
    color: white !important;
}

.toast-theme-minimal-white.toast-error {
    background: var(--color-danger-500) !important;
    color: white !important;
}

.toast-theme-minimal-white.toast-warning {
    background: var(--color-warning-500) !important;
    color: white !important;
}

/* Minty Fresh Theme */
.toast-theme-minty-fresh {
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600)) !important;
    color: white !important;
}

/* Carbon Theme */
.toast-theme-carbon {
    background: linear-gradient(135deg, var(--color-gray-800), var(--color-primary-500)) !important;
    color: var(--color-text-primary) !important;
    border-color: var(--color-primary-500) !important;
}

/* Cyber Glow Theme */
.toast-theme-cyber-glow {
    background: linear-gradient(135deg, var(--color-gray-900), var(--color-primary-500)) !important;
    color: var(--color-text-primary) !important;
    border: 1px solid var(--color-primary-500) !important;
    box-shadow: 0 0 20px rgba(147, 51, 234, 0.3) !important;
}

/* Solarized Dark Theme */
.toast-theme-solarized-dark {
    background: linear-gradient(135deg, var(--color-gray-800), var(--color-primary-500)) !important;
    color: var(--color-text-primary) !important;
}

/* Festival Theme */
.toast-theme-festival {
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-success-500)) !important;
    color: white !important;
}

/* Tropical Theme */
.toast-theme-tropical {
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-warning-500)) !important;
    color: white !important;
}

/* Retro Pop Theme */
.toast-theme-retro-pop {
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-warning-500)) !important;
    color: var(--color-text-primary) !important;
}

/* Gradient Flow Theme */
.toast-theme-gradient-flow {
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-700)) !important;
    color: white !important;
}

/* Forest Theme */
.toast-theme-forest {
    background: linear-gradient(135deg, var(--color-primary-600), var(--color-primary-800)) !important;
    color: white !important;
}

/* Ocean Breeze Theme */
.toast-theme-ocean-breeze {
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600)) !important;
    color: white !important;
}

/* Zen Theme */
.toast-theme-zen {
    background: linear-gradient(135deg, var(--color-surface), var(--color-primary-500)) !important;
    color: var(--color-text-primary) !important;
}

/* Desert Sunset Theme */
.toast-theme-desert-sunset {
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-700)) !important;
    color: white !important;
}

/* Dark theme adjustments */
.toast-dark-theme {
    backdrop-filter: blur(12px) !important;
}

.toast-dark-theme .swal2-close {
    color: rgba(255, 255, 255, 0.8) !important;
}

.toast-dark-theme .toast-progress-bar {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* Animation enhancements */
.swal2-popup.swal2-toast.swal2-show {
    animation: swal2-toast-show 0.3s ease-out !important;
}

.swal2-popup.swal2-toast.swal2-hide {
    animation: swal2-toast-hide 0.2s ease-in !important;
}

@keyframes swal2-toast-show {
    0% {
        transform: translateX(100%) scale(0.8);
        opacity: 0;
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes swal2-toast-hide {
    0% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateX(100%) scale(0.8);
        opacity: 0;
    }
}

/* Dialog Styles (Confirm & Alert) */
.swal2-popup:not(.swal2-toast) {
    border-radius: var(--radius-lg, 0.5rem) !important;
    box-shadow: var(--shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1)) !important;
    border: 1px solid var(--color-border, #e5e7eb) !important;
}

.confirm-theme-minimal-white {
    background: var(--color-surface) !important;
    color: var(--color-text-primary) !important;
}

.confirm-theme-midnight,
.confirm-theme-carbon,
.confirm-theme-cyber-glow,
.confirm-theme-solarized-dark {
    background: var(--color-surface) !important;
    color: var(--color-text-primary) !important;
    border-color: var(--color-border) !important;
}

.btn-confirm-theme {
    background: var(--color-danger-500) !important;
    border-color: var(--color-danger-500) !important;
    color: white !important;
}

.btn-cancel-theme {
    background: var(--color-gray-500) !important;
    border-color: var(--color-gray-500) !important;
    color: white !important;
}

.btn-alert-theme {
    background: var(--color-primary-500) !important;
    border-color: var(--color-primary-500) !important;
    color: white !important;
}

/* Alert Dialog Themes */
.alert-theme-minimal-white,
.alert-theme-midnight,
.alert-theme-carbon,
.alert-theme-cyber-glow,
.alert-theme-solarized-dark {
    background: var(--color-surface) !important;
    color: var(--color-text-primary) !important;
    border-color: var(--color-border) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .swal2-popup.swal2-toast {
        width: calc(100vw - 2rem) !important;
        max-width: 350px !important;
        margin: 0 1rem !important;
    }
    
    .swal2-popup:not(.swal2-toast) {
        width: calc(100vw - 2rem) !important;
        margin: 0 1rem !important;
    }
}