/**
 * SaaS-Grade Toast Notification Engine
 * Zero Overlap, High-Aesthetic Floating Snackbars
 */

.app-toast-container {
    position: fixed;
    top: 75px;
    right: 24px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 420px;
    width: calc(100% - 48px);
}

.app-toast {
    pointer-events: auto;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
    padding: 13px 16px;
    overflow: hidden;
    animation: appToastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: transform 0.25s ease, opacity 0.25s ease, max-height 0.25s ease, margin 0.25s ease;
}

.app-toast:hover .app-toast-progress {
    animation-play-state: paused;
}

/* Accent Themes */
.app-toast-success {
    border-left: 4px solid #10b981 !important;
}
.app-toast-success .app-toast-icon-wrap {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}
.app-toast-success .app-toast-progress {
    background: #10b981;
}

.app-toast-error {
    border-left: 4px solid #ef4444 !important;
}
.app-toast-error .app-toast-icon-wrap {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.app-toast-error .app-toast-progress {
    background: #ef4444;
}

.app-toast-warning {
    border-left: 4px solid #f59e0b !important;
}
.app-toast-warning .app-toast-icon-wrap {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}
.app-toast-warning .app-toast-progress {
    background: #f59e0b;
}

.app-toast-info {
    border-left: 4px solid #3b82f6 !important;
}
.app-toast-info .app-toast-icon-wrap {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}
.app-toast-info .app-toast-progress {
    background: #3b82f6;
}

/* Icon Box */
.app-toast-icon-wrap {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    margin-top: 1px;
}

/* Content Area */
.app-toast-body {
    flex: 1;
    min-width: 0;
    padding-right: 4px;
}

.app-toast-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
    margin-bottom: 2px;
}

.app-toast-message {
    font-size: 12.5px;
    font-weight: 500;
    color: #475569;
    line-height: 1.45;
    word-break: break-word;
}

/* Close Button */
.app-toast-close {
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    margin-left: auto;
    flex-shrink: 0;
    transition: color 0.15s ease, transform 0.15s ease;
}

.app-toast-close:hover {
    color: #0f172a;
    transform: scale(1.15);
}

/* Animated Progress Bar */
.app-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    animation: appToastProgress linear forwards;
}

/* Exit State */
.app-toast.app-toast-exit {
    animation: appToastSlideOut 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Animations */
@keyframes appToastSlideIn {
    0% {
        opacity: 0;
        transform: translateX(110%) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes appToastSlideOut {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
        max-height: 140px;
        margin-bottom: 0;
    }
    100% {
        opacity: 0;
        transform: translateX(110%) scale(0.92);
        max-height: 0;
        margin-bottom: -10px;
        padding-top: 0;
        padding-bottom: 0;
        border: none;
    }
}

@keyframes appToastProgress {
    0% {
        width: 100%;
    }
    100% {
        width: 0%;
    }
}

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

/* Prevent legacy inline alert layout jumps across the project */
.container-fluid > .alert.alert-dismissible,
.dashboard-container > .alert.alert-dismissible,
.page-wrapper > .container-fluid > .alert.alert-dismissible,
.page-wrapper > .alert.alert-dismissible {
    display: none !important;
}

