/* 
استایل‌های زیر حذف شده‌اند تا دکمه به حالت پیش‌فرض (سمت راست صفحه) برگردد

.back-top {
    left: 40px !important;
    right: auto !important;
}

@media (max-width: 767.98px) {
    .back-top {
        left: 10px !important;
        right: auto !important;
    }
}
*/ 

/* استایل‌های قدیمی چت باکس - غیرفعال شده */
/*
.chat-button {
    position: fixed;
    bottom: 40px;
    left: 40px;
    z-index: 1000;
    background-color: #066ac9;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.chat-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

.chat-button i {
    font-size: 24px;
}

.chat-options {
    position: fixed;
    bottom: 110px;
    left: 40px;
    z-index: 999;
    display: none;
    flex-direction: column;
    gap: 10px;
}

.chat-options.show {
    display: flex;
}

.chat-option {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.chat-option:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.chat-option.crisp {
    background-color: #1972F5;
}

.chat-option.telegram {
    background-color: #0088cc;
}
*/

/* استایل‌های نوار چت پایین صفحه */
.chat-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #066ac9;
    color: white;
    height: 50px;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
}

.chat-bar-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 800px;
    position: relative;
}

.chat-option-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-weight: 500;
}

.chat-option-bar:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.chat-option-bar i {
    margin-right: 6px;
    font-size: 16px;
}

.chat-option-bar.crisp {
    background-color: #1972F5;
}

.chat-option-bar.telegram {
    background-color: #0088cc;
}

/* تنظیمات دکمه اسکرول به بالا - استفاده از اسکرول پیش‌فرض سایت */
.back-top {
    display: none !important; /* پنهان کردن دکمه اسکرول پیش‌فرض */
}

/* استایل‌های پیشرفته نوار پایین سایت - طراحی مدرن با افکت‌های ویژه */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    height: 60px;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 -3px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.bottom-bar-container {
    display: flex;
    justify-content: center; /* تغییر به وسط چین برای دسکتاپ */
    align-items: center;
    width: 100%;
    max-width: 1200px;
    padding: 0 20px;
    gap: 40px; /* کاهش فاصله بین آیتم‌ها */
    position: relative;
}

/* تغییر فاصله دکمه اسکرول از آیتم قبلی در حالت دسکتاپ */
@media (min-width: 768px) {
    .bottom-bar-item.scroll-top-btn {
        margin-left: -15px; /* نزدیکتر به دکمه Free Services در دسکتاپ */
    }
    
    /* کاهش فاصله بین دکمه Free Services و Top */
    .bottom-bar-container {
        gap: 30px; /* کاهش فاصله بین همه آیتم‌ها در دسکتاپ */
    }
    
    /* فاصله ویژه بین Free Services و Top */
    .bottom-bar-item.special-item + .bottom-bar-item.scroll-top-btn {
        margin-left: -20px; /* کاهش بیشتر فاصله بین Free Services و Top */
    }
}

.bottom-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    /* Was rgba(255,255,255,.7), which measures 3.25:1 on this bar. The label
       under each icon is the only thing telling you what the icon is. */
    color: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    position: relative;
    min-width: 70px;
    border-radius: 12px;
    overflow: hidden;
}

.bottom-bar-item:hover {
    color: white;
    transform: translateY(-8px);
}

.bottom-bar-item:active {
    transform: translateY(-4px);
}

/* آیکون‌های نوار پایین */
.bottom-bar-item .icon-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 6px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.bottom-bar-item i {
    font-size: 24px;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.bottom-bar-item span {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    opacity: 1;
}

/* افکت گلو برای آیکون‌ها */
.icon-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    opacity: 0;
    z-index: 1;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.bottom-bar-item:hover .icon-glow {
    width: 45px;
    height: 45px;
    opacity: 1;
}

/* نشانگر فعال بودن آیتم */
.active-indicator {
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 20px;
    height: 3px;
    border-radius: 3px;
    background: white;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.bottom-bar-item.active .active-indicator {
    transform: translateX(-50%) scaleX(1);
}

/* استایل دکمه TelJoiner (اصلی) */
.bottom-bar-item.primary-item {
    color: white;
}

.bottom-bar-item.primary-item .icon-wrapper {
    background: linear-gradient(135deg, rgba(6, 106, 201, 0.2) 0%, rgba(6, 106, 201, 0) 80%);
}

.bottom-bar-item.primary-item i {
    color: #066ac9;
    text-shadow: 0 0 10px rgba(6, 106, 201, 0.7);
}

.bottom-bar-item.primary-item span {
    font-weight: 600;
    color: #1fa4ff;   /* was #066ac9 - 3.3:1 on the bar */
}

.bottom-bar-item.primary-item .active-indicator {
    background: #066ac9;
    box-shadow: 0 0 10px #066ac9;
}

.bottom-bar-item.primary-item:hover .icon-wrapper {
    background: linear-gradient(135deg, rgba(6, 106, 201, 0.3) 0%, rgba(6, 106, 201, 0.1) 80%);
    box-shadow: 0 0 15px rgba(6, 106, 201, 0.3);
}

/* استایل دکمه Telegram */
.bottom-bar-item.telegram-item .icon-wrapper {
    background: linear-gradient(135deg, rgba(0, 136, 204, 0.2) 0%, rgba(0, 136, 204, 0) 80%);
}

.bottom-bar-item.telegram-item i {
    color: #0088cc;
    text-shadow: 0 0 10px rgba(0, 136, 204, 0.7);
}

.bottom-bar-item.telegram-item span {
    color: #0dafff;   /* was #0088cc - 3.3:1 on the bar */
}

.bottom-bar-item.telegram-item .active-indicator {
    background: #0088cc;
    box-shadow: 0 0 10px #0088cc;
}

.bottom-bar-item.telegram-item:hover .icon-wrapper {
    background: linear-gradient(135deg, rgba(0, 136, 204, 0.3) 0%, rgba(0, 136, 204, 0.1) 80%);
    box-shadow: 0 0 15px rgba(0, 136, 204, 0.3);
}

/* استایل دکمه Free Services (ویژه) */
.bottom-bar-item.special-item .icon-wrapper {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.2) 0%, rgba(40, 167, 69, 0) 80%);
}

