/* ==========================================================
   Tik Ads Listing — استایل یکپارچه لیستینگ
   ✅ اصلاح مسیر Font Awesome و Estedad - نسخه 4.4.2
   ✅ حذف تعریف‌های تکراری فونت - استفاده از Font Manager متمرکز
   نسخه: 4.4.2
   طراحی مدرن با لودر پیشرفته
========================================================== */

/* =============================================
   ❌ حذف: تعریف @font-face تکراری
   ✅ فونت‌ها توسط Font Manager متمرکز بارگذاری می‌شوند
   ============================================= */
/* 
   @font-face { ... }  ❌ حذف شد (Font Awesome x3)
   @font-face { ... }  ❌ حذف شد (Estedad x3)
*/

/* =============================================
   ❌ حذف: اعمال اجباری فونت روی آیکون‌ها
   ✅ توسط Font Manager انجام می‌شود
   ============================================= */
/*
   .fa-solid, .fa-regular, .fas, .far { ... }  ❌ حذف شد
   .fa-brands, .fab { ... }  ❌ حذف شد
   .fa-regular, .far { ... }  ❌ حذف شد
   .fa-solid, .fas { ... }  ❌ حذف شد
   .fa-brands, .fab { ... }  ❌ حذف شد
*/

/* =============================================
   ✅ اعمال فونت Estedad روی کل ماژول
   ============================================= */
.tik-module-wrapper,
.tik-module-wrapper * {
    font-family: 'Estedad', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* ─── کانتینر اصلی ─────────────────────────────────────── */
.tik-module-wrapper {
    width: 100%;
    max-width: 100%;
    padding: 0;
    box-sizing: border-box;
    margin: 10px 0;
    direction: rtl;
    font-family: inherit;
}

/* ─── هدر آبی با طراحی مدرن ─────────────────────────────── */
.tik-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    padding: 15px 25px;
    border-radius: 16px;
    margin-bottom: 25px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 6px 10px rgba(0, 0, 0, 0.05);
    width: 100%;
    box-sizing: border-box;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tik-filter-bar__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tik-filter-bar__title i {
    color: #ffd700;
    font-size: 22px;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.4));
}

/* ─── فیلد جستجوی مدرن ─────────────────────────────────── */
.tik-filter-bar__search {
    position: relative;
    flex: 0 0 380px;
    max-width: 380px;
}

.tik-live-search-input {
    width: 100%;
    border: none;
    border-radius: 50px;
    padding: 14px 50px 14px 20px;
    font-family: inherit;
    font-size: 15px;
    outline: none;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transition: all 0.3s ease;
    direction: rtl;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tik-live-search-input:focus {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
    transform: scale(1.02);
}

.tik-live-search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 300;
}

.tik-search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    pointer-events: none;
    transition: all 0.3s ease;
}

.tik-live-search-input:focus + .tik-search-icon {
    color: #ffd700;
    transform: translateY(-50%) scale(1.1);
}

/* ==========================================================
   حالت صفحه اصلی (بدون سایدبار)
========================================================== */
.tik-homepage-layout .tik-module-body {
    display: block !important;
    width: 100%;
}

.tik-homepage-layout .tik-filter-sidebar {
    display: none !important;
}

