/* =========================================
   فونت ایران یکان
   ========================================= */
@font-face {
    font-family: 'IranYekan';
    src: url('assets/fonts/Yekan.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

/* =========================================
   متغیرهای طراحی iOS
   ========================================= */
:root {
    --bg: #f2f2f7;
    --card: #ffffff;
    --primary: #007aff;
    --primary-dark: #0051d5;
    --success: #34c759;
    --success-dark: #248a3d;
    --danger: #ff3b30;
    --warning: #ff9500;
    --text: #1c1c1e;
    --text-muted: #8e8e93;
    --border: #e5e5ea;
    --border-light: #f0f0f2;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'IranYekan', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    padding-bottom: 80px;
}

/* =========================================
   هدر شیشه‌ای
   ========================================= */
.header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 900;
    border-bottom: 0.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-content img {
    max-height: 44px;
    width: auto;
}

/* =========================================
   فوتر شناور (شیشه‌ای)
   ========================================= */
.glass-footer {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 450px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    border-radius: 50px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 16px;
    box-shadow: var(--shadow-md);
    z-index: 900;
    border: 0.5px solid rgba(255, 255, 255, 0.5);
}

.btn-footer {
    background: transparent;
    border: none;
    padding: 10px;
    cursor: pointer;
    border-radius: 40px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-muted);
}

.btn-footer:active {
    transform: scale(0.92);
    background: rgba(0, 0, 0, 0.05);
}

.btn-footer svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

.btn-add-ad {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white !important;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin-top: -32px;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
    border: 3px solid white;
}

.btn-add-ad svg {
    width: 30px;
    height: 30px;
    fill: white;
}

.btn-add-ad:active {
    transform: scale(0.94);
}

/* =========================================
   شبکه آگهی‌ها - نسخه موبایل با نسبت برابری
   ========================================= */
.ads-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    max-width: 1200px;
    margin: 0 auto;
}

/* کارت آگهی */
.ad-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: row;
    min-height: 130px;
    width: 100%;
}

.ad-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-md);
}

/* تصویر - سمت راست */
.ad-card .ad-image-wrapper {
    width: 35%;
    min-width: 100px;
    max-width: 120px;
    position: relative;
    flex-shrink: 0;
}

.ad-card .ad-image {
    width: 100%;
    height: 130px;
    object-fit: cover;
}

/* محتوای کارت - سمت چپ */
.ad-card .ad-content {
    flex: 1;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0; /* برای جلوگیری از سرریز */
}

/* عنوان */
.ad-card .ad-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.ad-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
}

.ad-badge.sale {
    background: rgba(52, 199, 89, 0.15);
    color: var(--success);
}

.ad-badge.rent {
    background: rgba(255, 149, 0, 0.15);
    color: var(--warning);
}

/* موقعیت */
.ad-card .ad-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* قیمت */
.ad-card .ad-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ویژگی‌ها */
.ad-card .ad-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.ad-card .feature-badge {
    background: var(--bg);
    padding: 3px 8px;
    border-radius: 16px;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 3px;
}

/* زمان ثبت */
.ad-card .ad-time {
    font-size: 9px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    padding-top: 4px;
    border-top: 0.5px solid var(--border);
}

/* برای موبایل‌های خیلی کوچک */
@media (max-width: 380px) {
    .ad-card {
        min-height: 120px;
    }
    
    .ad-card .ad-image-wrapper {
        min-width: 85px;
        max-width: 100px;
    }
    
    .ad-card .ad-image {
        height: 120px;
    }
    
    .ad-card .ad-content {
        padding: 8px 10px;
    }
    
    .ad-card .ad-title {
        font-size: 13px;
    }
    
    .ad-card .ad-price {
        font-size: 12px;
    }
    
    .ad-card .feature-badge {
        font-size: 9px;
        padding: 2px 6px;
    }
}


/* =========================================
   دسکتاپ - حالت گرید
   ========================================= */
@media (min-width: 768px) {
    .ads-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .ad-card {
        flex-direction: column;
        min-height: auto;
    }
    
    .ad-card .ad-image {
        width: 100%;
        min-width: auto;
        max-width: none;
        height: 180px;
    }
    
    .card-featured-icon,
    .card-bump-icon {
        left: auto;
        right: 8px;
    }
    
    .card-featured-icon {
        right: 8px;
        left: auto;
    }
    
    .card-bump-icon {
        right: 44px;
        left: auto;
    }
}

