/* ===========================================================================
   أنماط موقع الإعلانات المبوّبة
   =========================================================================== */

:root {
    --brand: #0d6efd;
    --brand-dark: #0a58ca;
}

body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    background-color: #f5f6f8;
    color: #212529;
}

a { color: var(--brand); }

/* بطاقة الإعلان */
.ad-card {
    border: none;
    border-radius: 14px;
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
    height: 100%;
}
.ad-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, .08);
}
.ad-card .ad-thumb {
    height: 180px;
    object-fit: cover;
    width: 100%;
    background: #e9ecef;
}
.ad-card .ad-price {
    color: var(--brand-dark);
    font-weight: 700;
}
.ad-card .badge-featured {
    position: absolute;
    top: 10px;
    inset-inline-start: 10px;
    z-index: 2;
}

/* شارة الحالة */
.badge-condition-new { background-color: #198754; }
.badge-condition-used { background-color: #6c757d; }

/* بطاقة القسم في الصفحة الرئيسية */
.category-tile {
    display: block;
    text-align: center;
    padding: 22px 10px;
    border-radius: 14px;
    background: #fff;
    color: #212529;
    text-decoration: none;
    border: 1px solid #eef0f3;
    transition: all .15s ease;
    height: 100%;
}
.category-tile:hover {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}
.category-tile i { font-size: 1.9rem; display: block; margin-bottom: 8px; }

/* معرض صور صفحة التفاصيل */
.gallery-main img {
    width: 100%;
    max-height: 460px;
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
}
.gallery-thumbs img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
}
.gallery-thumbs img.active {
    border-color: var(--brand);
}

/* خطوات إضافة الإعلان */
.steps {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.steps .step {
    flex: 1;
    min-width: 120px;
    text-align: center;
    padding: 10px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #eef0f3;
    color: #6c757d;
    font-weight: 500;
}
.steps .step.active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}
.steps .step.done {
    background: #d1e7dd;
    color: #0f5132;
    border-color: #badbcc;
}

/* لوحة التحكم */
.admin-body {
    background-color: #f0f2f5;
}
.admin-sidebar .nav-link {
    color: #495057;
    border-radius: 8px;
    margin-bottom: 4px;
}
.admin-sidebar .nav-link.active,
.admin-sidebar .nav-link:hover {
    background: var(--brand);
    color: #fff;
}
.stat-card {
    border-radius: 14px;
    border: none;
    color: #fff;
}
.stat-card .card-body {
    padding: 1rem;
}
.drag-handle:active {
    cursor: grabbing !important;
}
.sortable-fields tr.table-active {
    opacity: 0.7;
}

/* معاينة الصور قبل الرفع */
#imagePreview img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}
