/* ============================================================
   assets/css/properties.css
   أنماط صفحة قائمة العقارات - مستوحاة من تصميم عقارماب
   ============================================================ */

/* ===== متغيرات الألوان ===== */
:root {
    --primary-dark: #1a2a3a;
    --primary-main: #0077b6;
    --primary-light: #00b4d8;
    --primary-hover: #005f8a;
    --gray-light: #f0f2f8;
    --gray-border: #e9ecef;
    --gray-text: #6c757d;
    --gray-dark: #495057;
    --white: #ffffff;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --whatsapp: #25D366;
    --shadow-sm: 0 2px 15px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 30px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 50px rgba(0,0,0,0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --transition: 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ===== شريط البحث والفلتر ===== */
.filter-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-border);
    transition: var(--transition);
}

.filter-section:hover {
    box-shadow: var(--shadow-md);
}

.filter-section .form-label {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--gray-dark);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-section .form-label i {
    color: var(--primary-main);
    font-size: 0.7rem;
}

.filter-section .form-control,
.filter-section .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-border);
    padding: 8px 12px;
    font-size: 0.9rem;
    background: #f8f9fa;
    transition: 0.3s;
}

.filter-section .form-control:focus,
.filter-section .form-select:focus {
    border-color: var(--primary-main);
    box-shadow: 0 0 0 3px rgba(0,119,182,0.12);
    background: var(--white);
}

.filter-section .form-control::placeholder {
    color: #adb5bd;
    font-size: 0.85rem;
}

.btn-filter {
    background: var(--primary-main);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 20px;
    transition: 0.3s;
    font-weight: 500;
    font-size: 0.85rem;
}

.btn-filter:hover {
    background: var(--primary-hover);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,119,182,0.25);
}

.btn-reset {
    background: var(--gray-text);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 20px;
    transition: 0.3s;
    font-weight: 500;
    font-size: 0.85rem;
}

.btn-reset:hover {
    background: #5a6268;
    color: var(--white);
    transform: translateY(-2px);
}

/* ===== شريط الأدوات ===== */
.toolbar-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 8px 0;
}

.toolbar-section .sort-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.toolbar-section .sort-group label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-dark);
    margin: 0;
}

.toolbar-section .sort-group label i {
    color: var(--primary-main);
}

.toolbar-section .sort-group select {
    border-radius: 30px;
    padding: 6px 16px;
    border: 1px solid var(--gray-border);
    font-size: 0.85rem;
    background: var(--white);
    cursor: pointer;
    outline: none;
    transition: 0.3s;
    color: var(--gray-dark);
}

.toolbar-section .sort-group select:focus {
    border-color: var(--primary-main);
    box-shadow: 0 0 0 3px rgba(0,119,182,0.12);
}

.toolbar-section .view-toggle {
    display: flex;
    gap: 4px;
    background: #f1f3f5;
    padding: 4px;
    border-radius: 30px;
}

.toolbar-section .view-toggle button {
    border: none;
    background: transparent;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gray-text);
    transition: 0.3s;
    cursor: pointer;
}

.toolbar-section .view-toggle button.active {
    background: var(--primary-main);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(0,119,182,0.2);
}

.toolbar-section .view-toggle button i {
    margin-left: 5px;
}

.toolbar-section .view-toggle button:hover:not(.active) {
    background: rgba(0,119,182,0.08);
}

.toolbar-section .result-count {
    font-size: 0.9rem;
    color: var(--gray-text);
}

.toolbar-section .result-count strong {
    color: var(--primary-dark);
}

/* ===== بطاقة العقار (Card) ===== */
.property-card {
    border: none;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    background: var(--white);
    height: 100%;
    position: relative;
}

.property-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

/* ===== صورة العقار ===== */
.property-card .image-wrapper {
    position: relative;
    overflow: hidden;
    height: 220px;
    background: #f8f9fa;
}

.property-card .image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.property-card:hover .image-wrapper img {
    transform: scale(1.06);
}

/* ===== شارات الصورة ===== */
.property-card .badge-type {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    color: var(--white);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
    z-index: 2;
    letter-spacing: 0.3px;
}

.property-card .badge-purpose {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: var(--primary-main);
    color: var(--white);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,119,182,0.3);
}

