/* static/css/base_style.css */

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
    background: #ffffff;
    height: 100%;       /* ارتفاع کل صفحه را می‌گیریم */
    overflow: hidden;    /* اسکرول اصلی بدنه را کاملاً حذف می‌کنیم */
    display: flex;
    flex-direction: column;
    font-family: 'Vazir' !important;
}
body, p, span, label, form {
    margin: 0;
    padding: 0;
    direction: rtl;
    text-align: right;
}

.header-base, .footer {
    flex-shrink: 0;      /* اجازه نمی‌دهیم هدر و فوتر فشرده شوند */
    width: 100%;
    position: relative;
    z-index: 1001;
}

.main-content-wrapper {
    flex-grow: 1;        /* تمام فضای باقی‌مانده را پر می‌کند */
    overflow-y: auto;    /* فقط این بخش اجازه اسکرول دارد */
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* اسکرول نرم در آیفون */
    position: relative;
    z-index: 1;
    scrollbar-gutter: stable;
}
    /* ======================================================== هدر---------- */
.header-base {
    height: 60px;
    background: #1b2e28;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
    border-bottom: 1px solid #0d7900;
    top: 0px;
    left: 0px;
    transition: all 0.3s ease;
}
    /* ======================================================== فوتر---------- */
.footer {
    height: 150px;
    background: #1b2e28;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    box-sizing: border-box;
    border-top: 1px solid #0d7900;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.15);
    bottom: 0px;
    right: 0px;
    transition: all 0.3s ease;
}
    /* ======================================================== چپ---------- */
.left {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 20px !important;
    left: 20%;
    /* transform: translateX(calc(-70% - 25px)); */
}
.btn-add { 
    background: #008000; 
    padding: 10px 10px; 
    border-radius: 15px; 
    color: #fff; 
    cursor: pointer; 
    font-size: 16px; 
    white-space: nowrap; 
    box-shadow: 0 4px 4px rgba(0,0,0,0.1);
}
.btn-add:hover {
    background: #0b5200;
    transform: translateY(-1px);
}
.manager-menu-item { 
    position: relative;
    color: #e8f5e4; 
    font-size: 16px; 
    cursor: pointer; 
     
}
.dropdown { 
    position: absolute; 
    display: none;
    min-width: 250px;
    width: max-content;
    top: calc(100% + 15px); 
    right: -90px; 
    background: #fff; 
    border: 1px solid #ddd; 
    border-radius: 0 0 15px 15px; /*11*/
    box-shadow: 0 4px 10px rgba(0,0,0,.1); 
    z-index: 100; 
}
.dropdown-item { 
    padding: 10px; 
    cursor: pointer; 
    color: #444; 
    font-size: 14px; 
    transition: all .3s ease; 
}
.dropdown-item:hover { 
    background: #f0f0f0; 
    border-radius: 15px; 
}
.manager-menu-item.active .dropdown { 
    display: flex; 
    flex-direction: column; 
}
    /* ======================================================== وسط (سرچ + موقعیت ترکیب‌شده)---------- */
