/**
 * Toastr Theme Integration
 * Adapts toast notifications to match the site's dark/light theme
 */

/* Dark Theme Toast Styling */
[data-bs-theme="dark"] #toast-container > div {
    background-color: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    color: var(--bs-body-color);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .toast-success {
    background-color: rgba(40, 167, 69, 0.2) !important;
    border-color: #28a745;
    color: #fff;
}

[data-bs-theme="dark"] .toast-error {
    background-color: rgba(220, 53, 69, 0.2) !important;
    border-color: #dc3545;
    color: #fff;
}

[data-bs-theme="dark"] .toast-warning {
    background-color: rgba(253, 126, 20, 0.2) !important;
    border-color: #fd7e14;
    color: #fff;
}

[data-bs-theme="dark"] .toast-info {
    background-color: rgba(13, 202, 240, 0.2) !important;
    border-color: #0dcaf0;
    color: #fff;
}

/* Light Theme - Keep default Toastr colors but slightly adjusted */
[data-bs-theme="light"] #toast-container > div {
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.15);
}

/* Close button visibility in both themes */
[data-bs-theme="dark"] .toast-close-button {
    color: rgba(255, 255, 255, 0.7);
}

[data-bs-theme="dark"] .toast-close-button:hover {
    color: rgba(255, 255, 255, 1);
}

[data-bs-theme="light"] .toast-close-button {
    color: rgba(0, 0, 0, 0.5);
}

[data-bs-theme="light"] .toast-close-button:hover {
    color: rgba(0, 0, 0, 0.8);
}

/* Progress bar theming */
[data-bs-theme="dark"] .toast-progress {
    opacity: 0.6;
}

[data-bs-theme="light"] .toast-progress {
    opacity: 0.4;
}

/* Push top-anchored toasts below the fixed header */
#toast-container.toast-top-right,
#toast-container.toast-top-left,
#toast-container.toast-top-center,
#toast-container.toast-top-full-width {
    top: calc(var(--header-height, 64px) + 16px);
}

@media (max-width: 767.98px) {
    #toast-container.toast-top-right,
    #toast-container.toast-top-left,
    #toast-container.toast-top-center,
    #toast-container.toast-top-full-width {
        top: calc(var(--header-height-mobile, 56px) + 12px);
    }
}

/* Subtle transparency with glass morphism */
#toast-container > div {
    opacity: 1;
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
}

[data-bs-theme="light"] .toast-success {
    background-color: rgba(81, 163, 81, 0.96) !important;
}

[data-bs-theme="light"] .toast-error {
    background-color: rgba(189, 54, 47, 0.96) !important;
}

[data-bs-theme="light"] .toast-info {
    background-color: rgba(47, 150, 180, 0.96) !important;
}

[data-bs-theme="light"] .toast-warning {
    background-color: rgba(248, 148, 6, 0.96) !important;
}

[data-bs-theme="dark"] .toast-success {
    background-color: rgba(40, 167, 69, 0.55) !important;
}

[data-bs-theme="dark"] .toast-error {
    background-color: rgba(220, 53, 69, 0.55) !important;
}

[data-bs-theme="dark"] .toast-warning {
    background-color: rgba(253, 126, 20, 0.55) !important;
}

[data-bs-theme="dark"] .toast-info {
    background-color: rgba(13, 202, 240, 0.55) !important;
}
