/* static/css/base_style.css */

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
    background: #e0e0e0;
    height: 100%;       /* ارتفاع کل صفحه را می‌گیریم */
    overflow: hidden;    /* اسکرول اصلی بدنه را کاملاً حذف می‌کنیم */
    display: flex;
    flex-direction: column;
    font-family: 'Tanha' !important;
}
body, p, span, label, form {
    margin: 0;
    padding: 0;
    direction: rtl;
    text-align: right;
}

.header, .footer {
    flex-shrink: 0;      /* اجازه نمی‌دهیم هدر و فوتر فشرده شوند */
    width: 100%;
    position: relative;
    z-index: 1000;
}

.main-content-wrapper {
    flex-grow: 1;        /* تمام فضای باقی‌مانده را پر می‌کند */
    overflow-y: auto;    /* فقط این بخش اجازه اسکرول دارد */
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* اسکرول نرم در آیفون */
    position: relative;
    scrollbar-gutter: stable;
}
    /* ======================================================== هدر---------- */
.header {
    height: 60px;
    background: #e2fadb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
    border-bottom: 1px solid #ddd;
    /*box-shadow: 0 4px 4px rgba(0,0,0,0.1);*/
    top: 0px;
    left: 0px;
    transition: all 0.3s ease;
}
    /* ======================================================== فوتر---------- */
.footer {
    height: 60px;
    background: #e2fadb;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    box-sizing: border-box;
    border-top: 1px solid #ddd;
    box-shadow: 0 4px 4px rgba(0,0,0,0.1)outset;
    bottom: 0px;
    right: 0px;
    transition: all 0.3s ease;
}
    /* ======================================================== چپ---------- */
.left {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 60px;
    left: 27%;
    transform: translateX(calc(-70% - 25px));
}
.btn-add { 
    background: #008000; 
    padding: 10px 10px; 
    border-radius: 100px; 
    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: #555; 
    font-size: 16px; 
    cursor: pointer; 
     
}
.dropdown { 
    position: absolute; 
    display: none;
    width: 200px;
    top: calc(100% + 25px); 
    right: 0; 
    background: #fff; 
    border: 1px solid #ddd; 
    border-radius: 15px; 
    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%); 
}
.search-box { 
    background: #ffffff; 
    padding: 5px 20px; 
    border-radius: 100px; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    height: 35px;
    min-width: 300px; 
    color: #555;
    position: relative;
    box-shadow: 
        inset 0px 0px 10px #c5c5c5,
        inset -4px -4px 10px #ffffff
}
.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; /* برای پر کردن فضای موجود */
}
.clear-search-btn {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    left: -10px; /* در سمت چپ جعبه */
    background: none;
    border: none;
    color: #999;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    opacity: 0; /* ابتدا مخفی */
    visibility: hidden;
    transition: all 0.2s ease;
}

.clear-search-btn.visible {
    opacity: 1;
    visibility: visible;
}

.clear-search-btn:hover {
    color: #333;
    transform: scale(1.1);
}
    /* ======================================================== تاریخچه جستجو---------- */
.search-history-dropdown {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0;
    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: 24px;
    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: 73%;
    transform: translateX(calc(-30% - 60px));
}
.category-menu-item { 
    position:relative;
    color:#555; 
    font-size:16px; 
    cursor:pointer; 
}
.category-dropdown {
    position: absolute;
    display: none;
    flex-direction: column;
    width: 220px;
    max-height: 400px;
    top: calc(100% + 25px);
    right: 0;
    background: #fff;
    /*border: 1px solid #ddd;*/
    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% + 25px);
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 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: 'Tanha';
}
#confirmcategory { 
    background:#008000; 
    color:#fff; 
    cursor:pointer; 
    border: none;
}
#confirmcategory:hover { 
    background:#0b5200; 
}
#cancelcategory { 
    background:#ccc; 
    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: 'Tanha';
}
#confirmLocation { 
    background:#008000; 
    color:#fff; 
    cursor:pointer; 
    border: none;
}
#confirmLocation:hover { 
    background:#0b5200; 
}
#cancelLocation { 
    background:#ccc; 
    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: #0d7900;
    border-radius: 15px;
}
    /* ======================================================== ورود---------- */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 102;
}
.modal {
    position: relative;
    background: #fff;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    padding: 24px;
    box-shadow: 0 30px 20px rgba(0,0,0,0.3);
    animation: popupShow 0.3s ease;
}
hr {
    border: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, #ccc, transparent);
    margin: 10px 0 10px 0;
}
.close-btn {
    position: absolute;
    top: 10px;
    left: 15px;
    background: none;
    border: none;
    font-size: 26px;
    color: #888;
    cursor: pointer;
}
.close-btn:hover {
    color: #000000;
    font-size: 30px;
}
.modal h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}
label {
    font-size: 14px;
    color: #333;
}
.input-group {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 15px;
    overflow: hidden;
    margin-top: 6px;
}
input[type="text"] {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px;
    font-size: 15px;
    direction: ltr;
}
.input-error {
    border: 1px solid #FF0000 !important; 
}
.error-text {
    color: #FF0000;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}
.btn-submit {
    background: #008000;
    color: #fff;
    border: none;
    padding: 10px;
    width: 40%;
    border-radius: 15px;
    margin-top: 20px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 20px auto 0 auto;
    font-family: 'Tanha';
}
.btn-submit:hover { 
    background: #0b5200; 
}
.btn-small {
    background: none;
    border: none;
    color: #999;
    font-size: 14px;
    cursor: pointer;
    margin-top: 10px;
    display: block;
    margin-right: auto;
}
.timer {
    text-align: center;
    font-size: 13px;
    color: #555;
    margin-top: 10px;
}
.timer span { 
    color: rgb(20,130,0); 
    cursor: pointer; 
}
.terms {
    font-size: 12px;
    text-align: center;
    color: #555;
    margin-top: 10px;
}
.terms span {
    color: rgb(20,130,0);
    cursor: pointer;
}
#submitBtn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}
    /* ======================================================== خروج---------- */
.logout-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);   /* لایه نیمه‌شفاف */
    backdrop-filter: blur(6px);      /* 🔥 تاری پس‌زمینه */
    -webkit-backdrop-filter: blur(6px); /* برای ساپورت موبایل */
    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 .25s 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: 'Tanha';
}
.cancel-btn:hover {
    background: #0b5200;
}
.logout-btn {
    flex: 1;
    padding: 10px;
    background: #ccc;
    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: 'Tanha';
}
.logout-btn:hover {
    background: #bbb;
}
    /* ======================================================== فلش منو ها---------- */