.center { 
    position: absolute; 
    display: flex;
    align-items: center; 
    left: 50%; 
    transform: translateX(-50%);
    background: #ffffff;
    border: 1px solid #008000;
    border-radius: 15px;
    height: 38px;
    box-sizing: border-box;
}
.search-box { 
    background: transparent; 
    padding: 5px 18px; 
    border-radius: 15px 0 0 15px;
    border: none;
    display: flex; 
    align-items: center; 
    gap: 10px; 
    height: 100%;
    min-width: 260px; 
    color: #555;
    position: relative;
    box-sizing: border-box;
}
.search-box input {
    border: none; 
    background: transparent; 
    outline: none; 
    padding-left:  30px !important;
    padding-right: 5px !important;
    font-size: 16px; 
    width: 200px; 
    direction: rtl !important;
    text-align: right;
    flex: 1; /* برای پر کردن فضای موجود */
}
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    height: 100%;
}
.clear-search-btn {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 4px; /* در سمت چپ جعبه، داخل input-wrapper */
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    opacity: 0; /* ابتدا مخفی */
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.clear-search-btn.visible {
    opacity: 1;
    visibility: visible;
}

.clear-search-btn:hover {
    color: #333;
    transform: translateY(-50%) scale(1.1);
}
    /* ======================================================== تاریخچه جستجو---------- */
.search-history-dropdown {
    position: absolute;
    top: 32px;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f9f9f9;
    font-size: 14px;
    color: #333;
}

.history-item:hover {
    background-color: #f5f5f5;
}

.history-text {
    flex-grow: 1;
    text-align: right;
}

.delete-history-btn {
    color: #999;
    font-size: 26px;
    padding: 0 0;
    cursor: pointer;
    line-height: 2;
}

.delete-history-btn:hover {
    color: #333;
}
    /* ======================================================== ---------- */
.right {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 60px;
    left: 75%;
    /* transform: translateX(calc(-30% - 60px + 50px)); */
}
.category-menu-item { 
    position:relative;
    color:#e8f5e4; 
    font-size:16px; 
    cursor:pointer; 
}
    /* منوی موقعیت به‌عنوان بخش دوم pill سرچ (هدر دسکتاپ و موبایل) */
#locationMenu.category-menu-item {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 100%;
    padding: 0 18px;
    color: #333;
    font-size: 14px;
    white-space: nowrap;
    border-right: 1px solid #e0e0e0;
    border-radius: 100px 0 0 100px;
    box-sizing: border-box;
}

.location-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
}
    /* حذف خط سبز و فلش قدیمی مخصوص منوی موقعیت (برای سایر منوها دست‌نخورده می‌ماند) */
#locationMenu.category-menu-item:hover::after {
    content: none;
}
#locationMenu.category-menu-item .arrow {
    display: none;
}
.category-dropdown {
    position: absolute;
    display: none;
    flex-direction: column;
    width: 220px;
    max-height: 400px;
    top: calc(100% + 25px);
    right: 0;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 999;
    padding: 0;
    box-sizing: border-box;
}
.category-menu-item.active .category-dropdown,
.category-menu-item.active .location-dropdown {
    display: flex;
    flex-direction: column;
}
.category-dropdown-item,
.location-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #444;
    border-radius: 15px;
    transition: all 0.3s ease;
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
    border: none !important;
}
.category-dropdown-item:hover,
.location-dropdown-item:hover {
    background: #f0f0f0;
}
.location-dropdown {
    position: absolute;
    display: none;
    flex-direction: column;
    width: 220px;
    max-height: 400px;
    top: calc(100% + 12px);
    right: -50px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 9999;
    padding: 0;
    box-sizing: border-box;
}
.location-dropdown-items {
    flex: 1;
    max-height: 330px;
    overflow-y: auto;
    padding: 8px;
    box-sizing: border-box;
}
.location-dropdown-items input[type="checkbox"],
.category-dropdown input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #0d7900;
}
.category-dropdown-buttons {
    display: flex;
    justify-content: space-between;
    border-radius: 15px;
    padding: 10px;
    border-top: 1px solid #ddd;
    background: #f8f8f8;
    position: sticky;   /* چسبیدن به پایین کانتینر والد */
    bottom: 0;
    gap: 10px;
    box-sizing: border-box;
}
.category-dropdown-buttons button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 15px;
    font-size: 14px;
    transition: all 0.2s ease;
    font-family: 'Vazir';
}
#confirmcategory { 
    background:#008000; 
    color:#fff; 
    cursor:pointer; 
    border: none;
}
#confirmcategory:hover { 
    background:#0b5200; 
}
#cancelcategory { 
    background:#fff; 
    color:#333; 
    cursor:pointer;
    border-style: solid;
    border-width: 1px;
    border-color: #008000;
}
#cancelcategory:hover { 
    background:#bbb; 
}
.location-dropdown-buttons {
    display: flex;
    justify-content: space-between;
    border-radius: 15px;
    padding: 10px;
    border-top: 1px solid #ddd;
    background: #f8f8f8;
    position: sticky;   /* چسبیدن به پایین کانتینر والد */
    bottom: 0;
    gap: 10px;
    box-sizing: border-box;
}
.location-dropdown-buttons button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 15px;
    font-size: 14px;
    transition: all 0.2s ease;
    font-family: 'Vazir';
}
#confirmLocation { 
    background:#008000; 
    color:#fff; 
    cursor:pointer; 
    border: none;
}
#confirmLocation:hover { 
    background:#0b5200; 
}
#cancelLocation { 
    background:#fff; 
    color:#333; 
    cursor:pointer;
    border-style: solid;
    border-width: 1px;
    border-color: #008000;
}
#cancelLocation:hover { 
    background:#bbb; 
}
.category-menu-item,
#locationMenu,#managerMenu {
    position: relative;
    padding-bottom: 4px; /* کمی فاصله برای خط */
    transition: color .25s ease;
}
    /* ======================================================== خط سبز زیر منو ها---------- */