@media (min-width: 1024px) {
    .ads-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* =========================================
   مودال‌ها
   ========================================= */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    z-index: 10000;
}

.modal-content {
    background: var(--card);
    width: 100%;
    height: 100%;
    overflow-y: auto;
}

.modal-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 0.5px solid var(--border);
    z-index: 10;
}

.modal-header h2 {
    font-size: 17px;
    font-weight: 600;
}

.ios-close-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--primary);
    border-radius: 30px;
    transition: all 0.2s;
}

.ios-close-btn:active {
    background: rgba(0, 122, 255, 0.1);
    transform: scale(0.92);
}

.modal-body {
    padding: 20px;
    padding-bottom: 100px;
}

/* مودال جزئیات آگهی - تمام صفحه */
#adDetailsModal .modal-content {
    background: var(--card);
}

#adDetailsModal .modal-body {
    padding: 0;
    padding-top: 60px;
    padding-bottom: 90px;
}

/* =========================================
   مودال جزئیات آگهی - بخش تصاویر
   ========================================= */
.detail-image-slider {
    background: #000;
    position: relative;
}

.slider-main-image {
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.slider-main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
}

.slider-thumbnails {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: #000;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.slider-thumbnails .thumbnail {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: all 0.2s;
}

.slider-thumbnails .thumbnail.active {
    border-color: var(--primary);
    opacity: 1;
}

.slider-thumbnails .thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-count-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: white;
    font-weight: 500;
}

/* =========================================
   مودال جزئیات آگهی - بخش اطلاعات
   ========================================= */
.detail-category-header {
    text-align: center;
    padding: 20px 16px 12px;
    border-bottom: 0.5px solid var(--border);
}

.detail-main-category {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.detail-sub-category {
    font-size: 13px;
    color: var(--text-muted);
}

.detail-stats-grid {
    display: flex;
    justify-content: space-around;
    padding: 16px;
    border-bottom: 0.5px solid var(--border);
}

.detail-stats-grid .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.detail-stats-grid .stat-item img {
    width: 22px;
    height: 22px;
    opacity: 0.7;
}

.detail-stats-grid .stat-item span {
    font-size: 12px;
    color: var(--text-muted);
}

.detail-price-section {
    padding: 16px;
    border-bottom: 0.5px solid var(--border);
}

.info-chip {
    background: var(--bg);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 14px;
}

.info-chip img {
    width: 18px;
    height: 18px;
}

.info-chip strong {
    color: var(--success);
    font-size: 16px;
}

.detail-info-section {
    padding: 0 16px;
    border-bottom: 0.5px solid var(--border);
}

.detail-info-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-info-table tr {
    border-bottom: 0.5px solid var(--border-light);
}

.detail-info-table tr:last-child {
    border-bottom: none;
}

.detail-info-table td {
    padding: 12px 0;
    font-size: 14px;
}

.detail-label {
    color: var(--text-muted);
    width: 35%;
    font-weight: 500;
}

.detail-value {
    color: var(--text);
}

.description-section {
    padding: 16px;
    border-bottom: 0.5px solid var(--border);
}

.description-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
}

.description-text {
    font-size: 14px;
    line-height: 1.6;
    color: #3a3a3c;
}

/* دکمه تماس - تمام عرض و چسبیده به پایین */
.detail-call-button-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 20px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-top: 0.5px solid rgba(0, 0, 0, 0.05);
    z-index: 100;
}

.detail-call-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--success), var(--success-dark));
    border: none;
    padding: 14px 20px;
    border-radius: 30px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.3);
}

.detail-call-btn:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(52, 199, 89, 0.4);
}

/* =========================================
   لایت‌باکس
   ========================================= */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-modal.active {
    display: flex;
    opacity: 1;
}

.lightbox-content-img {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 28px;
    backdrop-filter: blur(10px);
    transition: all 0.2s;
}

.lightbox-close:active,
.lightbox-prev:active,
.lightbox-next:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-close {
    top: 20px;
    right: 20px;
}

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    padding: 6px 16px;
    border-radius: 30px;
    color: white;
    font-size: 14px;
}

/* =========================================
   فرم ثبت آگهی
   ========================================= */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    background: #e8e8ed;
}

