/**
 * Toast Notification Styles
 *
 * ✅ REFACTORING.md §10 - Accessibility ready
 * ✅ Bootstrap 5 compatible colors
 * ✅ Mobile-first responsive design
 *
 * @version 1.0.0
 * @since 2025-11-17
 */

/* Toast Container */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1090; /* Bootstrap toast z-index */
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
    pointer-events: none;
}

/* Mobile responsive */
@media (max-width: 576px) {
    .toast-container {
        top: auto;
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
}

/* Toast Notification */
.toast-notification {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bs-body-bg);
    border-left: 4px solid;
    border-radius: 0.375rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
    max-width: 100%;
    word-wrap: break-word;
}

/* Show state */
.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}

/* Hiding state */
.toast-notification.hiding {
    opacity: 0;
    transform: translateX(100%);
}

/* Toast Icon */
.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* Toast Message */
.toast-message {
    flex: 1;
    color: var(--bs-body-color);
    font-size: 0.9375rem;
    line-height: 1.4;
}

/* Close Button */
.toast-close {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--bs-secondary-color);
    opacity: 0.6;
    transition: opacity 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.toast-close:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    opacity: 1;
}

/* Type-specific styles - using Bootstrap semantic colors */
.toast-info {
    border-left-color: var(--bs-info);
}

.toast-info .toast-icon {
    color: var(--bs-info);
}

.toast-success {
    border-left-color: var(--bs-success);
}

.toast-success .toast-icon {
    color: var(--bs-success);
}

.toast-warning {
    border-left-color: var(--bs-warning);
}

.toast-warning .toast-icon {
    color: var(--bs-warning);
}

.toast-error {
    border-left-color: var(--bs-danger);
}

.toast-error .toast-icon {
    color: var(--bs-danger);
}

/* Dark mode support via data-bs-theme (Bootstrap 5.3+)
   Note: Main colors now use CSS variables, auto-adapt to dark mode */

/* Animation for multiple toasts */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Accessibility: High contrast mode */
@media (prefers-contrast: high) {
    .toast-notification {
        border-width: 3px;
        box-shadow: 0 0 0 2px black;
    }
}

/* Accessibility: Reduce motion */
@media (prefers-reduced-motion: reduce) {
    .toast-notification {
        transition: opacity 0.1s;
        transform: none;
    }

    .toast-notification.show {
        transform: none;
    }

    .toast-notification.hiding {
        transform: none;
    }
}