.category-menu-item:hover::after,
#locationMenu:hover::after,
#managerMenu:hover::after {
    content: "";
    position:absolute;
    bottom: -10px;
    right: 0;
    width: 100%;
    height: 3px;
    background: #008000;
    border-radius: 15px;
}
    /* ======================================================== ورود---------- */

hr {
    border: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, #ccc, transparent);
    margin: 10px 0 10px 0;
}

label {
    font-size: 14px;
    color: #333;
}
    /* ======================================================== خروج---------- */
.logout-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 102;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.1),
        0 1px 3px rgba(0, 0, 0, 0.08),
        inset 0 0 0 1px rgba(255, 255, 255, 0.7),
        inset 0 8px 12px rgba(255, 255, 255, 0.5);
}
.logout-popup {
    background: #fff;
    width: 320px;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: popupShow .35s ease-out;
}
.btn-row {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.cancel-btn {
    flex: 1;
    padding: 10px;
    background: #008000;
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    font-family: 'Vazir';
}
.cancel-btn:hover {
    background: #0b5200;
}
.logout-btn {
    flex: 1;
    padding: 10px;
    background: #fff;
    color:black;
    border-radius: 15px;
    border-style: solid;
    border-width: 1px;
    border-color: #008000;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    font-family: 'Vazir';
}
.logout-btn:hover {
    background: #bbb;
}
    /* ======================================================== فلش منو ها---------- */
.arrow {
    display: inline-block;
    border: solid #9fb8ac;
    border-width: 0 2px 2px 0;
    padding: 3px;
    margin-right: 4px;
    transform: rotate(45deg);
    transition: transform 0.25s ease;
}
.category-menu-item.active .arrow,
#locationMenu.active .arrow,
.manager-menu-item.active .arrow {
    transform: rotate(-135deg);
}
    /* ========================================================انیمیشن نمایش پاپ آپ---------- */
/* انیمیشن باز شدن */
@keyframes popupShow {
    from { transform: translateY(100vh); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
/* انیمیشن بسته شدن */
@keyframes popupHide {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(100vh); opacity: 0; }
}
/* کلاس‌های کنترل انیمیشن پاپ‌آپ‌های موبایل */
.mobile-popup-container.show-popup {
    animation: popupShow 0.25s ease forwards;
}

.mobile-popup-container.hide-popup {
    animation: popupHide 0.25s ease forwards;
}
    /* ======================================================== تنظیمات مربوط به فوتر در دسکتاپ  ---------- */
    /* متن کپی‌رایت در فوتر دسکتاپ */
.desktop-footer {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 20px;
    font-size: 14px;
    color: #cfe8c8;
    text-align: center;
}
    /* منوی موبایل در فوتر */
.mobile-nav {
    display: none;
    width: 100%;
}
.mobile-logo {
    display: none;
}
    /* ======================================================== تنظیمات مربوط به پاپ آپ منو ها در موبایل  ---------- */
.mobile-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 60px;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 1500;
    padding: 20px;
}
.mobile-popup-container {
    background: #fff;
    border-radius: 0;
    width: 100%;
    max-height: 80vh !important;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transform: translateY(100vh);
}
.popup-closing {
    animation: popupHide 0.3s ease-in forwards;
}
.mobile-popup-header-base,
.mobile-popup-header {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px !important;
    background: #1b2e28;
    border-bottom: 1px solid #0d7900;
    box-sizing: border-box;
    width: 100%;
}
.mobile-popup-header-base h3,
.mobile-popup-header h3 {
    margin: 0;
    color: #e8f5e4;
    font-size: 18px;
    flex: 1 1 auto;
    text-align: right;
}
.mobile-popup-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #e8f5e4;
    cursor: pointer;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}