.step-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.category-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.category-btn,
.option-btn,
.exchange-btn,
.price-type-btn {
    padding: 10px 12px;
    background: var(--bg);
    border: none;
    border-radius: 30px;
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.category-btn:active,
.option-btn:active {
    transform: scale(0.96);
}

.category-btn.selected,
.option-btn.selected {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.exchange-btn.selected {
    background: var(--success);
    color: white;
}

.price-type-btn.selected {
    background: var(--warning);
    color: white;
}

/* آپلود تصاویر */
.upload-area {
    background: var(--bg);
    border: 2px dashed var(--primary);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-area:active {
    background: #e8e8ed;
    transform: scale(0.98);
}

.image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.image-preview-item {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-item .remove-img {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-item.new-image {
    border: 2px solid var(--success);
}

.new-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--success);
    color: white;
    font-size: 10px;
    text-align: center;
    padding: 2px;
}

/* دکمه‌های ناوبری فرم */
.form-footer-buttons {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 12px;
    padding: 12px 20px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-top: 0.5px solid var(--border);
    z-index: 100;
}

.form-footer-buttons .btn {
    flex: 1;
    padding: 14px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.form-footer-buttons .btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 2px 8px rgba(52, 199, 89, 0.3);
}

/* =========================================
   مودال ورود و پروفایل
   ========================================= */
#loginModal .modal-body,
#profileModal .modal-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100vh - 70px);
}

.input-group {
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    padding: 16px;
    background: var(--bg);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    text-align: center;
    transition: all 0.2s;
}

.input-group input:focus {
    outline: none;
    background: #e8e8ed;
}

.timer-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

#timerDisplay {
    font-family: monospace;
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
}

#resendBtn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-weight: 500;
}

#resendBtn:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

.edit-phone-btn {
    display: block;
    text-align: center;
    color: var(--primary);
    text-decoration: none;
    margin-top: 16px;
    font-size: 14px;
}

.error-message {
    color: var(--danger);
    font-size: 13px;
    margin-top: 8px;
    text-align: center;
}

/* آگهی‌های من */
#my-ads-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.my-ad-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 12px;
    display: flex;
    gap: 12px;
    box-shadow: var(--shadow);
}

.my-ad-card .my-ad-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.my-ad-card .my-ad-info {
    flex: 1;
}

.my-ad-card .my-ad-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.my-ad-card .my-ad-price {
    font-size: 13px;
    color: var(--success);
    font-weight: 500;
    margin: 4px 0;
}

.my-ad-card .my-ad-location {
    font-size: 12px;
    color: var(--text-muted);
}

.my-ad-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 10px;
    margin-top: 6px;
}

.status-approved {
    background: rgba(52, 199, 89, 0.15);
    color: var(--success);
}

.status-pending {
    background: rgba(255, 149, 0, 0.15);
    color: var(--warning);
}

.status-rejected {
    background: rgba(255, 59, 48, 0.15);
    color: var(--danger);
}

.my-ad-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.my-ad-actions button {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--bg);
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.my-ad-actions button:active {
    transform: scale(0.92);
}

.btn-edit { color: var(--primary); }
.btn-delete { color: var(--danger); }
.btn-bump { color: var(--warning); }
.btn-feature { color: #af52de; }

/* =========================================
   مودال فیلتر
   ========================================= */
.filter-modal-content {
    background: var(--card);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.filter-modal-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 0.5px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--card);
    z-index: 10;
}

.filter-modal-header h2 {
    font-size: 17px;
    font-weight: 600;
}

.filter-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.filter-section {
    margin-bottom: 24px;
}

