body {
    margin: 0;
    background: #fffffe;
    direction: rtl;
    height: 100vh;
    position: relative;
    overflow-x: hidden;
}

#sidePanel {
    position: fixed;
    bottom: 40px;
    left: 40px;
    height: 60px;
    width: 60px;
    background: linear-gradient(135deg, #123add, #2900f6);
    border-radius: 50%;
    box-shadow:
            0 4px 14px rgba(64, 37, 223, 0.7),
            inset 0 0 10px rgb(16, 73, 228),
            0 0 14px 3px rgba(54, 22, 243, 0.79);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    z-index: 10000;
    transition:
            width 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
            border-radius 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
            box-shadow 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
    overflow: hidden;
    will-change: width, border-radius;
}

/* حالت باز پنل */
#sidePanel.open {
    width: 720px;
    border-radius: 30px;
    background: linear-gradient(135deg, #5518ff, #5433ff);
    box-shadow:
            0 8px 28px rgb(85, 24, 255),
            inset 0 0 20px rgba(113,86,255,0.6);
}

/* علامت + در حالت بسته نمایش و در حالت باز مخفی */
#sidePanel > .plusSign {
    pointer-events: none;
    transition: opacity 0.3s ease;
}
#sidePanel.open > .plusSign {
    opacity: 0;
    pointer-events: none;
}

/* استایل اولیه دکمه‌ها */
#btnContainer {
    display: flex;
    gap: 20px;
    height: 100%;
    align-items: center;
    padding: 0 20px;
    margin-left: 70px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-30px);
    transition: transform 0.5s ease, opacity 0.5s ease, margin 0.5s ease;
}

/* حالت باز بودن پنل */
#sidePanel.open #btnContainer {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    margin-left: 0;
}

/* استایل دکمه‌ها */
#btnContainer button {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.3s ease, opacity 0.4s ease, transform 0.4s ease;
    user-select: none;

    opacity: 0;
    transform: translateX(20px);

    transition-duration: 0.15s !important;
}

#sidePanel.open #btnContainer button {
    opacity: 1;
    transform: translateX(0);
}

/* تاخیر مرحله‌ای از راست به چپ */
#sidePanel.open #btnContainer button:nth-child(1) {
    transition-delay: 0.55s;
}
#sidePanel.open #btnContainer button:nth-child(2) {
    transition-delay: 0.45s;
}
#sidePanel.open #btnContainer button:nth-child(3) {
    transition-delay: 0.35s;
    transform: translateX(10px);
    animation: moveRightToLeft 0.4s forwards 0.35s;
}
#sidePanel.open #btnContainer button:nth-child(4) {
    transition-delay: 0.25s;
}

@keyframes moveRightToLeft {
    from {
        transform: translateX(20px);
    }
    to {
        transform: translateX(0);
    }
}

/* ریسپانسیو برای موبایل و تبلت */
@media (max-width: 768px) {
    #sidePanel {
        bottom: 20px !important;
        left: 20px !important;
        width: 50px !important;
        height: 50px !important;
        border-radius: 50% !important;
        font-size: 24px !important;
        box-shadow:
            0 3px 10px rgba(64, 37, 223, 0.7),
            inset 0 0 8px rgb(16, 73, 228),
            0 0 10px 2px rgba(54, 22, 243, 0.79) !important;
        transition: none !important;
        overflow: hidden;
    }

    #sidePanel.open {
        width: calc(100vw - 40px) !important;
        max-width: 100% !important;
        height: 60px !important;
        border-radius: 30px !important;
        padding: 0 10px;
        box-shadow:
            0 6px 20px rgb(85, 24, 255),
            inset 0 0 15px rgba(113,86,255,0.6) !important;
    }

    #btnContainer {
        gap: 10px !important;
        margin-left: 0 !important;
        padding: 0 10px !important;
        height: 100% !important;
        align-items: center !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #btnContainer button {
        font-size: 14px !important;
        padding: 6px 10px !important;
        border-radius: 14px !important;
        white-space: nowrap;
        flex-shrink: 0;
    }

    #sidePanel > .plusSign {
        font-size: 22px !important;
    }
}