.mobile-popup-close:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.mobile-popup-content {
    padding: 10px 0;
    max-height: 40vh !important;
    overflow-y: auto;
}
.mobile-popup-content .dropdown-item {
    display: block;
    padding: 10px 20px;
    color: #444;
    font-size: 16px;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s;
}
.mobile-popup-content .dropdown-item:last-child {
    border-bottom: none;
}
.mobile-popup-content .dropdown-item:hover {
    background: #f0f0f0;
    color: #000;
}
    /* استایل‌های مخصوص محتوای داخل پاپ‌آپ */
.mobile-popup-content .category-dropdown-item,
.mobile-popup-content .location-dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #444;
    font-size: 16px;
    border-bottom: 1px solid #f0f0f0;
}
.mobile-popup-content .category-dropdown-item:last-child,
.mobile-popup-content .location-dropdown-item:last-child {
    border-bottom: none;
}
.mobile-popup-content .location-dropdown-buttons,
.mobile-popup-content .category-dropdown-buttons {
    display: flex;
    justify-content: space-between;
    padding: 5px 5px;
    border-top: 1px solid #ddd;
    background: #ffffff;
    gap: 10px;
    
}
.mobile-popup-content .location-dropdown-buttons button,
.mobile-popup-content .category-dropdown-buttons button{
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 15px;
    font-size: 14px;
    transition: all 0.2s;
    font-family: 'Vazir'
}
.mobile-popup-content #confirmLocation {
    background: #008000;
    color: #fff;
    cursor: pointer;
}
.mobile-popup-content #confirmLocation:hover {
    background: #0b5200;
}
.mobile-popup-content #cancelLocation {
    background: #ccc;
    color: #333;
    cursor: pointer;
}
.mobile-popup-content #cancelLocation:hover {
    background: #bbb;
}
    /* ======================================================== badge ---------- */
.badge-link{
    position: relative;
}

.dot-badge{
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 1px;
    width: 8px;
    height: 8px;
    background: #ff3b30;
    border-radius: 50%;
}




.mobile-popup-actions{
    display: flex;
    justify-content: space-between;
    border-radius: 15px;
    padding: 10px;
    border-top: 1px solid #ddd;
    background: #f8f8f8;
    position: sticky;
    bottom: 0;
    gap: 10px;
    box-sizing: border-box;
}
.mobile-popup-actions button{
    flex: 1;
    padding: 8px;
    border-radius: 15px;
    font-size: 14px;
    transition: all 0.2s ease;
    font-family: 'Vazir';
}
.mobile-confirm-category{
    background:#008000; 
    color:#fff; 
    cursor:pointer; 
    border: none;
}
.mobile-cancel-category{
    background:#ccc; 
    color:#333; 
    cursor:pointer;
    border-style: solid;
    border-width: 1px;
    border-color: #008000;
}
.mobile-confirm-category:hover { 
    background:#0b5200; 
}

.mobile-cancel-category:hover { 
    background:#bbb; 
}



.mobile-confirm-location{
    background:#008000; 
    color:#fff; 
    cursor:pointer; 
    border: none;
}
.mobile-cancel-location{
    background:#ccc; 
    color:#333; 
    cursor:pointer;
    border-style: solid;
    border-width: 1px;
    border-color: #008000;
}
.mobile-confirm-location:hover { 
    background:#0b5200; 
}