.filter-section label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.filter-section select,
.filter-section input {
    width: 100%;
    padding: 14px;
    background: var(--bg);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.range-row {
    display: flex;
    gap: 12px;
}

.range-row input {
    flex: 1;
}

.filter-buttons-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.filter-option-btn {
    padding: 8px 16px;
    background: var(--bg);
    border: none;
    border-radius: 30px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-option-btn:active {
    transform: scale(0.94);
}

.filter-option-btn.active {
    background: var(--primary);
    color: white;
}

.filter-modal-footer {
    position: sticky;
    bottom: 0;
    display: flex;
    gap: 12px;
    padding: 12px 20px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-top: 0.5px solid var(--border);
}

.reset-filter-btn {
    flex: 1;
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.3);
    padding: 14px;
    border-radius: 30px;
    color: var(--danger);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.reset-filter-btn:active {
    transform: scale(0.97);
    background: rgba(255, 59, 48, 0.2);
}

.search-action-btn {
    flex: 2;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    padding: 14px;
    border-radius: 30px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.search-action-btn:active {
    transform: scale(0.97);
}

/* =========================================
   لودر و پیام‌ها
   ========================================= */
.custom-alert {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    z-index: 10002;
    opacity: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.custom-alert.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

#globalLoader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 20001;
}

.global-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    background: white;
    border-radius: 12px;
    padding: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* اسکلت لودینگ */
.skeleton-card {
    background: var(--card);
    border-radius: var(--radius);
    display: flex;
    height: 140px;
    overflow: hidden;
}

.skeleton-img {
    width: 35%;
    min-width: 110px;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-content {
    flex: 1;
    padding: 12px;
}

.skeleton-text {
    height: 12px;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    margin-bottom: 8px;
    border-radius: 4px;
    animation: shimmer 1.5s infinite;
}

.skeleton-text.short {
    width: 60%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

//* =========================================
   مودال فیلتر - نمایش از بالای صفحه
   ========================================= */
#filterModal {
    align-items: flex-start !important;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
}

#filterModal .filter-modal-content {
    background: var(--card);
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 0;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.filter-modal-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 0.5px solid var(--border);
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    z-index: 10;
}

.filter-modal-header h2 {
    font-size: 17px;
    font-weight: 600;
}

.filter-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 100px;
}

.filter-section {
    margin-bottom: 24px;
}

.filter-section label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.filter-section select,
.filter-section input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg);
    border: none;
    border-radius: 14px;
    font-size: 14px;
    transition: all 0.2s;
}

.filter-section select:focus,
.filter-section input:focus {
    outline: none;
    background: #e8e8ed;
}

.range-row {
    display: flex;
    gap: 12px;
}

.range-row input {
    flex: 1;
}

