 #app {
            width: 100%;
            max-width: 480px;
            height: 100vh;
            max-height: 100vh;
            background: #f4f7f6;
            position: relative;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            margin: 0 auto;
        }
  :root {
            --primary-color: #00848c;
            --primary-dark: #006b72;
            --primary-light: #e6f3f4;
            --bg-color: #f4f7f6;
            --card-bg: #ffffff;
            --text-main: #2d3748;
            --text-muted: #718096;
            --accent-orange: #ff9800;
            --accent-red: #e53e3e;
            --border-color: #edf2f7;
        }
        body {
            background: #e2e8f0;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            font-family: 'Vazirmatn', 'Tahoma', sans-serif;
        }
        .main-content {
            flex: 1;
            overflow-y: auto;
            padding-bottom: 80px;
        }
        .empty-state {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 60px 20px;
            text-align: center;
        }
        .empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
        .empty-state-title { font-size: 18px; font-weight: 700; color: #2d3748; margin-bottom: 8px; }
        .empty-state-description { font-size: 14px; color: #718096; max-width: 300px; }
        .btn-primary {
            background: #00848c;
            color: white;
            border: none;
            padding: 10px 24px;
            border-radius: 12px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            font-family: inherit;
            margin-top: 12px;
        }
        /* استایل‌های هدر */
        .app-header {
            background: #00848c;
            color: white;
            padding: 12px 16px;
            flex-shrink: 0;
        }
        .header-top {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .header-left { display: flex; align-items: center; gap: 6px; font-size: 13px; background: rgba(255,255,255,0.15); padding: 4px 12px; border-radius: 20px; cursor: pointer; }
        .brand-logo { font-size: 20px; font-weight: 900; cursor: pointer; }
        .brand-sub { font-size: 9px; opacity: 0.8; }
        .header-right { display: flex; gap: 8px; }
        .icon-btn { background: none; border: none; color: white; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
        /* استایل‌های منوی پایینی */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            width: 100%;
            max-width: 480px;
            height: 68px;
            background: rgba(255,255,255,0.95);
            backdrop-filter: blur(12px);
            border-top: 1px solid #edf2f7;
            display: flex;
            justify-content: space-around;
            align-items: center;
            z-index: 1000;
        }
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background: none;
            border: none;
            color: #718096;
            font-size: 10px;
            font-weight: 500;
            width: 56px;
            height: 100%;
            cursor: pointer;
            font-family: inherit;
        }
        .nav-item.active { color: #00848c; font-weight: 700; }
        .nav-icon { width: 22px; height: 22px; margin-bottom: 2px; }
        .nav-item-center {
            position: relative;
            height: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-end;
            padding-bottom: 4px;
            width: 64px;
            cursor: pointer;
        }

        .center-post-btn {
            position: absolute;
            top: -28px;
            width: 56px;
            height: 56px;
            background: #00848c;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            border: 4px solid #ffffff;
            cursor: pointer;
        }
        .center-btn-text { font-size: 10px; font-weight: 600; color: #334155; margin-top: 2px; }



      
        /* --- باکس جستجو و فیلتر --- */
        .search-section { padding: 16px; background-color: #ffffff; border-bottom: 1px solid var(--border-color); }
        .search-wrapper { display: flex; align-items: center; background-color: #f1f5f9; border-radius: 14px; padding: 2px 8px; border: 1px solid transparent; }
        .search-input { flex: 1; border: none; background: transparent; padding: 12px 8px; font-size: 14px; outline: none; }
        .filter-btn, .search-icon-btn { background: none; border: none; color: var(--primary-color); padding: 8px; cursor: pointer; }

        /* --- گرید دسته‌بندی‌ها --- */
        .categories-section { padding: 16px; }
        .categories-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
        .category-card { background-color: var(--card-bg); border-radius: 16px; padding: 12px 6px; display: flex; flex-direction: column; align-items: center; text-align: center; text-decoration: none; color: var(--text-main); box-shadow: 0 2px 4px rgba(0,0,0,0.02); aspect-ratio: 1 / 1.05; }
        .category-icon-wrapper { width: 44px; height: 44px; margin-bottom: 8px; display: flex; align-items: center; justify-content: center; color: var(--primary-color); }
        .category-title { font-size: 11px; font-weight: 600; line-height: 1.4; }

        /* --- بخش آگهی‌های ویژه --- */
        .ads-section { padding: 8px 16px 24px 16px; }
        .section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
        .section-title { font-size: 16px; font-weight: 700; }
        .view-all-btn { font-size: 13px; color: var(--primary-color); text-decoration: none; font-weight: 500; }
        .ads-slider-container { overflow-x: auto; scroll-snap-type: x mandatory; display: flex; gap: 12px; padding-bottom: 8px; scrollbar-width: none; }
        .ads-slider-container::-webkit-scrollbar { display: none; }
        .ad-card { flex: 0 0 210px; scroll-snap-align: start; background-color: var(--card-bg); border-radius: 16px; overflow: hidden; border: 1px solid var(--border-color); display: flex; flex-direction: column; }
        .ad-image-wrapper { position: relative; width: 100%; height: 130px; background-color: #edf2f7; }
        .ad-image { width: 100%; height: 100%; object-fit: cover; }
        .ad-badge { position: absolute; bottom: 8px; right: 8px; background-color: #04848c; color: white; font-size: 10px; padding: 3px 8px; border-radius: 6px; }
        .bookmark-btn { position: absolute; top: 8px; left: 8px; width: 28px; height: 28px; background-color: rgba(255, 255, 255, 0.85); border: none; border-radius: 50%; cursor: pointer; color: #4a5568; }
        .ad-details { padding: 12px; display: flex; flex-direction: column; flex: 1; }
        .ad-title { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
        .ad-location { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; }
        .ad-price { font-size: 13px; font-weight: 700; color: var(--primary-color); margin-top: auto; }

        /* --- منوی ناوبری پایینی --- */
   
        /* =========================================
           استایل‌های جدید برای مدال ورود و ثبت‌نام
           ========================================= */
        .auth-overlay {
            position: absolute;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(4px);
            z-index: 2000;
            display: flex;
            align-items: flex-end; /* برای باز شدن از پایین */
            visibility: hidden;
            opacity: 0;
            transition: all 0.3s ease;
        }

        .auth-overlay.active {
            visibility: visible;
            opacity: 1;
        }

        .auth-modal {
            background: #ffffff;
            width: 100%;
            padding: 30px 20px;
            border-top-left-radius: 24px;
            border-top-right-radius: 24px;
            transform: translateY(100%);
            transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1); /* افکت نرم */
            position: relative;
        }

        .auth-overlay.active .auth-modal {
            transform: translateY(0);
        }

        .close-modal-btn {
            position: absolute;
            top: 15px;
            right: 15px;
            background: #f1f5f9;
            border: none;
            width: 32px; height: 32px;
            border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            cursor: pointer;
            color: #64748b;
        }

        .auth-title {
            font-size: 18px;
            font-weight: 700;
            color: var(--text-main);
            margin-bottom: 8px;
            text-align: center;
        }

        .auth-subtitle {
            font-size: 13px;
            color: var(--text-muted);
            margin-bottom: 24px;
            text-align: center;
            line-height: 1.6;
        }

        .auth-input-group {
            margin-bottom: 20px;
        }

        .auth-input {
            width: 100%;
            padding: 14px;
            border: 1px solid #cbd5e1;
            border-radius: 12px;
            font-size: 16px;
            outline: none;
            transition: border-color 0.2s;
            background: #f8fafc;
        }

        .auth-input:focus {
            border-color: var(--primary-color);
            background: #ffffff;
        }

        .auth-btn-primary {
            width: 100%;
            padding: 14px;
            background-color: var(--primary-color);
            color: white;
            border: none;
            border-radius: 12px;
            font-size: 15px;
            font-weight: 700;
            cursor: pointer;
            transition: background 0.2s;
        }

        .auth-btn-primary:active {
            background-color: var(--primary-dark);
            transform: scale(0.98);
        }

        .auth-btn-link {
            background: none;
            border: none;
            color: var(--primary-color);
            width: 100%;
            padding: 10px;
            margin-top: 10px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
        }
/* ============================================================
   استایل‌های کامل صفحه پروفایل (نسخه نهایی، باکس داخلی)
   ============================================================ */
.profile-page-wrapper {
    padding: 0 16px 30px 16px;
    background-color: #f7fafc;
    min-height: 100vh;
    direction: rtl;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ============================================================
   هدر پروفایل (همه چیز درون باکس سبز)
   ============================================================ */
.profile-header-container {
    width: 100%;
    margin-bottom: 20px;
}

.profile-header-bg {
    background: linear-gradient(135deg, #00848c, #005f66);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    height: 85px; /* ارتفاع ثابت برای کادر سبز */
}

/* محتوای داخل باکس سبز */
.profile-header-content {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}

/* ستون آواتار (سمت راست) */
.profile-avatar-col {
    display: flex;
    justify-content: flex-start;
}

.profile-avatar-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    background: #ffffff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #00848c;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.profile-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-text {
    font-size: 28px;
    font-weight: 700;
}

/* ستون اطلاعات (سمت چپ آواتار) */
.profile-info-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.profile-header-name {
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
    margin-bottom: 2px;
}

.profile-header-phone {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 4px;
    direction: ltr;
}

.profile-verified-badge {
    display: inline-block;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    color: #fff;
}

/* ============================================================
   کارت‌های آمار (۳ کادر بالا)
   ============================================================ */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.profile-stat-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.02);
}

.stat-icon {
    font-size: 24px;
    display: block;
    margin-bottom: 4px;
}

.stat-number {
    font-size: 20px;
    font-weight: 700;
}
.stat-number.primary { color: #00848c; }
.stat-number.success { color: #48bb78; }
.stat-number.warning { color: #ecc94b; }

.stat-label {
    font-size: 12px;
    color: #718096;
    margin-top: 2px;
}

/* ============================================================
   کارت اطلاعات شخصی
   ============================================================ */
.profile-info-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.02);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a202c;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-secondary.btn-sm {
    background: #edf2f7;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #2d3748;
    cursor: pointer;
    transition: background 0.2s;
}

.profile-info-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f7fafc;
}

.info-label {
    color: #718096;
    font-size: 14px;
}
.info-value {
    font-weight: 600;
    color: #1a202c;
    font-size: 14px;
}

.tag {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.tag-primary {
    background: #e6fffa;
    color: #00848c;
}

/* ============================================================
   منوی سریع
   ============================================================ */
.profile-quick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.profile-quick-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.02);
    transition: transform 0.2s ease;
}
.profile-quick-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.quick-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 4px;
}
.quick-title {
    font-weight: 600;
    font-size: 14px;
}
.quick-sub {
    font-size: 12px;
    color: #718096;
}

/* ============================================================
   دکمه خروج
   ============================================================ */
.profile-logout-section {
    margin-top: 20px;
}

.btn-danger.btn-block {
    width: 100%;
    padding: 14px;
    background: #e53e3e;
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

/* ============================================================
   صفحات خطا
   ============================================================ */
.profile-empty-state {
    padding: 60px 20px;
    text-align: center;
}
.empty-icon {
    font-size: 56px;
    opacity: 0.6;
}
.empty-title {
    font-size: 20px;
    font-weight: 700;
    margin: 12px 0;
    color: #1a202c;
}
.empty-desc {
    font-size: 14px;
    color: #718096;
    margin-bottom: 20px;
}

.btn-primary {
    background: #00848c;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}
    /* ============================================================
   استایل‌های صفحه دسته‌بندی (بدون هدر)
   ============================================================ */
.category-page-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 16px;
}

.category-search-section {
    flex-shrink: 0;
    margin-bottom: 12px;
}

.category-filters-box {
    margin-top: 8px;
    padding: 12px;
    background: var(--card-bg);
    border-radius: 16px;
}

.category-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.category-filter-reset {
    width: 100%;
    margin-top: 8px;
    font-size: 12px;
}

.category-ads-container {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
    -webkit-overflow-scrolling: touch;
}

.category-load-more {
    text-align: center;
    padding: 20px;
}

.category-load-more-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

.category-no-more-ads {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: var(--text-muted);
}

.category-empty-ads {
    padding: 40px 20px;
}
/* ============================================================
   استایل نهایی و کاملاً متقارن بخش فیلترها
   ============================================================ */
.category-filters-box {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-top: 10px;
    border: 1px solid #f0f0f0;
}

.category-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

/* ---- استایل فیلدهای عددی (قیمت از / قیمت تا) ---- */
.category-filter-grid .form-input {
    width: 88%;
    padding: 12px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    background-color: #f9fafb;
    color: #2d3748;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
    /* ★★★ این خط باعث می‌شود متن دقیقاً در وسط فیلد قرار بگیرد ★★★ */
    text-align: center;
}

.category-filter-grid .form-input:focus {
    border-color: #00848c;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 132, 140, 0.1);
}

/* مخفی کردن اسپینرهای فیلدهای عددی */
.category-filter-grid .form-input[type="number"]::-webkit-inner-spin-button,
.category-filter-grid .form-input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.category-filter-grid .form-input[type="number"] {
    -moz-appearance: textfield;
}

/* ---- استایل لیست‌های کشویی (نوع آگهی / جدیدترین) ---- */
.category-filter-grid .form-select {
    width: 100%;
    padding: 12px 14px;
    padding-right: 16px; /* برای اینکه به لبه سمت راست نچسبد */
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    background-color: #f9fafb;
    color: #2d3748;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
    text-align: right; /* متن را در سمت راست نگه می‌دارد */
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%23718096' d='M7 10L1 4h12z'/%3E%3Csvg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 36px;
    cursor: pointer;
}

.category-filter-grid .form-select:focus {
    border-color: #00848c;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 132, 140, 0.1);
}

/* ---- دکمه بازنشانی فیلترها ---- */
.category-filter-reset {
    width: 100%;
    margin-top: 4px;
    padding: 12px;
    background-color: #f1f5f9;
    color: #2d3748;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.category-filter-reset:hover {
    background-color: #e2e8f0;
}
/* ============================================================
   استایل کانتینر گرید آگهی‌ها (برای نمایش ۲ ستونه)
   ============================================================ */
.ads-grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr; /* دو ستون برابر */
    gap: 12px;
    padding-bottom: 16px;
}

/* ============================================================
   استایل اختصاصی هر کارت آگهی (در adCard.js اعمال می‌شود)
   ============================================================ */
.ad-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    padding: 12px;
    position: relative;
    /* جلوگیری از تداخل کارت‌ها */
    margin-bottom: 0;
}

/* فضای اختصاصی برای تصویر */
.ad-card-image-wrapper {
    width: 100%;
    height: 120px;
    background-color: #f1f5f9;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.ad-card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-card-image-placeholder {
    font-size: 40px;
    opacity: 0.4;
}

/* تگ "ویژه" */
.ad-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: #00848c;
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
}

/* دکمه بوکمارک */
.ad-card-bookmark {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: #4a5568;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* عنوان و جزئیات آگهی */
.ad-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 4px;
    line-height: 1.4;
}

.ad-card-location {
    font-size: 12px;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.ad-card-price {
    font-size: 15px;
    font-weight: 700;
    color: #00848c;
    margin-top: auto;
}
/* ============================================================
   مخفی کردن اسکرول‌بار اما حفظ اسکرول
   ============================================================ */
.category-ads-container::-webkit-scrollbar,
.category-ads-container {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.category-ads-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}
/* ============================================================
   Skeleton Loader برای کل کارت
   ============================================================ */
@keyframes pulse {
    0% { background-color: #f1f5f9; }
    50% { background-color: #e2e8f0; }
    100% { background-color: #f1f5f9; }
}

/* کارت اسکلت */
.skeleton-ad-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: pulse 1.8s infinite ease-in-out;
}

/* اسکلت عکس */
.skeleton-image {
    width: 100%;
    height: 130px;
    background-color: #f1f5f9;
}

/* اسکلت محتوا */
.skeleton-ad-card .ad-card-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* خطوط اسکلت شبیه به متن */
.skeleton-line {
    height: 12px;
    background-color: #e2e8f0;
    border-radius: 6px;
}

.skeleton-line-title {
    width: 85%;
    height: 16px;
}

.skeleton-line-sub {
    width: 60%;
}

.skeleton-line-price {
    width: 45%;
    height: 16px;
    margin-top: 4px;
}

/* ============================================================
   استایل کارت واقعی (بعد از لود)
   ============================================================ */
.real-ad-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
    overflow: hidden;
    animation: fadeInUp 0.4s ease-out;
}

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

.ad-card-image-wrapper {
    width: 100%;
    height: 130px;
    position: relative;
}

.ad-card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #00848c;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
}

.ad-card-bookmark {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.ad-card-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ad-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a202c;
}

.ad-card-location {
    font-size: 12px;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ad-card-price {
    font-size: 15px;
    font-weight: 700;
    color: #00848c;
}
.ad-card-bookmark {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #4a5568; /* رنگ قلب خالی */
    transition: color 0.2s;
}

.ad-card-bookmark {
    /* ... سایر استایل‌ها ... */
    color: #4a5568; /* رنگ قلب در حالت عادی (سفید) */
    transition: color 0.2s ease;
}

.ad-card-bookmark.active {
    color: #e53e3e; /* رنگ قلب در حالت فعال (قرمز) */
    stroke: #e53e3e; /* برای SVG */
}
/* ============================================================
   استایل صفحه جزئیات آگهی (نسخه حرفه‌ای)
   ============================================================ */
.ad-detail-page {
    background: #f7fafc;
    min-height: 100vh;
    padding-bottom: 80px;
}

/* --- اسلایدر مدیا --- */
.ad-detail-media-container {
    position: relative;
    width: 100%;
    height: 340px;
    background: #e2e8f0;
    overflow: hidden;
}
.ad-detail-media-slider {
    display: flex;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
}
.ad-detail-media-slider::-webkit-scrollbar {
    display: none;
}
.media-slide {
    flex: 0 0 100%;
    height: 100%;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #edf2f7;
}
.media-slide img,
.media-slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-detail-image-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}
.ad-detail-image-badge.special { background: #e53e3e; }
.ad-detail-image-badge.urgent { background: #f6ad55; }

/* --- هدر (عنوان، قیمت، لایک، گزارش) --- */
.ad-detail-header {
    background: white;
    padding: 20px;
    margin-bottom: 12px;
    border-radius: 0 0 16px 16px;
    position: relative;
}
.ad-detail-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 8px;
}
.ad-detail-price {
    font-size: 22px;
    font-weight: 700;
    color: #00848c;
}
.ad-detail-location {
    font-size: 14px;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}
.ad-detail-header-actions {
    position: absolute;
    bottom: 16px;
    left: 16px;
    display: flex;
    gap: 8px;
}
.ad-detail-header-actions .btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f7fafc;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s;
}
.ad-detail-header-actions .btn-icon:hover {
    background: #edf2f7;
}

/* --- فروشنده --- */
.ad-detail-seller {
    background: white;
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.ad-detail-seller-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #00848c;
    font-weight: bold;
}
.ad-detail-seller-info {
    flex: 1;
}
.ad-detail-seller-name {
    font-weight: 600;
    font-size: 15px;
}
.ad-detail-seller-phone {
    font-size: 13px;
    color: #718096;
}
.btn-sm {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}
.btn-outline {
    background: transparent;
    border: 1px solid #00848c;
    color: #00848c;
}

/* --- توضیحات --- */
.ad-detail-description {
    background: white;
    padding: 20px;
    margin-bottom: 12px;
    border-radius: 16px;
    line-height: 1.8;
    font-size: 15px;
    color: #4a5568;
}

/* --- فرم داینامیک --- */
.ad-detail-dynamic-form {
    background: white;
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: 16px;
}
.dynamic-form-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 12px;
}
.dynamic-form-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.dynamic-field-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f7fafc;
}
.dynamic-field-label {
    color: #718096;
    font-size: 13px;
}
.dynamic-field-value {
    font-weight: 500;
    font-size: 13px;
}

/* --- پرداخت امن --- */
.ad-detail-secure-payment {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #e6fffa;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 12px;
}
.secure-payment-icon {
    font-size: 24px;
}
.secure-payment-text {
    display: flex;
    flex-direction: column;
    font-size: 13px;
}
.secure-payment-text strong {
    color: #00848c;
}

/* --- آگهی‌های مشابه --- */
.ad-detail-similar-ads {
    margin-bottom: 16px;
}
.similar-ads-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
}
.similar-ads-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.similar-ad-item {
    background: white;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
}
.similar-ad-image {
    width: 100%;
    height: 80px;
    background: #edf2f7;
    border-radius: 8px;
    margin-bottom: 8px;
}
.similar-ad-title {
    font-size: 13px;
    font-weight: 600;
}
.similar-ad-price {
    font-size: 13px;
    color: #00848c;
    font-weight: 600;
}

/* --- دکمه‌های اصلی --- */
 /* ============================================================
   استایل‌های جدید صفحه جزئیات آگهی (مثل تصویر ارسالی)
   ============================================================ */
.ad-detail-page {
    background: #f7fafc;
    min-height: 100vh;
    padding-bottom: 100px;
}

/* --- هدر ساده --- */
.app-header-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: white;
}
.app-header-simple .header-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a202c;
}
.app-header-simple .btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

/* --- گالری --- */
.ad-gallery-container {
    position: relative;
    width: 100%;
    height: 300px;
    background: #e2e8f0;
    overflow: hidden;
}
.ad-gallery-slide {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}
.ad-gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.gallery-counter {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
}
.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.8);
    border: none;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.gallery-nav-btn.prev { left: 12px; }
