﻿/* Unified Toast System - Apple/Google/Slack inspired */

.unified-toast-container {
    position: fixed;
    top: calc(var(--msg-navbar-height, 60px) + var(--spacer, 1.25rem));
    right: var(--spacer, 1.25rem);
    z-index: 11000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.unified-toast {
    width: 380px;
    max-width: calc(100vw - 40px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    pointer-events: auto;
    transform: translateX(420px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .unified-toast.show {
        transform: translateX(0);
        opacity: 1;
    }

    .unified-toast.hide {
        transform: translateX(420px);
        opacity: 0;
    }

.unified-toast-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    cursor: default;
}

.unified-toast-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.unified-toast-text {
    flex: 1;
    min-width: 0;
}

.unified-toast-message {
    font-size: 14px;
    color: #111827;
    line-height: 1.5;
    margin-bottom: 4px;
    font-weight: 500;
}

.unified-toast-count {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    margin-top: 6px;
}

    .unified-toast-count .count-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 20px;
        height: 20px;
        padding: 0 6px;
        background: #ef4444;
        color: white;
        border-radius: 10px;
        font-size: 11px;
        font-weight: 600;
    }

.unified-toast-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #9ca3af;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: -4px;
    margin-right: -4px;
}

    .unified-toast-close:hover {
        background: #f3f4f6;
        color: #374151;
    }

    .unified-toast-close i {
        font-size: 16px;
    }

.unified-toast-progress {
    height: 3px;
    width: 100%;
    transition: width 5000ms linear;
}

/* Type-specific styling */
.unified-toast[data-type="success"] .unified-toast-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.unified-toast[data-type="error"] .unified-toast-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.unified-toast[data-type="warning"] .unified-toast-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.unified-toast[data-type="info"] .unified-toast-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

/* Mobile responsive */
@media (max-width: 640px) {
    .unified-toast-container {
        top: calc(var(--msg-navbar-height, 60px) + 0.75rem);
        right: 0.75rem;
        left: 0.75rem;
    }

    .unified-toast {
        width: auto;
        max-width: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .unified-toast {
        background: #1f2937;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    }

    .unified-toast-message {
        color: #f9fafb;
    }

    .unified-toast-count {
        color: #9ca3af;
    }

    .unified-toast-close {
        color: #6b7280;
    }

        .unified-toast-close:hover {
            background: #374151;
            color: #d1d5db;
        }
}

/* Animation for stacking effect */
.unified-toast:nth-child(2) {
    margin-top: -4px;
}

.unified-toast:nth-child(3) {
    margin-top: -8px;
}

.unified-toast:nth-child(4) {
    margin-top: -12px;
}

.unified-toast:nth-child(5) {
    margin-top: -16px;
}

/* Ensure toasts don't interfere with other UI elements */
.unified-toast-container * {
    box-sizing: border-box;
}

/* Remove conflicting Bootstrap toast styles if present */
#toast-container.position-fixed {
    position: fixed !important;
    top: calc(var(--msg-navbar-height, 60px) + var(--spacer, 1.25rem)) !important;
    right: var(--spacer, 1.25rem) !important;
    bottom: auto !important;
    left: auto !important;
}

/* Hide old Bootstrap toasts */
.toast.align-items-center {
    display: none !important;
}
