/* ===================================================
   استایل‌های اضافی بهینه‌سازی باموسپیدان
   فارسی / RTL / عملکرد بالا
   =================================================== */

/* --- فونت وزیرمتن جایگزین --- */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;900&display=swap');

/* --- تنظیمات پایه RTL --- */
* {
    box-sizing: border-box;
}

body, html {
    direction: rtl;
    text-align: right;
}

/* --- اصلاح عملکرد برگر منو موبایل --- */
.burger-menu,
.hamburger-menu {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    transition: background 0.2s;
}
.burger-menu:hover {
    background: rgba(0,0,0,0.05);
}
.burger-menu .burger-lines,
.burger-menu span {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    transition: all 0.3s;
    margin: 4px 0;
}
.burger-menu.menu-open .burger-lines:nth-child(1),
.burger-menu.is-active .burger-lines:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}
.burger-menu.menu-open .burger-lines:nth-child(2),
.burger-menu.is-active .burger-lines:nth-child(2) {
    opacity: 0;
}
.burger-menu.menu-open .burger-lines:nth-child(3),
.burger-menu.is-active .burger-lines:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* --- منو موبایل --- */
@media (max-width: 991px) {
    .sb-menu > ul {
        display: none;
        position: relative;
        width: 100%;
        background: #fff;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        border-radius: 0 0 8px 8px;
        padding: 8px 0;
        z-index: 9999;
    }
    .sb-menu > ul li a {
        padding: 10px 16px;
        display: block;
        border-bottom: 1px solid #f5f5f5;
    }
    .sb-menu > ul li ul {
        background: #f8f9fa;
        padding-right: 16px;
    }
}

/* --- Leaflet نقشه --- */
#map,
.leaflet-map-container,
.sb-map-container {
    position: relative;
    z-index: 1;
    border-radius: 8px;
    overflow: hidden;
}
.leaflet-container {
    font-family: var(--bmp-font-body, 'Vazirmatn', Tahoma, Arial, sans-serif) !important;
}
.leaflet-popup-content {
    direction: rtl;
    text-align: right;
    font-family: var(--bmp-font-body, 'Vazirmatn', Tahoma, Arial, sans-serif);
}
.leaflet-control-zoom a {
    line-height: 26px !important;
}

/* --- آگهی‌ها: کلاس‌های مشترک --- */
.sb-ad-box {
    transition: box-shadow 0.25s, transform 0.2s;
}
.sb-ad-box .ad-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- پنل کاربری: انتقال smooth --- */
.dashboard-sidebar .nav-item a,
.dashboard-sidebar .menu-item a {
    transition: all 0.2s ease;
}

/* --- جداول ریسپانسیو --- */
.bmp-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 6px;
    border: 1px solid #eee;
}
.bmp-table-responsive table {
    min-width: 500px;
    border-collapse: collapse;
    width: 100%;
}
.bmp-table-responsive th,
.bmp-table-responsive td {
    padding: 10px 14px;
    border: 1px solid #eee;
    text-align: right;
}
.bmp-table-responsive th {
    background: #f8f9fa;
    font-weight: 600;
}

/* --- loading skeleton برای آگهی‌ها --- */
.bmp-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: bmp-skeleton-loading 1.5s infinite;
    border-radius: 4px;
}
@keyframes bmp-skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- ویجت آمار بازدید --- */
.bmp-popular-ads-list,
.bmp-popular-posts-list,
.bmp-popular-ads-shortcode {
    list-style: none;
    padding: 0;
    margin: 0;
}
.bmp-popular-ads-list li,
.bmp-popular-posts-list li,
.bmp-popular-ads-shortcode li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.bmp-popular-ads-list li:last-child,
.bmp-popular-posts-list li:last-child {
    border-bottom: none;
}
.bmp-views-count,
.bmp-views {
    color: #999;
    font-size: 12px;
    white-space: nowrap;
}

/* --- فرم‌ها و اینپوت‌ها --- */
input, textarea, select {
    font-family: var(--bmp-font-body, 'Vazirmatn', Tahoma, Arial, sans-serif) !important;
}

/* --- ریسپانسیو کلی --- */
@media (max-width: 768px) {
    .bmp-ad-layout-3 .sb-ads-grid {
        column-count: 1;
    }
    .bmp-ad-layout-2 .sb-ad-box {
        flex-direction: column;
    }
    .bmp-ad-layout-2 .sb-ad-box .ad-img {
        width: 100%;
        min-width: unset;
        max-height: 180px;
    }
}

/* --- اصلاح Elementor conflicts --- */
.elementor-widget-container {
    direction: rtl;
    text-align: right;
}

/* --- print styles --- */
@media print {
    .burger-menu,
    .bmp-admin-stats-bar,
    .sb-header,
    footer {
        display: none !important;
    }
}