.gallery-nav-btn.next { right: 12px; }

.ad-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}
.ad-badge.special { background: #e53e3e; }

/* --- عنوان و قیمت --- */
.ad-info-header {
    background: white;
    padding: 20px;
    margin-bottom: 12px;
}
.ad-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 8px;
}
.ad-price {
    font-size: 22px;
    font-weight: 700;
    color: #00848c;
}
.ad-location {
    font-size: 14px;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

/* --- ویژگی‌های کلید-مقدار (گرید ۳ ستونه) --- */
.ad-key-value-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    background: white;
    border-radius: 16px;
    margin-bottom: 12px;
    overflow: hidden;
}
.ad-key-value-item {
    padding: 16px 8px;
    text-align: center;
    border-right: 1px solid #f7fafc;
    border-bottom: 1px solid #f7fafc;
}
.ad-key-value-item:last-child { border-right: none; }
.ad-kv-icon { font-size: 20px; margin-bottom: 4px; }
.ad-kv-value { font-size: 14px; font-weight: 600; }
.ad-kv-label { font-size: 11px; color: #718096; }

/* --- امکانات --- */
.ad-features-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px;
    margin-bottom: 12px;
}
.ad-feature-tag {
    background: #f1f5f9;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    color: #2d3748;
}

/* --- توضیحات --- */
.ad-description {
    background: white;
    padding: 20px;
    margin-bottom: 12px;
    border-radius: 16px;
}
.section-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 8px;
}
.description-content {
    font-size: 14px;
    color: #4a5568;
    line-height: 1.8;
}

