/*--------------------------------------------------*/
/* تنسيق صفحة أماكن تحفيظ القرآن المستقلة */
/*--------------------------------------------------*/

/* الحاوية الرئيسية */
.quran-centers-wrapper {
    display: flex;
    gap: 30px;
    margin: 30px 0;
}

/* الشريط الجانبي للفلاتر */
.quran-centers-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.quran-filters-wrapper {
    background: #fff;
    padding: 0;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    position: sticky;
    top: 20px;
    overflow: hidden;
}

.filter-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    padding: 15px 20px;
    background: transparent;
    border-bottom: 2px solid #4caf50;
    color: #333;
}

.filter-section {
    margin-bottom: 0;
    padding: 15px 20px 20px;
}

.filter-section:last-of-type {
    padding-bottom: 20px;
}

.filter-section-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #555;
}

.filter-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1.5;
    min-height: 44px;
}

.filter-select:hover {
    border-color: #4caf50;
}

.filter-select:focus {
    border-color: #4caf50;
    outline: none;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.filter-select option {
    padding: 10px;
    white-space: normal;
    line-height: 1.4;
}

.filter-actions {
    margin-top: 0;
    padding: 15px 20px 20px;
    border-top: 1px solid #e0e0e0;
}

.clear-filters-btn {
    width: 100%;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-filters-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #333;
}

/* المحتوى الرئيسي */
.quran-centers-main {
    flex: 1;
    min-width: 0;
}

.quran-centers-header {
    margin-bottom: 20px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 4px;
}

.results-count {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* شبكة العرض */
.quran-centers-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

/* عدد الأعمدة المختلفة */
.quran-centers-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.quran-centers-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.quran-centers-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.quran-centers-grid.columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

.quran-centers-grid.columns-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* الخيار الافتراضي إذا لم يُحدد class */
.quran-centers-grid:not([class*="columns-"]) {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.quran-center-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.quran-center-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #4caf50;
}

.quran-center-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.quran-center-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.quran-center-item:hover .quran-center-image img {
    transform: scale(1.1);
}

.quran-center-title {
    font-size: 16px;
    font-weight: 600;
    margin: 15px 15px 10px;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.quran-center-category {
    margin: 0 15px 10px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.category-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
}

.online-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #e3f2fd;
    color: #1565c0;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
}

.quran-center-location {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0 15px 15px;
    font-size: 13px;
    color: #666;
}

.quran-center-location svg {
    flex-shrink: 0;
    color: #4caf50;
}

/* التصفح بالصفحات */
.quran-centers-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.quran-centers-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.quran-centers-pagination .page-numbers:hover {
    background: #f8f9fa;
    border-color: #4caf50;
    color: #4caf50;
}

.quran-centers-pagination .page-numbers.current {
    background: #4caf50;
    border-color: #4caf50;
    color: #fff;
    pointer-events: none;
}

.quran-centers-pagination .page-numbers.dots {
    border: none;
    background: transparent;
    pointer-events: none;
}

/* حالة عدم وجود نتائج */
.no-quran-centers {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.no-quran-centers p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* تنسيقات الخريطة */
#quran-centers-map {
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.charity-map-link {
    color: #4caf50;
    font-weight: 600;
    text-decoration: none;
}

.charity-map-link:hover {
    color: #388e3c;
    text-decoration: underline;
}

.charity-map-popup {
    font-size: 14px;
    line-height: 1.5;
}

.charity-map-popup .leaflet-popup-content {
    margin: 10px 12px;
    text-align: center;
}

.charity-map-popup .leaflet-popup-content-wrapper {
    border-radius: 6px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .quran-centers-grid.columns-6,
    .quran-centers-grid.columns-5 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .quran-centers-grid.columns-6,
    .quran-centers-grid.columns-5,
    .quran-centers-grid.columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .quran-centers-grid {
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .quran-centers-wrapper {
        flex-direction: column;
    }
    
    /* Sidebar يظهر أولاً */
    .quran-centers-sidebar {
        width: 100%;
        order: 1; /* ← أولاً */
        margin-bottom: 20px;
    }
    
    /* المحتوى الرئيسي ثانياً */
    .quran-centers-main {
        order: 2; /* ← ثانياً */
    }
    
    .quran-filters-wrapper {
        position: static;
    }
    
    /* تصميم منسدل في الموبايل */
    .filter-title {
        cursor: pointer;
        position: relative;
        padding-left: 45px;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    .filter-title:after {
        content: '▼';
        position: absolute;
        left: 20px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 16px;
        transition: transform 0.3s ease;
        color: #4caf50;
        font-weight: bold;
    }
    
    .filter-title.active:after {
        transform: translateY(-50%) rotate(180deg);
    }
    
    /* إخفاء المحتوى افتراضياً في الموبايل */
    .quran-filters-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
    }
    
    .quran-filters-content.active {
        max-height: 1000px; /* قيمة كبيرة للسماح بالمحتوى */
    }
    
    .quran-centers-grid.columns-6,
    .quran-centers-grid.columns-5,
    .quran-centers-grid.columns-4,
    .quran-centers-grid.columns-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quran-centers-grid {
        gap: 12px;
    }
    
    .quran-center-image {
        height: 140px;
    }
    
    .quran-center-title {
        font-size: 14px;
        margin: 12px 12px 8px;
    }
    
    .category-badge {
        font-size: 11px;
        padding: 3px 8px;
    }
}

@media (max-width: 480px) {
    .quran-centers-grid,
    .quran-centers-grid.columns-2,
    .quran-centers-grid.columns-3,
    .quran-centers-grid.columns-4,
    .quran-centers-grid.columns-5,
    .quran-centers-grid.columns-6 {
        grid-template-columns: 1fr;
    }
    
    .quran-center-image {
        height: 200px;
    }
}

/* RTL Support */
[dir="rtl"] .quran-center-location svg {
    margin-left: 0;
    margin-right: 0;
}

/* Mobile filters - initial state */
@media (max-width: 768px) {
    /* المحتوى مخفي افتراضياً في الموبايل */
    .quran-filters-content {
        display: block;
    }
}
