/* کانتینر اصلی ویجت */
.cy-widget-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* دکمه اصلی ماشه */
.cy-main-trigger {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0073aa, #0099e6);
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.275, 1.55);
    padding: 0; /* برای اطمینان از مرکز بودن */
}

/* افکت چرخشی و نوسانی دکمه اصلی */
.cy-main-trigger .cy-icon-waiting {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: cy-pulse-rotate 3s infinite ease-in-out;
    width: 100%;
    height: 100%;
}

/* استایل آیکون‌های SVG داخلی دکمه اصلی */
.cy-main-trigger svg {
    fill: #ffffff;
    width: 24px;
    height: 24px;
    display: block; /* برای حذف فاصله‌های اضافی */
}

/* استایل آیکون ضربدر برای تراز بهتر */
.cy-main-trigger .cy-icon-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.cy-main-trigger:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

/* کنترل نمایش وضعیت باز/بسته */
.cy-widget-container.open .cy-main-trigger {
    background: linear-gradient(135deg, #d54e21, #e74c3c);
    transform: rotate(90deg);
}

.cy-widget-container.open .cy-main-trigger .cy-icon-waiting {
    display: none;
}

.cy-widget-container.open .cy-main-trigger .cy-icon-close {
    display: flex; /* تغییر از block به flex برای تراز شدن */
}

/* منوی دکمه‌های فرزند */
.cy-sub-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* انیمیشن باز شدن دکمه‌های فرزند */
.cy-widget-container.open .cy-sub-buttons {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* استایل عمومی دکمه‌های فرزند */
.cy-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease-in-out;
    overflow: hidden;
    box-sizing: border-box;
    padding: 0;
}

/* تنظیم سایز آیکون‌های SVG */
.cy-btn img {
    width: 55%;
    height: 55%;
    object-fit: contain;
    transition: transform 0.2s ease;
    filter: brightness(0) invert(1); 
}

.cy-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.3);
}

.cy-btn:hover img {
    transform: scale(1.08);
}

/* رنگ‌های سازمانی */
.cy-phone { background-color: #005a5b; }
.cy-telegram { background-color: #229ED9; }
.cy-whatsapp { background-color: #25D366; }
.cy-bale { background-color: #722475; }

/* انیمیشن چرخشی چت */
@keyframes cy-pulse-rotate {
    0% { transform: scale(1) rotate(0deg); }
    20% { transform: scale(1.08) rotate(-8deg); }
    40% { transform: scale(1.08) rotate(12deg); }
    60% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1) rotate(0deg); }
}