.mobile-cancel-location:hover { 
    background:#bbb; 
}


/* فقط پاپ‌آپ موقعیت */
#mobileLocationPopup .mobile-popup-container{
  max-height: 85vh;
}

#mobileLocationPopup .mobile-popup-content{
  max-height: 60vh;
  overflow-y: auto;
}


    /* ======================================================== تنظیمات مربوط به هدر و فوتر در موبایل  ---------- */
@media (max-width: 768px) {
        /* ---------- هدر در موبایل ---------- */
    .header-base {
        width: 100%;
        height: 60px;
        padding: 0 15px;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        position: relative;
    }

        /* مخفی کردن راست (لوگو/جرس) و چپ (مدیریت/ثبت‌آگهی) در هدر موبایل */
    .header-base > .right,
    .header-base > .left,
    .header-base > .mobile-logo {
        display: none !important;
    }

        /* center دیگر absolute نیست، pill سفید کل عرض هدر را می‌گیرد */
    .header-base > .center {
        position: static;
        left: auto;
        right: auto;
        top: auto;
        transform: none;
        width: 100%;
        height: 42px;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        box-sizing: border-box;
    }

        /* سرچ‌باکس عرض باقیمانده را پر می‌کند */
    .header-base > .center > .search-box {
        order: 1;
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        max-width: none;
        margin: 0;
        padding: 5px 14px;
        box-sizing: border-box;
    }
    .search-box input {
        width: 100%;
        padding-right: 5px !important;
        padding-left: 26px !important;
    }
    .clear-search-btn {
        width: 22px;
        height: 22px;
        top: 50% !important;
        left: 2px !important;
        transform: translateY(-50%) !important;
        font-size: 26px;
    }
        /* ======================================================== تاریخچه جستجو---------- */
    .search-history-dropdown {
        top: 36px;
    }

        /* منوی موقعیت کنار سرچ‌باکس، عرض ثابت به‌اندازه محتوا */
    .header-base > .center > #locationMenu.category-menu-item {
        order: 2;
        flex: 0 0 auto;
        width: auto;
        margin: 0;
        padding: 0 14px;
        box-sizing: border-box;
        white-space: nowrap;
        color: #333;
        font-size: 13px;
    }

        /* دراپ‌داون موقعیت در موبایل: به‌جای باز شدن نسبت به لبه راست منو (که از صفحه بیرون می‌زند)،
           نسبت به کل هدر موقعیت می‌گیرد و عرض مناسب صفحه را می‌گیرد */
    .header-base > .center > #locationMenu.category-menu-item .location-dropdown {
        position: fixed;
        top: 60px;
        left: 0px;
        right: 0px;
        width: 100%;
        max-width: none;
        max-height: 50vh;
        border-radius: 0;
    }
    .header-base > .center > #locationMenu.category-menu-item .location-dropdown-items {
        max-height: calc(50vh - 60px);
    }

        /* ---------- فوتر در موبایل ---------- */
    .footer {
        bottom: 0;
        justify-content: center;
        padding: 8px 15px;
        height: 60px;
    }
        /* مخفی کردن متن کپی‌رایت در موبایل */
    .desktop-footer {
        display: none !important;
    }
        /* نمایش منوی موبایل در فوتر - ترتیب راست‌به‌چپ: جرس > نشان‌ها > ثبت‌آگهی > چت > مدیریت */
    .mobile-nav {
        display: flex !important;
        flex-direction: row;
        direction: rtl;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        font-size: 14px;
    }
        /* لوگوی کوچک سمت راست فوتر موبایل، هم‌ردیف با آیتم‌ها */
    #logoLink_mobile {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    #logoLink_mobile img {
        height: 15px;
        width: auto;
        filter: brightness(0) invert(1);
    }

    .btn-add.nav-item {
        background: none; 
        font-size: 14px; 
        box-shadow: none; 
        padding: 5px 8px; 
    }

        /* پاپ‌آپ‌های موبایل */
    .mobile-popup-overlay {
        padding: 0px;
        z-index: 999;
    }
    .mobile-popup-container {
        border-radius: 15px 15px 0 0;
        max-height: 60vh;
        box-shadow: 0 -5px 30px rgba(0,0,0,0.2);
    }
    .mobile-popup-content {
        max-height: 60vh;
    }
        /* بهبود نمایش در موبایل‌های کوچک‌تر */
    .mobile-popup-header {
        padding: 12px 15px;
    }
    .mobile-popup-header h3 {
        font-size: 16px;
    }
    .mobile-popup-close {
        font-size: 36px;
        width: 35px;
        height: 35px;
    }

    .mobile-popup-content .dropdown-item,
    .mobile-popup-content .category-dropdown-item,
    .mobile-popup-content .location-dropdown-item {
        padding: 12px 15px;
        font-size: 14px;
    }

    .logout-overlay {
        z-index: 2000; /* بیشتر از پاپ‌آپ‌های موبایل */
        top: 0; left: 0; right: 0; bottom: 0;
        align-items: flex-end;
    }
    .logout-popup {
        border-radius: 15px 15px 0 0;
        box-shadow: 0 -5px 30px rgba(0,0,0,0.2);
        width: 100%;
    }

        /* ---------- آیکن‌های فوتر موبایل ---------- */
    .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 5px 8px;
        border-radius: 5px;
        transition: all 0.2s ease;
        text-align: center;
    }
    .nav-icon {
        width: 24px;
        height: 24px;
        margin-bottom: 4px;
        object-fit: contain;
        filter: brightness(0) invert(1) opacity(0.75);
        transition: filter 0.2s ease;
    }
    .nav-item span {
        font-size: 11px;
        color: #e8f5e4;
        font-weight: 500;
    }
    .nav-item:hover {
        background-color: rgba(255,255,255,0.08);
    }
    .nav-item:hover .nav-icon {
        filter: brightness(0) invert(1) opacity(1);
    }
        /* استایل مخصوص آیتم ثبت آگهی (همیشه سبز روشن) */
    /* .btn-add.nav-item .nav-icon {
        filter: brightness(0) saturate(100%) invert(64%) sepia(78%) saturate(429%) hue-rotate(70deg) brightness(97%) contrast(92%);
    } */
    /* .btn-add.nav-item span {
        color: #3ddc4a;
    } */
        /* آیتم مدیریت */
    #mmanagerMenu.nav-item .nav-icon {
        filter: brightness(0) invert(1) opacity(0.75);
    }

        /* ================== افکت رنگ سبز روی آیکن‌های فوتر موبایل با کلیک ================== */
        /* ۱) لحظه فشردن انگشت (خالص CSS، برای همه آیتم‌ها به‌جز لوگوی جرس) */
    .mobile-nav .nav-item:not(.btn-add):active .nav-icon {
        filter: brightness(0) saturate(100%) invert(64%) sepia(78%) saturate(429%) hue-rotate(70deg) brightness(97%) contrast(92%);
    }
    .mobile-nav .nav-item:not(.btn-add):active span {
        color: #3ddc4a;
    }

        /* ۲) حالت پایدار: وقتی پاپ‌آپ/منو باز است یا کاربر در همان صفحه است */
        /* برای «مدیریت»: کلاس active توسط جاوااسکریپت شما هنگام باز شدن پاپ‌آپ اضافه می‌شود */
    #mmanagerMenu.nav-item.active .nav-icon,
        /* برای نشان‌ها / چت: کلاس current باید در تمپلیت Django بر اساس URL فعلی اضافه شود */
    .mobile-nav .nav-item.current .nav-icon {
        filter: brightness(0) saturate(100%) invert(64%) sepia(78%) saturate(429%) hue-rotate(70deg) brightness(97%) contrast(92%);
    }
    #mmanagerMenu.nav-item.active span,
    .mobile-nav .nav-item.current span {
        color: #3ddc4a;
    }

    .nav-chat, 
    .nav-tags {
        display: none !important;
    }
}