.bottom-bar-item.special-item i {
    color: #28a745;
    text-shadow: 0 0 10px rgba(40, 167, 69, 0.7);
}

.bottom-bar-item.special-item span {
    font-weight: 600;
    color: #2eb54d;   /* was #28a745 - 4.0:1 on the bar */
}

.bottom-bar-item.special-item .active-indicator {
    background: #28a745;
    box-shadow: 0 0 10px #28a745;
}

.bottom-bar-item.special-item:hover .icon-wrapper {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.3) 0%, rgba(40, 167, 69, 0.1) 80%);
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.3);
}

/* افکت پالس برای دکمه ویژه */
.pulse-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(40, 167, 69, 0.4);
    opacity: 0;
    z-index: 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0.7;
    }
    70% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0;
    }
}

/* افکت فعال شدن دکمه اسکرول */
.bottom-bar-item.scroll-top-btn.active-scroll .icon-wrapper {
    animation: bounce 1s ease;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-15px);}
    60% {transform: translateY(-7px);}
}

/* استایل دکمه اسکرول به بالا */
.bottom-bar-item.scroll-top-btn {
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1001; /* z-index بالاتر برای قرار گرفتن روی کریسپ */
    margin-left: -10px; /* کاهش فاصله از آیتم قبلی - نزدیکتر به دکمه Free Services */
    margin-right: 0; /* حذف margin-right قبلی */
}

.bottom-bar-item.scroll-top-btn .icon-wrapper {
    width: 35px; /* کاهش اندازه آیکون */
    height: 35px;
    margin-bottom: 3px;
}

.bottom-bar-item.scroll-top-btn span {
    font-size: 10px; /* کاهش اندازه متن */
}

.bottom-bar-item.scroll-top-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* استایل و موقعیت دکمه اصلی کریسپ */
.crisp-client .cc-1iet {
    bottom: 70px !important; /* قرار دادن دکمه بالاتر از نوار پایین */
    margin-bottom: 8px !important; /* فاصله از پایین */
    z-index: 1001 !important; /* اطمینان از نمایش بالاتر از نوار پایین */
    right: 20px !important; /* فاصله از سمت راست - ایجاد فضا برای دکمه Top */
    transition: all 0.3s ease !important;
}

/* تنظیم موقعیت پنجره چت نسبت به نوار پایین */
.crisp-client .cc-7doi {
    bottom: 140px !important; /* فاصله پنجره چت از پایین صفحه */
    right: 20px !important; /* فاصله از سمت راست - متناسب با دکمه */
}