/* --- نقشه --- */
.ad-map-container {
    position: relative;
    margin-bottom: 12px;
}
.ad-map-overlay {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
}

/* --- فروشنده --- */
.ad-seller-box {
    background: white;
    padding: 16px 20px;
    margin-bottom: 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.seller-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #00848c;
}
.seller-info {
    flex: 1;
}
.seller-name {
    font-weight: 600;
    font-size: 15px;
}
.seller-phone {
    font-size: 13px;
    color: #718096;
}
.btn-sm.btn-outline {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    border: 1px solid #00848c;
    color: #00848c;
    background: transparent;
    cursor: pointer;
}

/* --- دکمه‌های پایین --- */
.ad-actions-bottom {
    display: flex;
    gap: 12px;
    padding: 0 16px;
    position: fixed;
    bottom: 80px;
    left: 0;
    right: 0;
    background: white;
    padding: 12px 16px;
    border-top: 1px solid #e2e8f0;
    z-index: 100;
}
.ad-actions-bottom .btn {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}
.ad-actions-bottom .btn-primary {
    background: #00848c;
    color: white;
}
.ad-actions-bottom .btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}
/* ============================================================
   استایل‌های صفحه پیام‌ها و چت تمام‌صفحه
   ============================================================ */
.messages-page {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #f7fafc;
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.messages-header {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.messages-empty-state {
    padding: 40px 20px;
    text-align: center;
}
.messages-empty-state .empty-icon { font-size: 48px; opacity: 0.5; }
.messages-empty-state .empty-title { font-size: 18px; font-weight: 700; }
.messages-empty-state .empty-desc { font-size: 14px; color: #718096; }

/* --- لیست مکالمات --- */
.conversation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 16px;
    margin-bottom: 8px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.conv-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #00848c;
    position: relative;
    flex-shrink: 0;
}
.conv-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.unread-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e53e3e;
    color: white;
    font-size: 9px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid white;
}

.conv-info { flex: 1; }
.conv-name { font-weight: 600; font-size: 14px; }
.conv-last-msg { font-size: 13px; color: #718096; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.conv-meta { text-align: left; font-size: 11px; color: #718096; }
.unread-badge {
    background: #00848c;
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
}

/* --- پنجره چت (تمام صفحه) --- */
.chat-window {
    display: none;
    flex: 1;
    flex-direction: column;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f7fafc;
    z-index: 10000;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
}

.chat-back-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #00848c;
}
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.chat-username { font-weight: 600; }
.chat-user-status { font-size: 11px; color: #718096; }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

.chat-empty-state {
    text-align: center;
    padding: 40px;
    color: #718096;
}

.chat-message {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
}
.chat-message.own { align-items: flex-end; }
.chat-message.other { align-items: flex-start; }

.message-bubble {
    max-width: 75%;
    padding: 8px 14px;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    word-wrap: break-word;
}
.message-bubble.own { background: #00848c; color: white; border-bottom-left-radius: 4px; }
.message-bubble.other { background: white; color: #1a202c; border-bottom-right-radius: 4px; }

.message-meta {
    font-size: 9px;
    color: #718096;
    margin-top: 2px;
}
.message-meta.own { text-align: right; }
.message-meta.other { text-align: left; }

.message-attachment { margin-top: 4px; }
.message-attachment a { color: inherit; text-decoration: underline; }

.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e2e8f0;
}
.chat-send-btn {
    padding: 8px 16px;
    border-radius: 12px;
}
/* ============================================================
   استایل‌های جدید چت (فایل، ویس، پیش‌نمایش، کادر خودکار)
   ============================================================ */
.attachment-preview {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border-top: 1px solid #e2e8f0;
}
.attachment-item {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: #edf2f7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.attachment-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.attachment-file-icon {
    font-size: 11px;
    text-align: center;
    padding: 4px;
    color: #2d3748;
}
.attachment-remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* باکس ضبط صدا */
.voice-recording-box {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: #e6fffa;
    border-top: 1px solid #e2e8f0;
}
.voice-recording-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}
.recording-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e53e3e;
    animation: pulse 1s infinite;
}
@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}
#recordingTimer {
    font-size: 14px;
    font-weight: 600;
    color: #00848c;
}
.voice-stop-btn {
    background: #e53e3e;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
}