.filter-buttons-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.filter-option-btn {
    padding: 8px 16px;
    background: var(--bg);
    border: none;
    border-radius: 30px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-option-btn:active {
    transform: scale(0.94);
}

.filter-option-btn.active {
    background: var(--primary);
    color: white;
}

.filter-modal-footer {
    position: sticky;
    bottom: 0;
    display: flex;
    gap: 12px;
    padding: 12px 20px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-top: 0.5px solid var(--border);
    z-index: 10;
}

.reset-filter-btn {
    flex: 1;
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.3);
    padding: 14px;
    border-radius: 30px;
    color: var(--danger);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.reset-filter-btn:active {
    transform: scale(0.97);
    background: rgba(255, 59, 48, 0.2);
}

.search-action-btn {
    flex: 2;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    padding: 14px;
    border-radius: 30px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.search-action-btn:active {
    transform: scale(0.97);
}

/* اضافه کردن به انتهای فایل style.css */

/* =========================================
   1. استایل پنل ادمین (بهبود یافته)
   ========================================= */

/* استایل کلی پنل ادمین */
.admin-panel {
    background: var(--bg);
    min-height: 100vh;
}

/* هدر ادمین */
.admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
}

.admin-header h1 {
    font-size: 24px;
    margin-bottom: 8px;
    font-weight: 600;
}

.admin-header p {
    opacity: 0.9;
    font-size: 14px;
}

/* ناوبری ادمین */
.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.admin-nav button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-nav button:hover,
.admin-nav button.active {
    background: white;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.admin-nav button:active {
    transform: translateY(0);
}

/* بخش‌های ادمین */
.admin-section {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.admin-section h2 {
    font-size: 22px;
    color: var(--text);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
    display: inline-block;
}

/* دکمه‌های فیلتر */
.filter-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-buttons .btn {
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-buttons .btn-secondary {
    background: #e9ecef;
    color: #495057;
}

.filter-buttons .btn-warning {
    background: #ffc107;
    color: #856404;
}

.filter-buttons .btn-success {
    background: #28a745;
    color: white;
}

.filter-buttons .btn-danger {
    background: #dc3545;
    color: white;
}

.filter-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* جدول ادمین */
.admin-section table {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.admin-section th {
    background: #f8f9fa;
    padding: 15px;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.admin-section td {
    padding: 12px 15px;
    vertical-align: middle;
    border-bottom: 1px solid #e9ecef;
}

.admin-section tr:hover {
    background: #f8f9fa;
}

/* بج وضعیت */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

/* گروه دکمه‌های عملیات */
.btn-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-group .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-group .btn:hover {
    transform: scale(1.05);
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #856404;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

/* فرم لاگین ادمین */
.admin-login {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.admin-login h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

/* =========================================
   2. استایل مودال آگهی‌های من
   ========================================= */

/* کانتینر آگهی‌های من */
#my-ads-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
}

/* کارت آگهی من */
.my-ad-card {
    background: var(--card);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: row;
    position: relative;
    transition: all 0.2s ease;
}

.my-ad-card:active {
    transform: scale(0.98);
}

/* تصویر آگهی من */
.my-ad-card .my-ad-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    flex-shrink: 0;
}

/* اطلاعات آگهی */
.my-ad-card .my-ad-info {
    flex: 1;
    padding: 12px;
}

.my-ad-card .my-ad-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.my-ad-card .my-ad-location {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.my-ad-card .my-ad-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 6px;
}

/* وضعیت آگهی */
.my-ad-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.status-approved {
    background: rgba(52, 199, 89, 0.15);
    color: var(--success);
}

.status-pending {
    background: rgba(255, 149, 0, 0.15);
    color: var(--warning);
}

.status-rejected {
    background: rgba(255, 59, 48, 0.15);
    color: var(--danger);
}

/* دکمه‌های عملیات - به صورت عمودی در سمت راست */
.my-ad-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 12px 12px 12px 8px;
    background: #f8f9fa;
}

.my-ad-actions button {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: white;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.my-ad-actions button:active {
    transform: scale(0.92);
}

.btn-edit {
    color: #007aff;
}

.action-btn.bump-btn {
    color: #ff9500;
}

.action-btn.feature-btn {
    color: #af52de;
}

.action-btn.delete-btn {
    color: #ff3b30;
}

/* نشان ویژه و نردبان روی کارت */
.my-ad-card .featured-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #ffd700, #ffb347);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    z-index: 2;
}

.my-ad-card .bump-badge {
    position: absolute;
    top: 8px;
    left: 44px;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #34c759, #28a745);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    z-index: 2;
}

/* =========================================
   3. رفع مشکل مودال فیلتر (z-index)
   ========================================= */

#filterModal {
    z-index: 10000;
    align-items: flex-start !important;
}

#filterModal .filter-modal-content {
    background: var(--card);
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* اطمینان از بالاتر بودن مودال فیلتر از بقیه */
.modal {
    z-index: 9999;
}

#filterModal {
    z-index: 10000;
}

.glass-footer {
    z-index: 900;
}

/* =========================================
   4. استایل دکمه‌های ورود (بهبود یافته)
   ========================================= */

/* مودال ورود */
#loginModal .modal-content {
    max-width: 450px;
    margin: 0 auto;
    overflow: hidden;
}

#loginModal .modal-body {
    padding: 20px;
}

/* دکمه‌های ورود */
.btn-primary {
    background: linear-gradient(135deg, #007aff, #0051d5);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:active {
    transform: scale(0.97);
}

/* فیلد ورود شماره */
#loginModal .input-group input {
    width: 100%;
    padding: 16px;
    background: #f2f2f7;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    text-align: center;
    transition: all 0.2s;
    direction: ltr;
}

#loginModal .input-group input:focus {
    outline: none;
    background: #e5e5ea;
    box-shadow: 0 0 0 3px rgba(0,122,255,0.2);
}

/* بخش تایمر */
.timer-section {
    background: #f2f2f7;
    border-radius: 14px;
    padding: 12px 16px;
    margin: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#timerDisplay {
    font-family: monospace;
    font-size: 20px;
    font-weight: 600;
    color: #007aff;
}

#resendBtn {
    background: none;
    border: none;
    color: #007aff;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 20px;
}

#resendBtn:disabled {
    color: #8e8e93;
    cursor: not-allowed;
}

#resendBtn:active:not(:disabled) {
    background: rgba(0,122,255,0.1);
}

.edit-phone-btn {
    display: block;
    text-align: center;
    color: #007aff;
    text-decoration: none;
    margin-top: 16px;
    font-size: 14px;
}

