/* ==============================================================
   TOAST NOTIFICATIONS COMPONENT
   Universal Toast styles for the entire system.
   Adaptive colors based on theme variables.
   ============================================================== */

.toast-container {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 18px;
    box-shadow: 0 10px 40px -10px rgba(var(--black-rgb), 0.15);
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 320px;
    max-width: 400px;
    position: relative;
    overflow: hidden;
    animation: toastSlideIn 0.4s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* Icons - Subtle and colored by state */
.toast-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(var(--primary-rgb), 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s;
}

.toast i {
    font-size: 18px;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-message {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-main);
    flex: 1;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    opacity: 0.6;
}

.toast-close:hover {
    background: rgba(var(--primary-rgb), 0.05);
    color: var(--primary);
    opacity: 1;
}

.toast-close i {
    font-size: 14px !important;
    color: inherit !important;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(var(--primary-rgb), 0.05);
    width: 100%;
}

.toast-progress-bar {
    height: 100%;
    background: var(--primary);
    width: 100%;
    transform-origin: left;
}

/* State Modifications (Elegant & Adaptive) */
.toast.success .toast-icon-wrapper { background: rgba(0, 255, 127, 0.1); }
.toast.success i { color: var(--success); }
.toast.success .toast-progress-bar { background: var(--success); }

.toast.error .toast-icon-wrapper { background: rgba(255, 77, 77, 0.1); }
.toast.error i { color: var(--danger); }
.toast.error .toast-progress-bar { background: var(--danger); }

.toast.warning .toast-icon-wrapper { background: rgba(245, 158, 11, 0.1); }
.toast.warning i { color: var(--warning); }
.toast.warning .toast-progress-bar { background: var(--warning); }

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9) translateX(20px);
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .toast-container {
        top: auto;
        bottom: 20px;
        left: 20px;
        right: 20px;
        align-items: center;
    }

    .toast {
        min-width: 100%;
        max-width: 100%;
        padding: 12px 16px;
    }
}
