/* ============================================
   Toast Notification Styles - Cyberpunk Fairy
   Modern, unobtrusive notifications with neon glow
   ============================================ */

/* Container */
.toast-container {
    position: fixed;
    top: 80px;  /* Below header */
    right: 24px;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: 420px;
}

/* Toast - Cyberpunk Style */
.toast {
    background: var(--surface);
    color: var(--fg);
    border-radius: var(--r-lg);
    box-shadow: 0 8px 24px rgb(0, 0, 0, 0.15), 0 0 20px var(--primary-tint); /* design-spec: toast composite with tint glow */
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 320px;
    pointer-events: all;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '✨';
    position: absolute;
    top: 8px;
    right: 40px;
    opacity: 0.4;
    font-size: 16px;
}

.toast.toast-visible {
    opacity: 1;
    transform: translateX(0);
}

.toast.toast-exit {
    opacity: 0;
    transform: translateX(400px);
}

/* Toast Types - Better contrast for readability */
.toast-success {
    border-color: var(--success);
    background: var(--surface);
    border-left: 4px solid var(--success);
    box-shadow: 0 8px 24px rgb(0, 0, 0, 0.15), 0 0 20px var(--success-tint); /* design-spec: toast composite with tint glow */
}

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

.toast-error {
    border-color: var(--danger);
    background: var(--surface);
    border-left: 4px solid var(--danger);
    box-shadow: 0 8px 24px rgb(0, 0, 0, 0.15), 0 0 20px var(--danger-tint); /* design-spec: toast composite with tint glow */
}

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

.toast-warning {
    border-color: var(--warning);
    background: var(--surface);
    border-left: 4px solid var(--warning);
    box-shadow: 0 8px 24px rgb(0, 0, 0, 0.15), 0 0 20px var(--warning-tint); /* design-spec: toast composite with tint glow */
}

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

.toast-info {
    border-color: var(--primary);
    background: var(--surface);
    border-left: 4px solid var(--primary);
    box-shadow: 0 8px 24px rgb(0, 0, 0, 0.15), 0 0 20px var(--primary-tint); /* design-spec: toast composite with tint glow */
}

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

/* Toast Content */
.toast-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.toast-message {
    font-size: 14px;
    line-height: 1.5;
    color: var(--fg);
    overflow-wrap: break-word;
}

/* Close Button */
.toast-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--fg-3);
    transition: color 0.2s ease;
    flex-shrink: 0;
    border-radius: var(--r-sm);
}

.toast-close:hover {
    color: var(--fg);
    background: rgb(0, 0, 0, 0.05); /* design-spec: faint tint on toast close button hover */
}

.toast-close i {
    font-size: 18px;
    display: block;
}

/* Responsive */
@media (max-width: 767.98px) {
    .toast-container {
        top: 70px;
        right: 16px;
        left: 16px;
        max-width: none;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }
}

/* Stacking animation */
.toast:not(:last-child) {
    margin-bottom: 0;
}

/* Progress bar (for timed toasts) */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.2;
    transform-origin: left;
    animation: toastProgress 5s linear forwards;
}

@keyframes toastProgress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Hide default flash messages (we convert them to toasts) */
/* But keep them visible if data-skip-toast is set (e.g., on setup pages) */
#flash-messages:not([data-skip-toast]) .alert {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