/* خطاها */
.error-message {
    color: #ff3b30;
    font-size: 13px;
    margin-top: 8px;
    text-align: center;
}

/* OTP input */
.otp-inputs input {
    font-size: 24px;
    letter-spacing: 8px;
    text-align: center;
}

/* =========================================
   5. لودر بهبود یافته
   ========================================= */

#globalLoader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 20001;
}

.global-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    background: transparent;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* لودر درون خطی */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e5ea;
    border-top-color: #007aff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

/* =========================================
   6. بهینه‌سازی برای موبایل
   ========================================= */

@media (max-width: 768px) {
    /* جدول ادمین تبدیل به کارت */
    .admin-section table,
    .admin-section thead,
    .admin-section tbody,
    .admin-section th,
    .admin-section td,
    .admin-section tr {
        display: block;
    }
    
    .admin-section thead {
        display: none;
    }
    
    .admin-section tr {
        margin-bottom: 16px;
        border: 1px solid #e9ecef;
        border-radius: 16px;
        background: white;
    }
    
    .admin-section td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px;
        border-bottom: 1px solid #e9ecef;
    }
    
    .admin-section td:before {
        content: attr(data-label);
        font-weight: 600;
        color: #6c757d;
        margin-left: 10px;
    }
    
    .admin-section td:last-child {
        border-bottom: none;
    }
    
    /* دکمه‌های عملیات در موبایل */
    .btn-group {
        justify-content: center;
    }
    
    /* کارت آگهی من در موبایل */
    .my-ad-card {
        flex-wrap: wrap;
    }
    
    .my-ad-card .my-ad-image {
        width: 100%;
        height: 140px;
    }
    
    .my-ad-actions {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        padding: 10px;
    }
}

/* =========================================
   7. انیمیشن‌های نرم
   ========================================= */

.modal-content {
    animation: fadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* بهبود اسکرول */
.modal-body::-webkit-scrollbar {
    width: 4px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}


/* =========================================
   مودال فیلتر - اصلاح شده با فوتر چسبیده به پایین
   ========================================= */

#filterModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    z-index: 10000;
    align-items: flex-start !important;
    justify-content: center;
}

#filterModal .filter-modal-content {
    background: var(--card);
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 0;
    overflow: hidden;
}

.filter-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 90px; /* فاصله برای فوتر */
}

.filter-modal-footer {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 12px;
    padding: 12px 20px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-top: 0.5px solid var(--border);
    z-index: 20;
    margin-top: auto;
}

/* استایل جدید برای نمایش رهن و اجاره */
.price-detail-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--bg);
    border-radius: 16px;
    padding: 16px;
    gap: 16px;
}

.price-item {
    text-align: center;
    flex: 1;
}

.price-label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.price-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--success);
}

.price-unit {
    font-size: 12px;
    color: var(--text-muted);
    margin-right: 4px;
}

.price-separator {
    width: 1px;
    height: 40px;
    background: var(--border);
}

/* کارت آگهی ویژه - با حاشیه طلایی */
.ad-card.featured-ad {
    border: 2px solid transparent;
    background: linear-gradient(var(--card), var(--card)) padding-box,
                linear-gradient(135deg, #ffd700, #ffb347, #ffd700) border-box;
    border-radius: var(--radius);
    position: relative;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.25);
}

.ad-card.featured-ad::before {
    content: "ویژه";
    position: absolute;
    top: -7px;
    right: 12px;
    background: linear-gradient(135deg, #ffd700, #ffb347);
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 10px;
    border-radius: 20px;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* حالت دسکتاپ */
@media (min-width: 768px) {
    .ad-card.featured-ad::before {
        top: -10px;
        right: 12px;
    }
}

/* آیکن‌های ویژه و نردبان - در کنار زمان ثبت */
.ad-card .ad-footer-row {
    position: absolute;
    top: 30px;
    left: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 5;
}

.ad-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--text-muted);
}

.ad-icons {
    display: flex;
    gap: 6px;
}


.ad-icons .featured-icon-small,
.ad-icons .bump-icon-small {
    position: absolute;
    top: 130px;
    left: 8px;
    width: 23px;
    height: 23px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 5;
}

