/* =========================================
   باکس جستجو
   ========================================= */

.search-section {
    max-width: 600px;
    margin: -30px auto 40px;
    padding: 0 20px;
}

.search-box {
    background: var(--white);
    border-radius: 50px;
    box-shadow: var(--shadow-lg);
    display: flex;
    overflow: hidden;
    border: 1px solid var(--border);
}

.search-box input {
    flex: 1;
    padding: 16px 24px;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    background: transparent;
    min-width: 0;
}

.search-box input::placeholder {
    color: var(--gray);
}

.search-box button {
    padding: 0 30px;
    background: var(--primary);
    color: var(--white);
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-box button:hover {
    background: var(--primary-dark);
}

/* =========================================
   نوار آمار
   ========================================= */

.stats-bar {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 20px 30px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.stats-bar .count {
    font-size: 1.1rem;
    color: var(--gray);
}

.stats-bar .count strong {
    color: var(--accent, #f97316);
    font-size: 1.3rem;
    margin-inline-start: 5px;      /* هوشمند RTL/LTR */
}

/* =========================================
   گرید مراکز
   ========================================= */

.centers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

/* =========================================
   کارت مرکز
   ========================================= */

.center-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
}

.center-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(249, 115, 22, 0.15);
}

/* ===== هدر تصویر کارت ===== */
.card-image {
    height: 160px;
    background: linear-gradient(135deg, var(--accent, #f97316), #ea580c);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.card-image img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--white);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    object-fit: cover;
    background: var(--white);
}

/* ===== بدنه کارت ===== */
.card-body {
    padding: 20px;
    text-align: center;
    flex: 1;
}

.card-body h3 {
    font-size: 1.35rem;
    margin-bottom: 10px;
    color: var(--dark);
    font-weight: 700;
}

.card-body p {
    color: var(--gray);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 3em;
}

/* ===== فوتر کارت ===== */
.card-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--light-gray);
}

/* ===== بج مرکز ===== */
.center-badge {
    background: #fff3e0;
    color: var(--accent, #f97316);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.visit-btn {
    color: var(--accent, #f97316);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.visit-btn:hover {
    color: #ea580c;
}

/* =========================================
   امکانات مرکز (تگ‌ها)
   ========================================= */

.mall-features {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.mall-features span {
    background: #ecfdf5;
    color: #10b981;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
}

/* =========================================
   صفحه‌بندی
   ========================================= */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 50px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 45px;
    padding: 0 12px;
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--gray);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid var(--border);
    font-family: inherit;
}

.pagination a:hover {
    background: var(--accent, #f97316);
    color: var(--white);
    border-color: var(--accent, #f97316);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.pagination .active {
    background: var(--accent, #f97316);
    color: var(--white);
    border-color: var(--accent, #f97316);
    box-shadow: var(--shadow-sm);
}

.pagination .disabled {
    opacity: 0.45;
    pointer-events: none;
    cursor: default;
}

/* =========================================
   حالت خالی (Empty State)
   ========================================= */

.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: var(--white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.empty-state img {
    width: 120px;
    opacity: 0.5;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--gray);
    margin-bottom: 10px;
    font-weight: 700;
}

.empty-state p {
    color: var(--gray);
    margin-bottom: 30px;
    line-height: 1.7;
}

.empty-state .btn-empty {
    display: inline-block;
    padding: 12px 30px;
    background: var(--accent, #f97316);
    color: var(--white);
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    font-family: inherit;
}

.empty-state .btn-empty:hover {
    background: #ea580c;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* =========================================
   ریسپانسیو
   ========================================= */

@media (max-width: 768px) {
    .centers-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .stats-bar {
        flex-direction: column;
        text-align: center;
        padding: 15px 20px;
    }

    .search-box {
        flex-direction: column;
        border-radius: var(--radius-xl);
    }

    .search-box input {
        padding: 14px 18px;
    }

    .search-box button {
        padding: 14px;
        border-radius: 0;
    }

    /* کارت در سه ستون: متن‌ها کوچک‌تر */
    .card-body {
        padding: 12px 8px;
    }

    .card-body h3 {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }

    .card-body p {
        font-size: 0.75rem;
        margin-bottom: 8px;
        height: auto;
        -webkit-line-clamp: 2;
    }

    .card-footer {
        padding: 8px 10px;
        flex-direction: column;
        gap: 4px;
        align-items: center;
    }

    .center-badge {
        font-size: 0.65rem;
        padding: 3px 8px;
    }

    .visit-btn {
        font-size: 0.75rem;
    }

    .card-image {
        height: 100px;
    }

    .card-image img {
        width: 70px;
        height: 70px;
    }

    .pagination a,
    .pagination span {
        min-width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .search-section {
        margin-top: -15px;
    }

    .centers-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .card-image {
        height: 80px;
    }

    .card-image img {
        width: 55px;
        height: 55px;
        border-width: 2px;
    }

    .card-body h3 {
        font-size: 0.75rem;
    }

    .mall-features {
        gap: 4px;
    }

    .mall-features span {
        font-size: 0.6rem;
        padding: 2px 5px;
    }

    .empty-state {
        padding: 50px 15px;
    }

    .empty-state h3 {
        font-size: 1.2rem;
    }
}
/* =========================================
   Dark Mode Styles for Centers / Malls
   ========================================= */

/* ===== باکس جستجو ===== */
[data-theme="dark"] .search-box {
    background: #1e1e1e;
    border-color: #333;
}

[data-theme="dark"] .search-box input {
    color: #f5f5f5;
}

[data-theme="dark"] .search-box input::placeholder {
    color: #888;
}

/* ===== نوار آمار ===== */
[data-theme="dark"] .stats-bar {
    background: #1e1e1e;
    border-color: #333;
}

[data-theme="dark"] .stats-bar .count {
    color: #bbb;
}

/* ===== کارت مرکز ===== */
[data-theme="dark"] .center-card {
    background: #1e1e1e;
    border-color: #333;
}

/* تغییر رنگ پس‌زمینه و حاشیه عکس در حالت تاریک تا با کارت هماهنگ شود */
[data-theme="dark"] .card-image img {
    border-color: #1e1e1e;
    background: #1e1e1e;
}

[data-theme="dark"] .card-body h3 {
    color: #f5f5f5;
}

[data-theme="dark"] .card-body p {
    color: #aaa;
}

[data-theme="dark"] .card-footer {
    background: #252525;
    border-top-color: #333;
}

/* ===== بج مرکز و تگ‌های امکانات ===== */
[data-theme="dark"] .center-badge {
    /* استفاده از پس‌زمینه نارنجی شفاف به جای رنگ مطلق تا در دارک مود زیباتر شود */
    background: rgba(249, 115, 22, 0.15); 
    color: var(--accent, #f97316);
}

[data-theme="dark"] .mall-features span {
    /* استفاده از پس‌زمینه سبز شفاف و متن سبز روشن‌تر */
    background: rgba(16, 185, 129, 0.15); 
    color: #34d399; 
}

/* ===== صفحه‌بندی ===== */
[data-theme="dark"] .pagination a,
[data-theme="dark"] .pagination span {
    background: #1e1e1e;
    border-color: #444;
    color: #bbb;
}

[data-theme="dark"] .pagination a:hover {
    background: var(--accent, #f97316);
    color: #fff;
    border-color: var(--accent, #f97316);
}

[data-theme="dark"] .pagination .active {
    color: #fff;
}

/* ===== حالت خالی (Empty State) ===== */
[data-theme="dark"] .empty-state {
    background: #1e1e1e;
    border-color: #333;
}

[data-theme="dark"] .empty-state h3 {
    color: #e0e0e0;
}

[data-theme="dark"] .empty-state p {
    color: #aaa;
}

[data-theme="dark"] .empty-state img {
    opacity: 0.3; /* کمی محوتر کردن عکس در حالت تاریک برای جلوگیری از خستگی چشم */
}
