/* Frontend styles for Rasam Floating Button */

.rfb-floating-contact {
    position: fixed;
    z-index: 9999;
    font-family: inherit;
}

/* Main toggle button */

.rfb-toggle {
    width: var(--rfb-button-size, 64px);
    height: var(--rfb-button-size, 64px);
    border-radius: 999px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: linear-gradient(135deg,
            var(--rfb-color-button-from, #16a34a),
            var(--rfb-color-button-to, #059669));
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.rfb-toggle:hover {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.rfb-toggle:active {
    transform: scale(0.95);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.34);
}

.rfb-main-icon {
    width: calc(var(--rfb-button-size, 64px) - 24px);
    height: calc(var(--rfb-button-size, 64px) - 24px);
    fill: #ffffff;
}

/* Tooltip */

.rfb-tooltip {
    position: absolute;
    bottom: 0.9rem;
    background: var(--rfb-color-tooltip-bg, #111827);
    color: #f9fafb;
    font-size: 0.88rem;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    white-space: nowrap;
}

.rfb-tooltip::after {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border-width: 5px;
    border-style: solid;
}

.rfb-position-bottom-right .rfb-tooltip {
    right: calc(var(--rfb-button-size, 64px) + 0.6rem);
}

.rfb-position-bottom-right .rfb-tooltip::after {
    right: -5px;
    border-color: transparent transparent transparent var(--rfb-color-tooltip-bg, #111827);
}

.rfb-position-bottom-left .rfb-tooltip {
    left: calc(var(--rfb-button-size, 64px) + 0.6rem);
}

.rfb-position-bottom-left .rfb-tooltip::after {
    left: -5px;
    border-color: transparent var(--rfb-color-tooltip-bg, #111827) transparent transparent;
}

/* Panel */

.rfb-panel {
    position: absolute;
    right: 0;
    bottom: calc(var(--rfb-button-size, 64px) + 0.6rem);
    min-width: 250px;
    max-width: 300px;
    background: var(--rfb-color-panel-bg, #ffffff);
    color: var(--rfb-color-panel-text, #111827);
    border-radius: var(--rfb-panel-radius, 14px);
    box-shadow: 0 22px 45px rgba(15, 23, 42, 0.35);
    padding: 1rem 1rem 0.8rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
    font-size: 0.95rem;
}

.rfb-floating-contact.rfb-open .rfb-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.rfb-position-bottom-left .rfb-panel {
    left: 0;
    right: auto;
}

/* Panel header */

.rfb-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.6rem;
    margin-bottom: 0.6rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    font-size: 0.98rem;
    font-weight: 600;
}

.rfb-panel-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rfb-panel-close {
    border: none;
    background: transparent;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    color: #6b7280;
    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.rfb-panel-close:hover {
    background: #fee2e2;
    color: #b91c1c;
}

/* Items list */

.rfb-items-list {
    list-style: none;
    margin: 0;
    padding: 0.15rem 0;
}

.rfb-item+.rfb-item {
    margin-top: 0.35rem;
}

.rfb-item-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    padding: 1.1rem 0.75rem;
    border-radius: calc(var(--rfb-panel-radius, 14px) - 4px);
    background: #f9fafb;
    color: inherit;
    font-size: 0.97rem;
    transition:
        background 0.18s ease,
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.rfb-item-link:hover {
    background: var(--rfb-item-hover-bg, #ecfdf5);
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
}

/* Icon (emoji, SVG, or image) */

.rfb-item-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rfb-item-icon svg {
    width: 40px;
    height: 40px;
}

/* Uploaded image icon */

.rfb-icon-img {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    object-fit: cover;
}

/* Built-in SVGs */

.rfb-social-icon {
    fill: currentColor;
}

.rfb-social-telegram {
    color: #229ed9;
    /* Telegram brand color */
}

.rfb-social-instagram {
    color: #e1306c;
    /* Instagram main brand tone */
}

/* Text */

.rfb-item-text {
    flex: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.rfb-item-value {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Phone numbers RTL-safe */

.rfb-phone {
    direction: ltr;
    unicode-bidi: bidi-override;
}

/* When open, slightly stronger shadow on button */

.rfb-floating-contact.rfb-open .rfb-toggle {
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.4);
}

/* Responsive */

@media (max-width: 768px) {
    .rfb-panel {
        max-width: 310px;
    }
}




/* Override final styles for contact items */
.rfb-floating-contact .rfb-items-list .rfb-item-link {
    padding: 10px 14px;
    /* این مقدار رو هرطور دوست داری تنظیم کن */
    border-radius: var(--rfb-panel-radius, 14px);
}

/* اگر می‌خوای فاصله آیکون و متن رو هم دقیق کنترل کنی */
.rfb-floating-contact .rfb-item-icon {
    margin-left: 10px;
}