@font-face {
  font-family: 'NeoSansArabic';
  src: url('fonts/NeoSansArabicMedium.ttf') format('truetype');
}

body {
  font-family: 'Tajawal', 'NeoSansArabic', sans-serif;
  background-color: #f9fbf5;
  direction: rtl;
  color: #333;
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow: hidden;
}

header {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #7A9D1D;
  padding: 15px 20px;
  color: white;
  border-bottom: 4px solid #C1D42F;
  animation: slideDown 0.8s ease forwards;
  position: relative;
  height: 80px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
#logo {
  width: 150px;
  height: 150px;
  
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
 
  object-fit: cover;
  transition: all 0.3s ease;
}

#logo:hover {
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

h1 {
  font-size: 2rem;
  font-weight: bold;
  margin: 0;
}

header h1 {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0 auto;
  text-align: center;
  transition: all 0.3s ease;
}

header:hover h1 {
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

#searchBox {
  background: white;
  padding: 10px;
  width: 300px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}



.search-container {
  display: flex;
  gap: 8px;
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px;
  border-radius: 30px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(0,0,0,0.1);
}

.search-input-group {
  flex: 1;
  position: relative;
  display: flex;
  background: #f5f5f5;
  border-radius: 20px;
  overflow: hidden;
}

#searchInput {
  flex: 1;
  border: none;
  padding: 8px 15px;
  font-size: 14px;
  outline: none;
  background: transparent;
  font-family: 'NeoSansArabic', sans-serif;
}

.btn-search {
  background: #7A9D1D;
  color: white;
  border: none;
  padding: 0 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
}

.btn-search:hover {
  background: #5a7d0d;
}

#filterSelect {
  border: none;
  border-radius: 20px;
  padding: 0 15px;
  background: #f5f5f5;
  cursor: pointer;
  font-family: 'NeoSansArabic', sans-serif;
  font-size: 14px;
  min-width: 120px;
  outline: none;
}

/* تنسيقات الشريط الجانبي */
.sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 100%;
  max-width: 400px;
  height: 100%;
  background: white;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 1001;
  transition: right 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar.show {
  right: 0;
}

.sidebar-header {
  padding: 20px;
  background: #7A9D1D;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h3 {
  margin: 0;
  font-size: 1.4rem;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px;
  transition: transform 0.2s;
}

.close-btn:hover {
  transform: rotate(90deg);
}

.sidebar-content {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

.mosque-details {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.detail-item:hover {
  background: #e9ecef;
  transform: translateX(-5px);
}

.detail-item i {
  color: #7A9D1D;
  width: 24px;
  text-align: center;
}

/* تعديلات الخريطة */
#map {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  transition: right 0.3s ease-in-out;
}

.sidebar.show ~ #map {
  right: 400px;
}

/* تعديلات مربع البحث */
#searchBox {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  transition: all 0.3s ease;
}

.sidebar.show ~ #searchBox {
  left: 20px;
  right: 420px;
}

/* تحسينات التجاوب */
@media (max-width: 768px) {
  .sidebar {
    width: 90%;
    max-width: 350px;
  }
  
  .sidebar.show ~ #map {
    right: 90%;
  }
  
  .sidebar.show ~ #searchBox {
    right: calc(90% + 20px);
  }
}

.mosque-marker {
  position: relative;
  text-align: center;
  cursor: pointer;
}

.mosque-icon {
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  width: 40px !important;
  height: 40px !important;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.mosque-icon::before {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.mosque-icon.completed::before {
  background-image: url('icons/mosque_built.png');
}

.mosque-icon.under-construction::before {
  background-image: url('icons/mosque_built.png');
}

.mosque-icon.land::before {
  background-image: url('icons/IMG-20250522-WA0022.png');
}


.mosque-name {
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 2;
  pointer-events: none;
}

.mosque-marker:hover .mosque-name {
  opacity: 1;
  visibility: visible;
  top: -30px;
}

.mosque-marker.active .mosque-name {
  opacity: 1;
  visibility: visible;
  top: -35px;
  background: #2c3e50;
}

/* أيقونة المسجد المكتمل */
.mosque-icon.completed {
  background-color: #2ecc71; /* أخضر */
}

/* أيقونة المسجد قيد البناء */
.mosque-icon.under-construction {
  background-color: #f39c12; /* برتقالي */
}

/* أيقونة أرض المسجد */
/*.mosque-icon.land {
  background-color: #b2b2b2; /* أحمر */
  /* width: 24px;
  height: 24px;
  border-radius: 0; 
}
*/
/* تأثير عند التحويم والنشط */
.mosque-marker:hover .mosque-icon,
.mosque-marker.active .mosque-icon {
  transform: scale(1.2);
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
  #searchBox {
    left: 10px;
    right: 10px;
    width: auto;
    max-width: none;
  }
  
  .sidebar {
    width: 90%;
  }
  
  .search-container {
    flex-direction: row;
    gap: 8px;
    padding: 6px;
  }
  
  #searchInput {
    padding: 6px 12px;
    font-size: 13px;
  }
  
  #filterSelect {
    font-size: 12px;
    padding: 0 10px;
    min-width: 100px;
  }
  
  .btn-search {
    padding: 0 12px;
    min-width: 36px;
  }
}

.sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: white;
  box-shadow: -2px 0 15px rgba(0,0,0,0.15);
  z-index: 2000;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  border-right: 4px solid #7A9D1D;
  overflow: hidden;
}

.sidebar.show {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
}

.sidebar-header {
  padding: 15px 20px;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h5 {
  margin: 0;
  color: #333;
  font-weight: bold;
  font-size: 16px;
}

.close-btn {
  background: #f0f0f0;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #666;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: #e0e0e0;
  color: #333;
}

.sidebar-content {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  max-height: calc(100vh - 180px);
}

.mosque-details h4 {
  color: #2c3e50;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
  font-size: 18px;
}

.details-container {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  padding-right: 5px;
  margin-right: -5px;
}

.detail-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 12px;
  padding: 12px;
  background: #f9f9f9;
  border-radius: 8px;
  transition: all 0.2s ease;
  border-right: 3px solid #7A9D1D;
}

.detail-item:hover {
  background: #f0f0f0;
  transform: translateX(-3px);
  box-shadow: 2px 2px 8px rgba(0,0,0,0.1);
}

.detail-item i {
  width: 30px;
  color: #7A9D1D;
  margin-left: 10px;
  margin-top: 3px;
  text-align: center;
  font-size: 16px;
}

.detail-content {
  flex: 1;
}

.detail-label {
  display: block;
  font-weight: bold;
  color: #555;
  font-size: 13px;
  margin-bottom: 3px;
}

.detail-value {
  display: block;
  color: #333;
  font-size: 14px;
  line-height: 1.4;
}

.icon-large {
  font-size: 50px;
  color: #7A9D1D;
  opacity: 0.7;
  margin-bottom: 15px;
}

.map-link .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 15px;
  font-size: 14px;
  border-radius: 20px;
  transition: all 0.2s ease;
}

.map-link .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

#mosqueList {
  max-height: 35vh;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px;
  background: #fefefe;
  transition: all 0.3s ease;
}

.mosque-item {
  padding: 10px 12px;
  margin-bottom: 5px;
  background: #f1fdd8;
  border-radius: 5px;
  border: 1px solid #d6e6af;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s;
}

.mosque-item:hover {
  background-color: #d8f2b5;
  transform: translateX(-4px);
}

#mosqueDetails {
  margin-top: 15px;
}

.table th, .table td {
  vertical-align: middle;
  text-align: center;
}

#map {
  height: calc(100vh - 0px); /* تعديل الارتفاع ليشمل الشاشة بالكامل */
  width: 100%;
  margin: 0;
  padding: 0;
}

.legend {
  background: white;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  z-index: 1000;
  font-size: 14px;
  border: 1px solid #eee;
  max-width: 200px;
  position: absolute;
  bottom: 20px;
  right: 20px;
}

.legend h6 {
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
  text-align: center;
  font-size: 15px;
  color: #2c3e50;
  font-weight: 600;
}

.legend-item {
  display: flex;
  align-items: center;
  margin: 12px 0;
  padding: 5px 0;
  transition: all 0.2s ease;
  border-radius: 8px;
  padding: 5px 10px;
}

.legend-item:hover {
  background-color: #f9f8fa;
}

.legend-marker {
  margin-left: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.legend-item .mosque-marker {
  transform: scale(0.8);
  margin: 0;
}

.legend-item .mosque-icon {
  width: 30px !important;
  height: 30px !important;
  margin: 0;
}

.legend-item .mosque-icon::before {
  width: 16px !important;
  height: 16px !important;
}

.legend-item span {
  flex: 1;
  color: #444;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px);}
  to { opacity: 1; transform: translateY(0);}
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

#showAllBtn {
  margin-top: 10px;
  font-weight: bold;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.btn-primary {
  background-color: #00AEEF;
  border-color: #00AEEF;
  font-weight: bold;
}

.btn-secondary {
  background-color: #C1D42F;
  border-color: #C1D42F;
  font-weight: bold;
  color: #333;
}
