﻿/* ========== کانتینر اصلی Toast ========== */
.toast-floating-wrapper {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 380px;
    max-width: 90%;
    z-index: 99999 !important;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    pointer-events: none;
}

/* ========== آیتم‌های Toast ========== */
.toast-floating-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 22px;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    border-right: 6px solid;
    direction: rtl;
    font-family: 'Vazir', 'Tahoma', sans-serif;
    backdrop-filter: blur(8px);
    position: relative;
    margin: 0;
    width: 100%;
    cursor: pointer; /* اضافه کردن اشاره گر نشان دهد قابل کلیک است */
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

    .toast-floating-item.show {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    .toast-floating-item.hide {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
        pointer-events: none; /* وقتی مخفی می‌شود، قابل کلیک نباشد */
    }

/* ========== رنگ‌بندی‌ها ========== */
.toast-success {
    background: rgba(40, 167, 69, 0.98);
    border-right-color: #155724;
    color: white;
}

.toast-error {
    background: rgba(220, 53, 69, 0.98);
    border-right-color: #721c24;
    color: white;
}

.toast-warning {
    background: rgba(255, 193, 7, 0.98);
    border-right-color: #856404;
    color: #212529;
}

.toast-info {
    background: rgba(23, 162, 184, 0.98);
    border-right-color: #0c5460;
    color: white;
}

/* ========== هاور ========== */
.toast-floating-item:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    filter: brightness(1.05);
}

/* ========== آیکون‌ها ========== */
.toast-floating-item i {
    font-size: 2rem;
    margin-left: 16px;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

/* ========== محتوای متن ========== */
.toast-floating-content {
    flex-grow: 1;
    margin-left: 12px;
}

.toast-floating-title {
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.toast-floating-message {
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.95;
    word-break: break-word;
}

.source-info {
    opacity: 0.8;
    display: block;
    margin-top: 4px;
    font-size: 0.85rem;
}

    .source-info i {
        font-size: 0.85rem;
        margin-left: 4px;
    }

.time-info {
    opacity: 0.7;
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
}

/* ========== دکمه بستن ========== */
.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 1.2rem;
    opacity: 0.9;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    backdrop-filter: blur(4px);
}

    .close-btn:hover {
        background: rgba(255, 255, 255, 0.3);
        opacity: 1;
        transform: scale(1.1) rotate(90deg);
    }

/* ========== خط زمان (Progress Bar) ========== */
.toast-floating-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0 0 12px 12px;
}

.toast-floating-item.show::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 0 0 12px 12px;
    animation: progressLine 5s linear forwards;
}

@keyframes progressLine {
    0% {
        width: 100%;
    }

    100% {
        width: 0%;
    }
}

/* ========== حالت موبایل ========== */
@media (max-width: 768px) {
    .toast-floating-wrapper {
        width: 92%;
        bottom: 20px;
        gap: 8px;
    }

    .toast-floating-item {
        padding: 14px 18px;
    }

        .toast-floating-item i {
            font-size: 1.6rem;
            margin-left: 12px;
        }

    .toast-floating-title {
        font-size: 1.1rem;
    }

    .toast-floating-message {
        font-size: 0.9rem;
    }

    .close-btn {
        padding: 6px 10px;
    }
}

/* ========== تنظیمات RTL ========== */
.toast-floating-item {
    text-align: right;
}

    .toast-floating-item i {
        margin-left: 16px;
        margin-right: 0;
    }

.close-btn {
    margin-right: 12px;
    margin-left: 0;
}

.toast-floating-item::after,
.toast-floating-item::before {
    left: 0;
    right: auto;
}