/* floating-menu.css */

/* --- استایل‌های دسکتاپ (فقط برای عرض‌های بالای 768 پیکسل) --- */
@media (min-width: 769px) {
    .desktop-floating-button {
        position: fixed;
        bottom: 30px;
        right: 30px;
        width: 56px;
        height: 56px;
        background: rgb(255 196 54 / 70%);
        backdrop-filter: blur(3px);
        border-radius: 12px;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        box-shadow: 0 4px 20px rgba(0,0,0,0.2);
        z-index: 99999;
        overflow: hidden;
        display: flex; /* مطمئن می‌شویم در دسکتاپ نمایش داده شود */
    }
    .desktop-floating-button i {
        font-size: 24px;
        color: rgb(0 0 0 / 80%);
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) translateX(0);
        opacity: 1;
        transition: opacity 0.4s ease, transform 0.4s ease;
        width: 24px;
        height: 24px;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    /* تغییر انیمیشن آیکون: از راست وارد و از چپ خارج شود */
    .desktop-floating-button i.hide-out {
        opacity: 0 !important; /* اضافه کردن !important */
        transform: translate(-50%, -50%) translateX(-20px) !important; /* از چپ خارج می‌شود */
    }
    .desktop-floating-button i.hide-in {
        opacity: 0 !important; /* اضافه کردن !important */
        transform: translate(-50%, -50%) translateX(20px) !important; /* از راست وارد می‌شود */
    }

    .desktop-menu {
        position: fixed;
        bottom: 90px;
        right: 30px;
        background: rgb(255 196 54 / 70%);
        backdrop-filter: blur(3px);
        border-radius: 12px;
        box-shadow: 0 4px 30px rgba(0,0,0,0.2);
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 12px 10px;
        z-index: 99998;
        width: 160px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
        display: flex; /* مطمئن می‌شویم در دسکتاپ نمایش داده شود اما ابتدا مخفی است */
    }
    .desktop-menu.open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    .desktop-menu a {
        color: rgb(0 0 0 / 80%);
        text-decoration: none;
        font-weight: 600;
        font-size: 14px;
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 6px 10px;
        border-radius: 8px;
        width: calc(100% - 0px);
        transition: background-color 0.3s ease, color 0.3s ease;
        margin: 0 auto;
    }
    .desktop-menu a:hover {
        background-color: #ffffff57;
        color: rgb(0 0 0 / 80%);
    }
    .desktop-menu i {
        font-size: 18px;
        color: rgb(0 0 0 / 80%);
        min-width: 18px;
        text-align: center;
    }

    /* نوار موبایل در دسکتاپ مخفی می‌شود */
    .mobile-floating-bar {
        display: none;
    }
}

/* --- استایل‌های موبایل (فقط برای عرض‌های کمتر از 769 پیکسل) --- */
@media (max-width: 768px) {
    /* دکمه و منوی دسکتاپ در موبایل مخفی می‌شوند */
    .desktop-floating-button,
    .desktop-menu {
        display: none !important; /* استفاده از important برای اطمینان از مخفی شدن */
    }

    .mobile-floating-bar {
        position: fixed;
        bottom: 15px;
        /* left: 0; */
        width: 90%;
        background: rgb(255 196 54 / 70%);
        backdrop-filter: blur(3px);
        box-shadow: 0 0px 10px rgba(0, 0, 0, 0.2);
        display: flex
;
        flex-direction: row-reverse;
        justify-content: space-around;
        align-items: center;
        padding: 5px 0;
        z-index: 99999;
        border-radius: 30px;
        margin-right: 5%;
    }

    .mobile-bar-item {
        display: flex;
        flex-direction: row; /* آیکون و متن کنار هم */
        align-items: center;
        justify-content: center; /* برای وسط چین شدن افقی داخل هر آیتم */
        text-decoration: none;
        color: rgb(0 0 0 / 80%);
        font-size: 14px; /* سایز فونت کمی بزرگ‌تر برای خوانایی بهتر */
        font-weight: 600;
        padding: 5px 10px; /* پدینگ برای فاصله بین آیتم‌ها و داخل هر آیتم */
        flex-grow: 1; /* اجازه رشد برای پر کردن فضا */
        transition: background-color 0.3s ease, color 0.3s ease;
    }

    .mobile-bar-item:hover,
    .mobile-bar-item:focus {
        background-color: rgb(0 0 0 / 10%); /* افکت هاور/فوکوس */
        color: rgb(0 0 0 / 80%);
    }

    .mobile-bar-item i {
        font-size: 18px; /* سایز آیکون */
        margin-left: 8px; /* فاصله بین آیکون و متن برای RTL */
        margin-right: 0; /* اطمینان از عدم وجود margin-right */
        color: rgb(0 0 0 / 80%);
    }

    .mobile-bar-item span {
        display: block;
        white-space: nowrap; /* جلوگیری از شکستن خط متن */
    }
}