/* ═══════════════════════════════════════════════════════════════
   Bottom Navigation — منوی اپلیکیشنی پایین صفحه
   ═══════════════════════════════════════════════════════════════ */

.mbs-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
    padding-bottom: env(safe-area-inset-bottom, 0);
    display: none; /* در دسکتاپ مخفی */
}

/* فقط در موبایل نمایش */
@media (max-width: 768px) {
    .mbs-bottom-nav {
        display: block;
    }
}

.mbs-bottom-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-around;
    max-width: 600px;
    margin: 0 auto;
    padding: 6px 4px;
    direction: rtl;
}

/* هر آیتم */
.mbs-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    text-decoration: none;
    color: #6b7280;
    transition: all 0.2s ease;
    position: relative;
    border-radius: 12px;
    min-width: 0;
}

.mbs-nav-item:active {
    transform: scale(0.95);
}

.mbs-nav-item.is-active {
    color: #3548a0;
}

.mbs-nav-item__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    position: relative;
}

.mbs-nav-item__icon svg {
    width: 24px;
    height: 24px;
    transition: all 0.2s ease;
}

.mbs-nav-item__label {
    font-size: 10.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.2;
}

/* آیتم برجسته وسط */
.mbs-nav-item--center {
    position: relative;
    color: #3548a0;
}

.mbs-nav-item--center .mbs-nav-item__icon--center {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3548a0, #4f5fe0);
    color: #fff;
    box-shadow: 0 6px 16px rgba(53, 72, 160, 0.4);
    transform: translateY(-14px);
    border: 4px solid #ffffff;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mbs-nav-item--center.is-active .mbs-nav-item__icon--center {
    background: linear-gradient(135deg, #4f5fe0, #6b7bff);
    box-shadow: 0 8px 22px rgba(53, 72, 160, 0.55);
}

.mbs-nav-item--center .mbs-nav-item__icon--center svg {
    width: 26px;
    height: 26px;
}

.mbs-nav-item--center .mbs-nav-item__label {
    margin-top: -10px;
    font-weight: 800;
    color: #3548a0;
}

/* نقطه پخش زنده */
.mbs-nav-live-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid #fff;
    animation: mbsPulse 1.5s infinite;
}

@keyframes mbsPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.15); }
}

/* نشان "به‌زودی" */
.mbs-nav-item--soon {
    opacity: 0.55;
    cursor: not-allowed;
}

.mbs-nav-item__soon-badge {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    font-size: 8px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 100px;
    white-space: nowrap;
    border: 1.5px solid #fff;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}

/* ═══════════════════════════════════════════════════════════════
   Mini Live Player — مینی مدال پخش زنده
   ═══════════════════════════════════════════════════════════════ */

.mbs-mini-live {
    position: fixed;
    bottom: 78px;
    left: 12px;
    right: 12px;
    z-index: 9998;
    background: linear-gradient(135deg, #1e1b4b, #3548a0);
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(30, 27, 75, 0.35);
    color: #fff;
    cursor: pointer;
    animation: mbsSlideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    max-width: 600px;
    margin: 0 auto;
    direction: rtl;
}

@keyframes mbsSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.mbs-mini-live__thumb {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.mbs-mini-live__pulse {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.5), transparent 70%);
    animation: mbsPulse 1.5s infinite;
}

.mbs-mini-live__badge {
    position: relative;
    z-index: 2;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 100px;
    white-space: nowrap;
}

.mbs-mini-live__info {
    flex: 1;
    min-width: 0;
    text-align: right;
}

.mbs-mini-live__title {
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mbs-mini-live__subtitle {
    font-size: 10.5px;
    opacity: 0.75;
    margin-top: 2px;
}

.mbs-mini-live__close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.mbs-mini-live__close:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* اطمینان از اینکه محتوای صفحه با منو تداخل ندارد */
@media (max-width: 768px) {
    body {
        padding-bottom: 72px !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   Live Button — طراحی ویژه دکمه صفحه اصلی/پخش زنده
   ═══════════════════════════════════════════════════════════════ */

/* پایه دکمه */
.mbs-nav-item--center {
    position: relative;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mbs-nav-item__icon--center {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* آیکون‌ها - transition نرم */
.mbs-nav-home-icon,
.mbs-nav-live-icon {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ═══════════════════════════════════════════════════════════════
   حالت LIVE فعال — طراحی ویژه قرمز
   ═══════════════════════════════════════════════════════════════ */

.mbs-nav-item--center.is-live {
    transform: translateY(-2px) scale(1.05);
}

/* دایره پشت دکمه — پالس قرمز */
.mbs-nav-item--center.is-live .mbs-nav-item__icon--center::before {
    content: '';
    position: absolute;
    inset: -8px;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.3), transparent 70%);
    border-radius: 50%;
    animation: mbs-live-btn-pulse 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes mbs-live-btn-pulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50%      { transform: scale(1.3); opacity: 0.3; }
}

/* دکمه قرمز */
.mbs-nav-item--center.is-live {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #b91c1c 100%);
    border-radius: 50%;
    padding: 6px;
    box-shadow:
        0 0 0 3px rgba(239, 68, 68, 0.15),
        0 4px 12px rgba(239, 68, 68, 0.4),
        0 0 20px rgba(239, 68, 68, 0.3);
    animation: mbs-live-btn-glow 2s ease-in-out infinite;
}

@keyframes mbs-live-btn-glow {
    0%, 100% {
        box-shadow:
            0 0 0 3px rgba(239, 68, 68, 0.15),
            0 4px 12px rgba(239, 68, 68, 0.4),
            0 0 20px rgba(239, 68, 68, 0.3);
    }
    50% {
        box-shadow:
            0 0 0 6px rgba(239, 68, 68, 0.25),
            0 6px 18px rgba(239, 68, 68, 0.6),
            0 0 30px rgba(239, 68, 68, 0.5);
    }
}

/* آیکون‌های داخل دکمه LIVE */
.mbs-nav-item--center.is-live .mbs-nav-item__icon svg {
    color: #fff;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: mbs-live-icon-bounce 0.6s ease-out;
}

@keyframes mbs-live-icon-bounce {
    0%   { transform: scale(0.5) rotate(-20deg); }
    60%  { transform: scale(1.15) rotate(5deg); }
    100% { transform: scale(1) rotate(0); }
}

/* swap icons - خانه مخفی، live نمایش */
.mbs-nav-item--center.is-live .mbs-nav-home-icon {
    display: none;
}
.mbs-nav-item--center.is-live .mbs-nav-live-icon {
    display: block !important;
}

/* لیبل دکمه LIVE */
.mbs-nav-item--center.is-live .mbs-nav-item__label {
    color: #ef4444;
    font-weight: 900;
    text-shadow: 0 1px 2px rgba(239, 68, 68, 0.2);
}

/* متن «پخش زنده» جایگزین */
.mbs-nav-item--center.is-live #mbsNavHomeLabel::before {
    content: 'پخش زنده';
}
.mbs-nav-item--center.is-live #mbsNavHomeLabel {
    font-size: 0;
}
.mbs-nav-item--center.is-live #mbsNavHomeLabel::before {
    font-size: 11px;
}

/* نقطه زنده بزرگتر و چشمک‌زن */
.mbs-nav-item--center.is-live .mbs-nav-live-dot {
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #fff;
    border: 2px solid #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.9);
    animation: mbs-live-dot-blink 1s ease-in-out infinite;
}

@keyframes mbs-live-dot-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.5; transform: scale(0.85); }
}

