/* list.css - أنماط صفحة قائمة العقارات (نسخة محدثة كاملة) */

/* ---------- الشريط العلوي ---------- */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.app-name {
    font-size: 18px;
    font-weight: bold;
}

.header-icons {
    display: flex;
    gap: 10px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.icon-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* ---------- القائمة الجانبية ---------- */
.sidebar {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 1001;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.sidebar.open {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.sidebar-header h3 {
    font-size: 16px;
    color: #333;
}

.sidebar-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    transition: background 0.3s;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background: #f5f5f5;
    color: #667eea;
}

.sidebar-menu li a i {
    width: 20px;
    text-align: center;
}

.auth-sidebar-buttons {
    padding: 15px;
    border-top: 1px solid #eee;
}

/* ---------- شريط البحث والفلاتر ---------- */
.search-filter-bar {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    padding: 15px;
    background: white;
    display: flex;
    gap: 10px;
    z-index: 999;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.search-box-container {
    flex: 1;
    display: flex;
    position: relative;
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 14px;
    padding-left: 45px;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.search-btn {
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 50%;
    background: #667eea;
    color: white;
    cursor: pointer;
}

.filter-toggle-btn {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    background: white;
    color: #667eea;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    transition: all 0.3s;
}

.filter-toggle-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* ---------- لوحة الفلاتر ---------- */
.filters-panel {
    position: fixed;
    top: 125px;
    left: -100%;
    width: 100%;
    max-width: 350px;
    height: calc(100vh - 185px);
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 998;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.filters-panel.open {
    left: 0;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.filters-header h4 {
    font-size: 16px;
    color: #333;
}

.close-filters {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
}

.filters-content {
    padding: 15px;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.filter-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: white;
}

.filter-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* ---------- شريط السعر ---------- */
.price-slider-container {
    padding: 20px 10px;
}

.price-range-display {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    font-size: 14px;
    color: #667eea;
    font-weight: bold;
}

/* تنسيق noUiSlider */
.noUi-connect {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.noUi-horizontal {
    height: 8px;
}

.noUi-handle {
    width: 20px !important;
    height: 20px !important;
    border-radius: 50%;
    background: #667eea;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.noUi-handle:before,
.noUi-handle:after {
    display: none;
}

.filter-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

/* ---------- قائمة العقارات ---------- */
.properties-container {
    padding: 140px 15px 80px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.property-card-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s;
    cursor: pointer;
}

.property-card-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.property-image {
    height: 180px;
    background: #f0f0f0;
    position: relative;
    overflow: hidden;
}

.property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.property-card-item:hover .property-image img {
    transform: scale(1.05);
}

.property-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 40px;
}

.property-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.property-badge.sale {
    background: #28a745;
    color: white;
}

.property-badge.rent {
    background: #ffc107;
    color: #333;
}

.property-badge.featured {
    background: #e74c3c;
    color: white;
}

.property-info {
    padding: 15px;
}

.property-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.property-price {
    font-size: 18px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.property-details {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #666;
}

.property-details span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.property-location {
    font-size: 13px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 5px;
}

.property-actions-row {
    display: flex;
    gap: 10px;
    padding: 10px 15px;
    border-top: 1px solid #eee;
}

.property-actions-row button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-view {
    background: #667eea;
    color: white;
}

.btn-whatsapp {
    background: #25d366;
    color: white;
}

.btn-save {
    background: #eee;
    color: #666;
}

.btn-save.saved {
    background: #e74c3c;
    color: white;
}

/* ---------- رسالة عدم وجود نتائج ---------- */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-results i {
    font-size: 60px;
    color: #ddd;
    margin-bottom: 20px;
}

.no-results p {
    font-size: 16px;
    margin-bottom: 20px;
}

/* ---------- عنصر التحميل ---------- */
.loader {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ---------- الشريط السفلي ---------- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 12px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
}

.nav-item.active,
.nav-item:hover {
    color: #667eea;
}

.nav-icon {
    font-size: 18px;
}

.nav-text {
    font-size: 11px;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 5px;
    width: 18px;
    height: 18px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- المودالات ---------- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 500px;
    margin: 20px auto;
    padding: 20px;
    position: relative;
}

.modal-title {
    font-size: 18px;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.close-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    z-index: 10;
}

.close-btn:hover {
    color: #333;
}

/* ---------- بطاقة تفاصيل العقار ---------- */
.property-card {
    background: white;
    border-radius: 15px;
    max-width: 500px;
    margin: 20px auto;
    padding: 20px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.property-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.property-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.property-info .property-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.property-meta {
    font-size: 12px;
    color: #888;
}

.property-content {
    margin-bottom: 20px;
}

.property-description {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 14px;
}

.property-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.detail-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 3px;
}

.detail-value {
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

.property-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.property-actions .action-btn {
    flex: 1;
    min-width: 100px;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.property-actions .action-btn.whatsapp {
    background: #25d366;
    color: white;
}

.property-actions .action-btn.delete {
    background: #dc3545;
    color: white;
}

.property-actions .action-btn.close {
    background: #6c757d;
    color: white;
}

/* ---------- الوضع المظلم ---------- */
body.dark-mode {
    background-color: #1a1a2e;
    color: #fff;
}

body.dark-mode .top-header {
    background: linear-gradient(135deg, #2d2d44 0%, #3d3d5c 100%);
}

body.dark-mode .sidebar,
body.dark-mode .search-filter-bar,
body.dark-mode .filters-panel,
body.dark-mode .modal-content,
body.dark-mode .property-card,
body.dark-mode .bottom-nav {
    background: #2d2d44;
    color: #fff;
}

body.dark-mode .property-card-item {
    background: #2d2d44;
}

body.dark-mode .property-title,
body.dark-mode .detail-value,
body.dark-mode .sidebar-header h3,
body.dark-mode .filters-header h4,
body.dark-mode .modal-title {
    color: #fff;
}

body.dark-mode .property-details,
body.dark-mode .property-location,
body.dark-mode .filter-group label {
    color: #aaa;
}

body.dark-mode .search-input,
body.dark-mode .filter-group select {
    background: #3d3d5c;
    color: #fff;
    border-color: #4d4d6c;
}

body.dark-mode .filter-toggle-btn {
    background: #3d3d5c;
    color: #fff;
    border-color: #4d4d6c;
}

body.dark-mode .property-info,
body.dark-mode .detail-item,
body.dark-mode .property-description {
    background: #3d3d5c;
}

body.dark-mode .nav-item {
    color: #aaa;
}

body.dark-mode .nav-item.active,
body.dark-mode .nav-item:hover {
    color: #667eea;
}

body.dark-mode .sidebar-menu li a {
    color: #fff;
}

body.dark-mode .sidebar-menu li a:hover,
body.dark-mode .sidebar-menu li a.active {
    background: #3d3d5c;
}

/* ---------- التجاوبية ---------- */
@media (max-width: 768px) {
    .properties-container {
        grid-template-columns: 1fr;
        padding: 140px 10px 80px;
    }
    
    .filters-panel {
        max-width: 100%;
    }
    
    .property-details-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .app-name {
        font-size: 14px;
    }
    
    .search-filter-bar {
        padding: 10px;
    }
    
    .property-image {
        height: 150px;
    }
    
    .property-info {
        padding: 12px;
    }
    
    .property-title {
        font-size: 14px;
    }
    
    .property-price {
        font-size: 16px;
    }
}