.ad-icons .featured-icon-small {
    background: linear-gradient(135deg, #ffd700, #ffb347);
}

.ad-icons .bump-icon-small {
    background: linear-gradient(135deg, var(--success), var(--success-dark));
}

.ad-icons .featured-icon-small img,
.ad-icons .bump-icon-small img {
    width: 23px;
    height: 23px;
    border-radius: 50%;
}
/* =========================================
   مودال فیلتر - دکمه‌های شناور چسبیده به پایین
   ========================================= */

#filterModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    z-index: 10000;
}

#filterModal .filter-modal-content {
    background: var(--card);
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 0;
    overflow: hidden;
}

.filter-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 20px;
}

/* فوتر چسبیده به پایین */
.filter-modal-footer {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-top: 0.5px solid var(--border);
    z-index: 20;
    margin-top: auto;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.reset-filter-btn,
.search-action-btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.reset-filter-btn {
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.3);
    color: var(--danger);
}

.reset-filter-btn:active {
    transform: scale(0.97);
    background: rgba(255, 59, 48, 0.2);
}

.search-action-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.search-action-btn:active {
    transform: scale(0.97);
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* =========================================
   بنر پیشنهاد نصب PWA
   ========================================= */
.pwa-install-banner {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 400px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    border: 1px solid var(--border);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
}

.pwa-banner-icon img {
    border-radius: 12px;
}

.pwa-banner-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pwa-banner-text strong {
    font-size: 14px;
    color: var(--text);
}

.pwa-banner-text span {
    font-size: 11px;
    color: var(--text-muted);
}

.pwa-install-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.pwa-install-btn:active {
    transform: scale(0.95);
}

.pwa-close-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 8px;
}

/* =========================================
   لودر اختصاصی برای ارسال کد تایید
   ========================================= */
.otp-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 20000;
}

.otp-loader-content {
    background: white;
    border-radius: 20px;
    padding: 30px 40px;
    text-align: center;
    animation: fadeInUp 0.3s ease;
}

.otp-loader .spinner {
    width: 48px;
    height: 48px;
    border: 3px solid #e5e5ea;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 15px auto;
}

.otp-loader-text {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}





/* PWA Install Banner */
.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -5px 25px rgba(0,0,0,0.1);
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.pwa-install-banner.show {
    transform: translateY(0);
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    background: white;
}

.pwa-banner-icon img {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pwa-banner-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pwa-banner-text strong {
    font-size: 15px;
    color: #333;
}

.pwa-banner-text span {
    font-size: 12px;
    color: #666;
}

.pwa-install-btn {
    background: #007aff;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.pwa-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    padding: 0 8px;
}

/* حالت installed (نصب شده) */
body.pwa-installed .pwa-install-banner {
    display: none;
}

/* استایل لوگوی سایت */
.site-logo {
    max-height: 50px;
    width: auto;
}

@media (max-width: 768px) {
    .site-logo {
        max-height: 40px;
    }
}

/* استایل چشمک زن برای هشدار تمدید */
.blink {
    animation: blink-animation 1s step-end infinite;
    background-color: #ff9500;
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
    cursor: pointer;
}

@keyframes blink-animation {
    0%, 100% { opacity: 1; background-color: #ff9500; }
    50% { opacity: 0.7; background-color: #ff3b30; }
}

.renewal-warning {
    background-color: #ff9500;
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.renewal-warning:hover {
    background-color: #ff3b30;
    transform: scale(1.05);
}

.expired-badge {
    background-color: #ff3b30;
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
}

.days-left {
    background-color: #34c759;
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
}

/* دکمه تمدید */
.btn-renew {
    background-color: #ff9500 !important;
    color: white !important;
}

/* مودال خرید بسته */
.package-modal {
    text-align: center;
}

.package-price {
    font-size: 24px;
    color: #34c759;
    font-weight: bold;
}

.package-ads {
    font-size: 18px;
    margin: 10px 0;
}

/* استایل مودال سفارشی */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    animation: fadeIn 0.3s ease;
}

.custom-modal {
    background: white;
    border-radius: 28px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s ease;
    max-width: calc(100% - 40px);
    width: 100%;
}

.modal-btn {
    padding: 14px 20px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.modal-btn-secondary {
    background: #f2f2f7;
    color: #007aff;
}

.modal-btn-secondary:hover {
    background: #e5e5ea;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* اسپینر لودر */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e5ea;
    border-top-color: #007aff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}