.tik-homepage-layout .tik-ads-grid {
    width: 100% !important;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* ==========================================================
   حالت لیستینگ با سایدبار
========================================================== */
.tik-module-body {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* ساختار دو ستونه برای دسکتاپ */
@media (min-width: 992px) {
    .tik-module-body.has-sidebar {
        display: flex;
        gap: 25px;
        align-items: flex-start;
        width: 100%;
    }

    .tik-module-body.has-sidebar .tik-ads-grid {
        flex: 1;
        width: auto;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
        margin: 0;
    }

    .tik-module-body.has-sidebar .tik-filter-sidebar {
        width: 280px;
        flex-shrink: 0;
        background: #fff;
        border: 1px solid #eef2f6;
        border-radius: 20px;
        overflow: hidden;
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.05);
        position: sticky;
        top: 20px;
        margin: 0;
        backdrop-filter: blur(10px);
    }
}

/* ─── سایدبار مدرن ─────────────────────────────────────── */
.tik-filter-sidebar {
    background: #fff;
    border: 1px solid #eef2f6;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.tik-filter-sidebar:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.tik-filter-sidebar__title {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #2a5298;
    text-align: center;
    padding: 15px;
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    border-bottom: 2px solid rgba(42, 82, 152, 0.1);
    letter-spacing: 0.5px;
}

.tik-filter-sidebar__title i {
    margin-left: 8px;
    color: #2a5298;
}

.tik-filter-sidebar__terms {
    display: flex;
    flex-direction: column;
    padding: 12px;
    max-height: 450px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f1f5f9;
}

.tik-filter-sidebar__terms::-webkit-scrollbar {
    width: 6px;
}

.tik-filter-sidebar__terms::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.tik-filter-sidebar__terms::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

.tik-filter-sidebar__terms::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ─── دکمه‌های دسته‌بندی مدرن ──────────────────────────── */
.tik-term-tag {
    background: #f8fafc;
    color: #334155;
    border: 1px solid #e2e8f0;
    border-radius: 30px;
    padding: 10px 16px;
    margin: 4px 0;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    line-height: 1.4;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.tik-term-tag:hover {
    background: #ffffff;
    border-color: #2a5298;
    color: #2a5298;
    transform: translateX(-3px);
    box-shadow: 0 5px 15px rgba(42, 82, 152, 0.1);
}

.tik-term-tag.is-active {
    background: linear-gradient(135deg, #2a5298, #1e3c72);
    color: #fff;
    border-color: #2a5298;
    box-shadow: 0 5px 15px rgba(42, 82, 152, 0.3);
}

.tik-term-count {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
    margin-right: 8px;
    transition: all 0.2s ease;
}

.tik-term-tag:hover .tik-term-count {
    background: rgba(42, 82, 152, 0.1);
    color: #2a5298;
}

.tik-term-tag.is-active .tik-term-count {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ─── گرید آگهی‌ها ─────────────────────────────────────── */
.tik-ads-grid {
    display: grid;
    gap: 20px;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* تنظیمات گرید بر اساس عرض صفحه */
@media (min-width: 1400px) {
    .tik-ads-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 992px) and (max-width: 1399px) {
    .tik-ads-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 768px) and (max-width: 991px) {
    .tik-ads-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
    .tik-ads-grid { grid-template-columns: 1fr; }
}

/* تنظیمات ویژه برای حالت با سایدبار */
@media (min-width: 992px) {
    .has-sidebar .tik-ads-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (min-width: 1200px) {
    .has-sidebar .tik-ads-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* ─── کارت آگهی ────────────────────────────────────────── */
.tik-grid-item {
    width: 100%;
    box-sizing: border-box;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 0;
    padding: 0;
}

.tik-grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.1);
}

/* کارت پیش‌فرض (فال‌بک) */
.tik-card {
    background: #fff;
    border: 1px solid #eef2f6;
    border-radius: 20px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.02);
}

.tik-card:hover {
    border-color: transparent;
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.08);
}

.tik-card-thumbnail {
    position: relative;
    padding-top: 66%;
    background: #f8fafc;
    overflow: hidden;
}

.tik-card-thumbnail a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.tik-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.tik-card:hover .tik-card-thumbnail img {
    transform: scale(1.08);
}

.tik-card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #ffd700, #ffb347);
    color: #1e3c72;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tik-card-body {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tik-card-category {
    font-size: 12px;
    color: #2a5298;
    margin-bottom: 8px;
    display: inline-block;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tik-card-title {
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    color: #1e293b;
}

.tik-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.tik-card-title a:hover {
    color: #2a5298;
}

.tik-card-excerpt {
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
    margin: 0 0 15px;
    flex: 1;
}

.tik-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #475569;
}

.tik-card-price {
    color: #10b981;
    font-weight: 700;
    background: #ecfdf5;
    padding: 4px 12px;
    border-radius: 30px;
}

.tik-card-location {
    color: #3b82f6;
    background: #eff6ff;
    padding: 4px 12px;
    border-radius: 30px;
}

.tik-card-meta i {
    margin-left: 5px;
    opacity: 0.8;
}

.tik-card-btn {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #2a5298, #1e3c72);
    color: #fff;
    border-radius: 40px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    margin-top: 5px;
    border: none;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(42, 82, 152, 0.2);
}

.tik-card-btn:hover {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(42, 82, 152, 0.3);
    color: #fff;
}

.tik-card-btn i {
    margin-right: 8px;
    font-size: 12px;
    transition: transform 0.2s;
}

.tik-card-btn:hover i {
    transform: translateX(-3px);
}

/* کارت ویژه */
.tik-card--vip {
    border: 2px solid transparent;
    background: linear-gradient(#fff, #fff) padding-box,
                linear-gradient(135deg, #ffd700, #ffb347) border-box;
    position: relative;
}

/* ==========================================================
   لودر مدرن برای بارگذاری بیشتر
========================================================== */

/* کانتینر اصلی لودر */
.tik-load-more-container {
    width: 100%;
    margin: 30px 0 10px;
    text-align: center;
    position: relative;
    clear: both;
}

/* لودر مدرن با انیمیشن */
.tik-modern-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: #fff;
    padding: 15px 35px;
    border-radius: 60px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid #eef2f6;
    transition: all 0.3s ease;
}

.tik-modern-loader:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* اسپینر دایره‌ای مدرن */
.tik-modern-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #2a5298;
    border-right: 3px solid #2a5298;
    border-radius: 50%;
    animation: tik-spin 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    box-shadow: 0 0 10px rgba(42, 82, 152, 0.2);
}

/* اسپینر نقطه‌ای (dot loader) */
.tik-dot-loader {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tik-dot {
    width: 8px;
    height: 8px;
    background: #2a5298;
    border-radius: 50%;
    animation: tik-dot-pulse 1.5s ease-in-out infinite;
}

.tik-dot:nth-child(1) { animation-delay: 0s; }
.tik-dot:nth-child(2) { animation-delay: 0.2s; }
.tik-dot:nth-child(3) { animation-delay: 0.4s; }

/* اسپینر پیشرفته با چند لایه */
.tik-advanced-spinner {
    position: relative;
    width: 40px;
    height: 40px;
}

.tik-advanced-spinner::before,
.tik-advanced-spinner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
}

.tik-advanced-spinner::before {
    border-top-color: #2a5298;
    border-right-color: #2a5298;
    animation: tik-spin 1s linear infinite;
}

.tik-advanced-spinner::after {
    border-bottom-color: #ffd700;
    border-left-color: #ffd700;
    animation: tik-spin 1.5s linear infinite reverse;
}

/* متن لودر */
.tik-loader-text {
    color: #2a5298;
    font-size: 15px;
    font-weight: 500;
    margin-right: 5px;
}

/* دکمه بارگذاری بیشتر */
.tik-load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fff;
    color: #2a5298;
    border: 2px solid #e2e8f0;
    padding: 14px 40px;
    border-radius: 60px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.02);
    font-family: inherit;
}