.arrow {
    display: inline-block;
    border: solid #6d6d6d;
    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: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
    /* ======================================================== تنظیمات مربوط به فوتر در دسکتاپ  ---------- */
    /* متن کپی‌رایت در فوتر دسکتاپ */
.desktop-footer {
    font-size: 14px;
    color: #555;
    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: 0;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 102;
    padding: 20px;
}
.mobile-popup-container {
    background: #fff;
    border-radius: 15px;
    width: 80%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: popupShow 0.3s ease;
}
.mobile-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #e2fadb;
    border-bottom: 1px solid #ddd;
}
.mobile-popup-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}
.mobile-popup-close {
    background: none;
    border: none;
    font-size: 36px;
    color: #666;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}
.mobile-popup-close:hover {
    background: #f0f0f0;
    color: #000;
}
.mobile-popup-content {
    padding: 10px 0;
    max-height: 60vh;
    overflow-y: auto;
}
.mobile-popup-content .dropdown-item {
    display: block;
    padding: 15px 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: 'Tanha'
}
.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: 0px;
    width: 7px;
    height: 7px;
    background: #ff3b30;
    border-radius: 50%;
}
    /* ======================================================== تنظیمات مربوط به هدر و فوتر در موبایل  ---------- */
@media (max-width: 768px) {
        /* هدر در موبایل */
    .header {
        justify-content: space-between;
        padding: 0 15px;
    }
        /* مخفی کردن بخش‌های چپ و راست در هدر موبایل */
    .header .left,
    .header .right {
        display: none !important;
    }
        /* نمایش لوگو در هدر موبایل */
    .header .mobile-logo {
        display: block !important;
    }
        /* تنظیمات بخش وسط (جستجو) در موبایل */
    .header .center {
        flex: 1;
        max-width: none;
    }
    .search-box {
        min-width: 300px !important;
        /*max-width: none;*/
    }
    .clear-search-btn {
        width: 24px;
        height: 24px;
        top: 8px !important;
        left: -10px !important; /* در سمت چپ جعبه */
        font-size: 36px;
    }
        /* فوتر در موبایل */
    .footer {
        bottom: 0;
        justify-content: space-between;
        padding: 10px 15px;
        /*height: 60px;*/
    }
        /* مخفی کردن متن کپی‌رایت در موبایل */
    .desktop-footer {
        display: none !important;
    }
        /* نمایش منوی موبایل در فوتر */
    .mobile-nav {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        font-size: 14px;
    }
    .btn-add { background: none;  font-size:14px; box-shadow: none;}

        /********/
    .mobile-popup-overlay {
        padding: 0px;
    }
    .mobile-popup-container {
        max-height: 85vh;
    }
    .mobile-popup-content {
        max-height: 65vh;
    }
        /* بهبود نمایش در موبایل‌های کوچک‌تر */
    .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: 15px;
    }
        /*دکمه در سرچ باکس*/
    .search-box {
        min-width: auto;
        width: 100%;
    }
    .search-box input {
        width: 100%;
        padding-right: 25px;
    }
    .clear-search-btn {
        left: 8px;
        font-size: 32px;
    }
    .mobile-popup-overlay {
        z-index: 100; /* کمتر از login modal */
    }
    #loginModal {
        z-index: 101; /* بیشتر از mobile popups */
    }
    .logout-overlay {
        z-index: 102; /* بیشتر از login modal */
    }





        /*ایکن ها در فوتر موبایل*/
    .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.6); /* تیره‌تر کردن آیکن (اختیاری) */
        transition: filter 0.2s ease;
    }
    .nav-item span {
        font-size: 11px;
        color: #333;
        font-weight: 500;
    }
        /* حالت هاور */
    .nav-item:hover {
        background-color: #f5f5f5;
    }
    .nav-item:hover .nav-icon {
        filter: brightness(1); /* حالت هاور روشن‌تر */
    }
        /* استایل مخصوص آیتم ثبت آگهی */
    .btn-add.nav-item .nav-icon {
        filter: brightness(0.8) sepia(1) hue-rotate(70deg) saturate(10); /* رنگ سبز */
    }
        /* آیتم مدیریت */
    #mmanagerMenu.nav-item .nav-icon {
        filter: brightness(0.7);
    }



}



