/* ═══════════════════════════════════════════════════════════════
   حالت عادی (live غیرفعال)
   ═══════════════════════════════════════════════════════════════ */

.mbs-nav-item--center:not(.is-live) {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 50%;
    padding: 6px;
    box-shadow:
        0 0 0 3px rgba(59, 130, 246, 0.15),
        0 4px 12px rgba(59, 130, 246, 0.4);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mbs-nav-item--center:not(.is-live) .mbs-nav-item__icon svg {
    color: #fff;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.mbs-nav-item--center:not(.is-live) .mbs-nav-item__label {
    color: #1d4ed8;
    font-weight: 800;
}

/* هاور */
.mbs-nav-item--center:not(.is-live):hover {
    transform: translateY(-2px);
    box-shadow:
        0 0 0 5px rgba(59, 130, 246, 0.25),
        0 6px 16px rgba(59, 130, 246, 0.5);
}

.mbs-nav-item--center.is-live:hover {
    transform: translateY(-4px) scale(1.08);
}

/* ═══════════════════════════════════════════════════════════════
   ریسپانسیو
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 375px) {
    .mbs-nav-item--center.is-live {
        padding: 5px;
    }
    .mbs-nav-item--center.is-live .mbs-nav-item__icon svg {
        width: 24px;
        height: 24px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   FORCE COLOR — v25 (تضمینی)
   ═══════════════════════════════════════════════════════════════ */

/* رنگ پیش‌فرض متن و آیکن */
.mbs-bottom-nav .mbs-nav-item,
.mbs-bottom-nav .mbs-nav-item .mbs-nav-item__label,
.mbs-bottom-nav .mbs-nav-item .mbs-nav-item__icon,
.mbs-bottom-nav .mbs-nav-item .mbs-nav-item__icon svg,
.mbs-bottom-nav .mbs-nav-item .mbs-nav-item__icon svg path {
    color: #374151 !important;
    fill: #374151 !important;
}

/* آیتم فعال (آبی پررنگ) */
.mbs-bottom-nav .mbs-nav-item.is-active,
.mbs-bottom-nav .mbs-nav-item.is-active .mbs-nav-item__label,
.mbs-bottom-nav .mbs-nav-item.is-active .mbs-nav-item__icon,
.mbs-bottom-nav .mbs-nav-item.is-active .mbs-nav-item__icon svg,
.mbs-bottom-nav .mbs-nav-item.is-active .mbs-nav-item__icon svg path {
    color: #1e40af !important;
    fill: #1e40af !important;
}

/* دکمه وسط — سفید روی آبی */
.mbs-bottom-nav .mbs-nav-item--center .mbs-nav-item__icon--center,
.mbs-bottom-nav .mbs-nav-item--center .mbs-nav-item__icon--center svg,
.mbs-bottom-nav .mbs-nav-item--center .mbs-nav-item__icon--center svg path {
    color: #ffffff !important;
    fill: #ffffff !important;
}
.mbs-bottom-nav .mbs-nav-item--center .mbs-nav-item__label {
    color: #1e40af !important;
}

/* دکمه‌های "به‌زودی" (اجتماعی) */
.mbs-bottom-nav .mbs-nav-item--soon .mbs-nav-item__icon,
.mbs-bottom-nav .mbs-nav-item--soon .mbs-nav-item__icon svg,
.mbs-bottom-nav .mbs-nav-item--soon .mbs-nav-item__label {
    color: #9ca3af !important;
    fill: #9ca3af !important;
    opacity: 0.7 !important;
}