.tik-load-more-btn:hover {
    background: linear-gradient(135deg, #2a5298, #1e3c72);
    color: #fff;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(42, 82, 152, 0.3);
}

.tik-load-more-btn i {
    font-size: 14px;
    transition: transform 0.3s;
}

.tik-load-more-btn:hover i {
    transform: translateY(3px);
}

.tik-load-more-btn:active {
    transform: translateY(0);
}

/* پیغام پایان */
.tik-no-more {
    text-align: center;
    padding: 20px;
    color: #94a3b8;
    font-size: 15px;
    font-weight: 500;
    position: relative;
    display: inline-block;
    background: #fff;
    padding: 12px 40px;
    border-radius: 60px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.02);
    border: 1px solid #eef2f6;
}

.tik-no-more::before,
.tik-no-more::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
}

.tik-no-more::before {
    right: -30px;
}

.tik-no-more::after {
    left: -30px;
}

/* اسکرول تریگر مخفی */
.tik-scroll-trigger {
    height: 20px;
    width: 100%;
    opacity: 0;
}

/* پیغام خطا */
.tik-not-found-msg {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
    font-size: 16px;
    background: #f8fafc;
    border-radius: 30px;
    border: 2px dashed #e2e8f0;
}

.tik-not-found-msg i {
    font-size: 50px;
    color: #94a3b8;
    margin-bottom: 20px;
    display: block;
}

.tik-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #dc2626;
    background: #fef2f2;
    border-radius: 20px;
    border: 1px solid #fee2e2;
}

/* انیمیشن‌ها */
@keyframes tik-spin {
    to { transform: rotate(360deg); }
}

@keyframes tik-dot-pulse {
    0%, 100% { 
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% { 
        transform: scale(1.2);
        opacity: 1;
        background: #1e3c72;
    }
}

@keyframes tik-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* ─── ریسپانسیو ────────────────────────────────────────── */
@media (max-width: 991px) {
    .tik-module-body.has-sidebar {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    
    .tik-filter-sidebar {
        width: 100%;
        position: static;
        margin-bottom: 10px;
    }
    
    .tik-ads-grid {
        width: 100%;
    }
    
    .tik-filter-bar {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }
    
    .tik-filter-bar__search {
        width: 100%;
        max-width: 100%;
    }
    
    .tik-filter-bar__title {
        width: 100%;
        justify-content: center;
        font-size: 18px;
    }

    .tik-modern-loader {
        padding: 12px 25px;
    }

    .tik-load-more-btn {
        width: 90%;
        padding: 12px 20px;
    }
}

@media (max-width: 640px) {
    .tik-ads-grid {
        grid-template-columns: 1fr;
    }
    
    .tik-card-body {
        padding: 15px;
    }

    .tik-no-more::before,
    .tik-no-more::after {
        display: none;
    }
}