/* ─────────────────────────────────────────────
   toast.css — Premium Toast Notification Styles
   ───────────────────────────────────────────── */

/* Toast Container */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
    width: calc(100% - 48px);
    pointer-events: none;
}

/* RTL Support */
html[dir="rtl"] .toast-container {
    right: auto;
    left: 24px;
}

/* Individual Toast */
.lib-toast {
    position: relative;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 16px;
    pointer-events: auto;
    overflow: hidden;
    animation: toastSlideIn 0.35s cubic-bezier(0.68, -0.6, 0.32, 1.6) forwards;
    transition: all 0.3s ease;
    border: none;
}

/* Color codes for full background toast classes */
.lib-toast.success {
    background: #4caf50;
    color: #ffffff;
}
.lib-toast.error {
    background: #ff5252;
    color: #ffffff;
}
.lib-toast.warning {
    background: #ffb300;
    color: #ffffff;
}
.lib-toast.info {
    background: #2196f3;
    color: #ffffff;
}

/* Slide-in & slide-out animations */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(120%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
html[dir="rtl"] @keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(-120%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.lib-toast.dismissing {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(120%);
    }
}
html[dir="rtl"] @keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-120%);
    }
}

/* Icon style */
.lib-toast-icon {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.lib-toast .lib-toast-icon {
    color: #ffffff;
}

/* Content style */
.lib-toast-body {
    flex-grow: 1;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    word-break: break-word;
}
html[dir="rtl"] .lib-toast-body {
    text-align: right;
}

/* Close Button style */
.lib-toast-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    flex-shrink: 0;
}
.lib-toast-close:hover {
    color: #ffffff;
}

/* Progress bar at the bottom */
.lib-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    width: 100%;
}
.lib-toast-progress-bar {
    height: 100%;
    width: 100%;
    transform-origin: left;
    background: rgba(255, 255, 255, 0.55);
}

html[dir="rtl"] .lib-toast-progress-bar {
    transform-origin: right;
}

/* Mobile responsive settings */
@media (max-width: 576px) {
    .toast-container {
        top: 16px;
        bottom: auto;
        right: 16px;
        left: 16px;
        max-width: none;
        width: calc(100% - 32px);
    }
    
    @keyframes toastSlideIn {
        from {
            opacity: 0;
            transform: translateY(-100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .lib-toast.dismissing {
        animation: toastSlideOutMobile 0.3s ease forwards;
    }
    
    @keyframes toastSlideOutMobile {
        from {
            opacity: 1;
            transform: translateY(0);
        }
        to {
            opacity: 0;
            transform: translateY(-100%);
        }
    }
}
