/* Global Toast Notification Styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1060; /* Just above Bootstrap modals (1050) but below dropdowns (1070) */
    max-width: 400px;
    pointer-events: none;
}

/* Stack multiple app-specific toast containers */
.toast-container[data-app="custard"] {
    top: 20px;
    right: 20px;
}

.toast-container[data-app="vivibap"] {
    top: 20px;
    right: 20px;
}

.toast-container[data-app="mintor"] {
    top: 20px;
    right: 20px;
}

.toast-container[data-app="statpulse"] {
    top: 20px;
    right: 20px;
}

.toast-container[data-app="projecto"] {
    top: 20px;
    right: 20px;
}

.toast-container[data-app="global"] {
    top: 20px;
    right: 20px;
}

.toast-notification {
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: none;
    border-radius: 8px;
    animation: slideInRight 0.3s ease-out;
    pointer-events: auto;
    font-size: 0.9rem;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    position: relative;
}

.toast-notification .btn-close {
    padding: 0.25rem 0.5rem;
    margin: -0.25rem -0.5rem -0.25rem auto;
    font-size: 1.2rem;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    position: relative;
    top: -2px;
}

.toast-notification .btn-close:hover {
    opacity: 1;
}

.toast-notification .toast-content {
    flex: 1;
    margin-right: 8px;
    display: flex;
    align-items: center;
}

.toast-notification .toast-icon {
    margin-right: 8px;
    font-size: 1.1rem;
}

.toast-notification.fade {
    animation: slideOutRight 0.3s ease-in;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Dark mode styling for toast notifications */
[data-theme="dark"] .toast-notification {
    background-color: #2d2d2d !important;
    color: #e2e8f0 !important;
    border: 1px solid #555555 !important;
}

[data-theme="dark"] .toast-notification.alert-success {
    background-color: #1a4a1a !important;
    color: #b3ffb3 !important;
    border-color: #2a6a2a !important;
}

[data-theme="dark"] .toast-notification.alert-danger {
    background-color: #4a1a1a !important;
    color: #ffb3b3 !important;
    border-color: #6a2a2a !important;
}

[data-theme="dark"] .toast-notification.alert-warning {
    background-color: #4a4a1a !important;
    color: #ffffb3 !important;
    border-color: #6a6a2a !important;
}

[data-theme="dark"] .toast-notification.alert-info {
    background-color: #1a3a4a !important;
    color: #b3d9ff !important;
    border-color: #2a5a6a !important;
}

[data-theme="dark"] .toast-notification .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.9;
}

[data-theme="dark"] .toast-notification .btn-close:hover {
    opacity: 1;
    filter: invert(1) grayscale(100%) brightness(250%);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast-notification {
        font-size: 0.85rem;
        padding: 10px 14px;
    }
}