/* افکت ظاهر شدن تدریجی برای دکمه کریسپ */
.crisp-client .cc-1iet {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards 1s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* تنظیمات واکنش‌گرا */
@media (max-width: 767.98px) {
    .bottom-bar {
        height: 55px;
    }
    
    .bottom-bar-container {
        justify-content: flex-start; /* تراز کردن آیتم‌ها به سمت چپ در موبایل */
        gap: 15px; /* کاهش فاصله بین آیتم‌ها در موبایل */
        padding: 0 15px;
        padding-left: 10px; /* کاهش فاصله از سمت چپ برای هل دادن همه آیتم‌ها به چپ */
        padding-right: 80px !important; /* افزایش فاصله از سمت راست برای ایجاد فضای کافی برای کریسپ */
        overflow-x: visible; /* حذف اسکرول افقی */
    }
    
    .bottom-bar-item {
        min-width: 55px; /* کاهش عرض آیتم‌ها برای فشرده‌تر شدن */
    }
    
    .bottom-bar-item .icon-wrapper {
        width: 30px; /* کاهش اندازه آیکون‌ها */
        height: 30px;
        margin-bottom: 3px;
    }
    
    .bottom-bar-item i {
        font-size: 18px; /* کاهش اندازه آیکون */
    }
    
    .bottom-bar-item span {
        font-size: 9px; /* کاهش اندازه متن */
    }
    
    .bottom-bar-item:hover {
        transform: translateY(-5px);
    }
    
    .crisp-client .cc-7doi {
        bottom: 65px !important;
    }
    
    .crisp-client .cc-1iet,
    .crisp-client .cc-d73fc {
        right: 15px !important; /* افزایش فاصله از سمت راست در موبایل */
        margin-bottom: 6px !important;
        bottom: 65px !important; /* قرار دادن بالاتر از نوار پایین */
    }
    
    /* حذف margin-right از آخرین آیتم */
    .bottom-bar-item:last-child {
        margin-right: 0;
    }
    
    /* اطمینان از فاصله کافی بین دکمه اسکرول و کریسپ */
    .bottom-bar-item.scroll-top-btn {
        margin-left: -10px; /* افزایش فاصله منفی برای حرکت به سمت چپ */
    }
    
    /* فاصله خاص بین Free Services و Top در موبایل */
    .bottom-bar-item.special-item + .bottom-bar-item.scroll-top-btn {
        margin-left: -15px; /* افزایش فاصله منفی برای حرکت به سمت چپ */
    }
}

/* برای صفحه‌های با عرض کم */
@media (max-width: 480px) {
    .bottom-bar-container {
        gap: 12px; /* کاهش فاصله بین آیتم‌ها در موبایل کوچک برای جا دادن همه آیتم‌ها */
        justify-content: flex-start; /* شروع آیکن‌ها از سمت چپ */
        padding-left: 10px; /* کاهش فاصله از سمت چپ */
        padding-right: 90px !important; /* افزایش فاصله از سمت راست برای کریسپ */
    }
    
    .bottom-bar-item {
        min-width: 48px; /* کاهش عرض حداقل برای اطمینان از جا شدن همه آیتم‌ها */
    }
    
    .bottom-bar-item span {
        font-size: 8px; /* کاهش بیشتر اندازه متن */
    }
    
    /* حذف فاصله از آخرین آیتم */
    .bottom-bar-item:last-child {
        margin-right: 0;
    }
    
    /* هل دادن بیشتر دکمه Top به سمت چپ */
    .bottom-bar-item.scroll-top-btn {
        margin-left: -18px; /* افزایش فاصله منفی برای هل دادن بیشتر به سمت چپ */
    }
    
    /* کاهش بیشتر فاصله بین Free Services و Top */
    .bottom-bar-item.special-item + .bottom-bar-item.scroll-top-btn {
        margin-left: -20px; /* افزایش فاصله منفی برای هل دادن بیشتر به سمت چپ */
    }
    
    /* تنظیم بهتر کریسپ در موبایل‌های کوچک */
    .crisp-client .cc-1iet,
    .crisp-client .cc-d73fc {
        right: 12px !important;
    }
}

/* کاهش ارتفاع منوی چسبنده */
@media (min-width: 1200px) {
  header.navbar-sticky-on {
    padding: 0;
  }
  
  header.navbar-sticky-on .navbar-brand {
    padding: 5px 0;
  }

  header.navbar-sticky-on .navbar-brand .navbar-brand-item {
    height: 15px;
  }
  
  header.navbar-sticky-on .nav-link {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
  }
}

/* اضافه کردن فاصله اضافی برای کریسپ در موبایل */
@media (max-width: 767.98px) {
    .crisp-client .cc-1iet {
        right: 15px !important;
        bottom: 65px !important;
    }
    
    .crisp-client .cc-7doi {
        right: 15px !important;
        bottom: 120px !important;
    }
    
    /* اطمینان از عدم همپوشانی دکمه کریسپ با دکمه‌های منو */
    .bottom-bar-container {
        padding-right: 90px !important; /* افزایش فضای کافی برای دکمه کریسپ */
    }
    
    /* تغییر فاصله برای صفحه‌های خیلی کوچک */
    @media (max-width: 360px) {
        .bottom-bar-container {
            gap: 10px; /* کاهش بیشتر فاصله در موبایل‌های کوچک */
            padding-right: 100px !important; /* افزایش بیشتر فاصله برای کریسپ */
        }
        
        .bottom-bar-item.scroll-top-btn {
            margin-left: -20px; /* هل دادن بیشتر به سمت چپ در موبایل‌های کوچک */
        }
        
        .bottom-bar-item.special-item + .bottom-bar-item.scroll-top-btn {
            margin-left: -25px; /* فاصله منفی بیشتر در موبایل‌های کوچک */
        }
        
        .bottom-bar-item {
            min-width: 45px; /* کاهش بیشتر عرض در موبایل‌های کوچک */
        }
    }
}