.property-card .badge-status {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.property-card .badge-status.available {
    background: var(--success);
    color: var(--white);
}

.property-card .badge-status.sold {
    background: var(--danger);
    color: var(--white);
}

.property-card .badge-status.rented {
    background: var(--warning);
    color: #212529;
}

.property-card .badge-status.reserved {
    background: #fd7e14;
    color: var(--white);
}

/* ===== شارة "جديد" ===== */
.property-card .badge-new {
    position: absolute;
    top: 55px;
    left: 12px;
    background: var(--danger);
    color: var(--white);
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.55rem;
    font-weight: 700;
    z-index: 2;
    animation: pulse-new 1.8s infinite;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@keyframes pulse-new {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.95); }
}

/* ===== عدد الصور ===== */
.property-card .image-count {
    position: absolute;
    bottom: 50px;
    right: 12px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    color: var(--white);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.6rem;
    font-weight: 500;
    z-index: 2;
}

.property-card .image-count i {
    margin-left: 4px;
}

/* ===== زر المفضلة ===== */
.property-card .favorite-btn {
    position: absolute;
    top: 12px;
    left: 55px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(4px);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    transition: 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    color: var(--gray-text);
}

.property-card .favorite-btn:hover {
    background: var(--white);
    transform: scale(1.1);
    color: var(--danger);
}

.property-card .favorite-btn.active {
    color: var(--danger);
}

/* ===== محتوى البطاقة ===== */
.property-card .card-body {
    padding: 16px;
}

.property-card .price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-main);
    line-height: 1.2;
}

.property-card .price small {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--gray-text);
}