/* ورودی متن خودکار و چسبیده */
.chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border-top: 1px solid #e2e8f0;
    min-height: 56px;
}
.chat-textarea {
    flex: 1;
    resize: none;
    border: none;
    outline: none;
    padding: 10px 12px;
    background: #f7fafc;
    border-radius: 24px;
    font-size: 15px;
    min-height: 40px;
    max-height: 120px;
    font-family: inherit;
    overflow-y: hidden;
}
.chat-textarea:focus {
    background: white;
    box-shadow: 0 0 0 2px #00848c;
}

/* دکمه‌های چت */
.chat-upload-btn,
.chat-voice-btn,
.chat-send-btn {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #718096;
    transition: all 0.2s;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}
.chat-upload-btn:hover,
.chat-voice-btn:hover {
    background: #f1f5f9;
    color: #00848c;
}
.chat-send-btn {
    background: #00848c;
    color: white;
}
.chat-send-btn:hover {
    background: #006b72;
}

/* پیام‌های دارای فایل */
.msg-attachment-img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    margin-bottom: 4px;
    display: block;
}
.msg-attachment-file {
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 13px;
}
.msg-voice-player {
    width: 100%;
    max-width: 200px;
    height: 40px;
    border-radius: 8px;
    margin-top: 4px;
}