.property-card .payment-info {
    font-size: 0.75rem;
    color: var(--gray-text);
    margin: 2px 0 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.property-card .payment-info .installment {
    color: var(--success);
    font-weight: 600;
}

.property-card .payment-info .down-payment {
    color: var(--primary-main);
    font-weight: 600;
}

.property-card .property-code {
    font-size: 0.6rem;
    color: #adb5bd;
    font-weight: 500;
    background: #f8f9fa;
    padding: 1px 8px;
    border-radius: 10px;
}

.property-card .address {
    font-size: 0.85rem;
    color: var(--gray-text);
    margin: 4px 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.property-card .address i {
    color: var(--danger);
    margin-left: 4px;
}

/* ===== المواصفات ===== */
.property-card .meta-icons {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--gray-text);
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.property-card .meta-icons i {
    margin-left: 4px;
    color: var(--primary-main);
}

.property-card .meta-icons span {
    display: flex;
    align-items: center;
    gap: 2px;
    background: #f8f9fa;
    padding: 2px 10px;
    border-radius: 12px;
}

/* ===== أزرار الإجراءات ===== */
.property-card .action-buttons {
    display: flex;
    gap: 6px;
}

.property-card .btn-details {
    border-radius: 30px;
    font-weight: 500;
    transition: 0.3s;
    font-size: 0.8rem;
    flex: 1;
    border: 1px solid var(--primary-main);
    color: var(--primary-main);
    background: transparent;
    padding: 6px 12px;
}

.property-card .btn-details:hover {
    background: var(--primary-main);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,119,182,0.2);
}

.property-card .btn-whatsapp {
    background: var(--whatsapp);
    color: var(--white);
    border: none;
    border-radius: 30px;
    transition: 0.3s;
    font-size: 0.8rem;
    width: 38px;
    padding: 0;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.property-card .btn-whatsapp:hover {
    background: #1da851;
    transform: scale(1.05);
}

/* ===== بطاقة القائمة (ListView) ===== */
.property-list-item {
    display: none;
    flex-direction: row;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: 0.35s ease;
    margin-bottom: 20px;
    height: auto;
    min-height: 200px;
}

.property-list-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.property-list-item .image-wrapper {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
    min-height: 200px;
}

.property-list-item .image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
}

.property-list-item:hover .image-wrapper img {
    transform: scale(1.04);
}

.property-list-item .card-body {
    flex: 1;
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.property-list-item .card-body .price {
    font-size: 1.5rem;
}

.property-list-item .meta-icons {
    gap: 18px;
    font-size: 0.9rem;
}

.property-list-item .action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.property-list-item .action-buttons .btn {
    border-radius: 30px;
    font-size: 0.85rem;
    padding: 6px 20px;
}

/* ===== أنيميشن البطاقات ===== */
.property-card {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.property-card:nth-child(1) { animation-delay: 0.05s; }
.property-card:nth-child(2) { animation-delay: 0.1s; }
.property-card:nth-child(3) { animation-delay: 0.15s; }
.property-card:nth-child(4) { animation-delay: 0.2s; }
.property-card:nth-child(5) { animation-delay: 0.25s; }
.property-card:nth-child(6) { animation-delay: 0.3s; }
.property-card:nth-child(7) { animation-delay: 0.35s; }
.property-card:nth-child(8) { animation-delay: 0.4s; }
.property-card:nth-child(9) { animation-delay: 0.45s; }
.property-card:nth-child(10) { animation-delay: 0.5s; }
.property-card:nth-child(11) { animation-delay: 0.55s; }
.property-card:nth-child(12) { animation-delay: 0.6s; }

.property-list-item {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.property-list-item:nth-child(1) { animation-delay: 0.05s; }
.property-list-item:nth-child(2) { animation-delay: 0.1s; }
.property-list-item:nth-child(3) { animation-delay: 0.15s; }
.property-list-item:nth-child(4) { animation-delay: 0.2s; }
.property-list-item:nth-child(5) { animation-delay: 0.25s; }
.property-list-item:nth-child(6) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== الترقيم (Pagination) ===== */
.pagination .page-link {
    color: var(--primary-main);
    border-radius: var(--radius-xs);
    margin: 0 3px;
    border: 1px solid var(--gray-border);
    transition: 0.2s;
    font-size: 0.85rem;
    padding: 6px 12px;
}

.pagination .page-link:hover {
    background: var(--primary-main);
    color: var(--white);
    border-color: var(--primary-main);
}

.pagination .page-item.active .page-link {
    background: var(--primary-main);
    border-color: var(--primary-main);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(0,119,182,0.2);
}

.pagination .page-item.disabled .page-link {
    color: var(--gray-text);
    pointer-events: none;
    opacity: 0.5;
}

/* ===== لا توجد نتائج ===== */
.no-results {
    background: var(--white);
    border-radius: var(--radius);
    padding: 60px 20px;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.no-results i {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 15px;
}

.no-results h5 {
    color: var(--gray-dark);
    font-weight: 600;
}

.no-results .btn {
    margin-top: 10px;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 15px;
}

.breadcrumb .breadcrumb-item a {
    color: var(--primary-main);
    text-decoration: none;
    font-size: 0.9rem;
}

.breadcrumb .breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb .breadcrumb-item.active {
    color: var(--gray-dark);
    font-weight: 500;
}

/* ===== عرض القائمة ===== */
.view-list .property-card {
    display: none;
}

.view-list .property-list-item {
    display: flex;
}

.view-grid .property-list-item {
    display: none;
}

.view-grid .property-card {
    display: block;
}

/* ===== التجاوب ===== */
@media (max-width: 991px) {
    .property-card .image-wrapper {
        height: 190px;
    }
}

@media (max-width: 767px) {
    .filter-section {
        padding: 15px;
    }
    
    .filter-section .row > div {
        margin-bottom: 10px;
    }
    
    .filter-section .btn {
        width: 100%;
    }
    
    .property-card .image-wrapper {
        height: 180px;
    }
    
    .property-card .meta-icons {
        font-size: 0.7rem;
        gap: 8px;
    }
    
    .property-card .meta-icons span {
        padding: 1px 8px;
    }
    
    .toolbar-section {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .toolbar-section .sort-group {
        justify-content: center;
    }
    
    .toolbar-section .view-toggle {
        justify-content: center;
    }
    
    .toolbar-section .result-count {
        text-align: center;
    }
    
    .property-list-item {
        flex-direction: column;
    }
    
    .property-list-item .image-wrapper {
        flex: 0 0 180px;
        min-height: 160px;
    }
    
    .property-list-item .card-body .price {
        font-size: 1.3rem;
    }
    
    .property-list-item .meta-icons {
        gap: 10px;
        font-size: 0.8rem;
    }
}

@media (max-width: 575px) {
    .property-card .image-wrapper {
        height: 160px;
    }
    
    .property-card .badge-type,
    .property-card .badge-purpose,
    .property-card .badge-status {
        font-size: 0.6rem;
        padding: 2px 10px;
    }
    
    .property-card .price {
        font-size: 1.1rem;
    }
    
    .property-card .address {
        font-size: 0.75rem;
    }
    
    .property-card .action-buttons .btn-details {
        font-size: 0.7rem;
        padding: 4px 10px;
    }
    
    .property-card .btn-whatsapp {
        width: 32px;
        height: 28px;
        font-size: 0.7rem;
    }
    
    .property-list-item .image-wrapper {
        flex: 0 0 140px;
        min-height: 120px;
    }
    
    .pagination .page-link {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
}

/* ===== وضع العرض (Grid/List) ===== */
/* تم تعريفه أعلاه */