/* Gallery Cards */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
}

.gallery-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  height: 100%;
}

.gallery-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.gallery-image {
  position: relative;
  height: 250px;
  overflow: hidden;
}

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

.gallery-card:hover .gallery-image img {
  transform: scale(1.1);
}

.image-counter {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 2;
  backdrop-filter: blur(10px);
}

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-card:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay i {
  color: white;
  font-size: 2.5rem;
}

/* Filter Buttons */
.filter-buttons {
  margin-bottom: 3rem;
}

.filter-btn {
  background: white;
  border: 2px solid #e5e7eb;
  color: #374151;
  padding: 12px 24px;
  margin: 0 8px 8px 0;
  border-radius: 25px;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
}

.filter-btn:hover {
  border-color: #000080;
  color: #000080;
  transform: translateY(-2px);
}

.filter-btn.active {
  background: #000080;
  border-color: #000080;
  color: white;
}

/* Category Headers */
.category-header {
  text-align: center;
  margin-bottom: 2rem;
}

.category-header h2 {
  color: #1f2937;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.category-header h2 i {
  color: #000080;
  margin-left: 10px;
}

.category-header p {
  color: #6b7280;
  font-size: 1.1rem;
}

/* Quick Navigation */
.quick-nav {
  background: #f8fafc;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.quick-nav .btn {
  margin: 4px;
  border-radius: 20px;
  font-weight: 500;
}

/* Gallery Hero */
.gallery-hero {
  position: relative;
  overflow: hidden;
}

.gallery-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0, 0, 128, 0.653), rgba(0, 0, 160, 0.459));
  z-index: 1;
}

.gallery-hero .container {
  position: relative;
  z-index: 2;
}

/* Responsive */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .gallery-image {
    height: 200px;
  }
  
  .filter-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
  
  .quick-nav {
    padding: 1rem;
  }
  
  .quick-nav .btn {
    font-size: 0.85rem;
    padding: 6px 12px;
  }
}
/* Modal Styling */
#imageModal .modal-content {
  background: transparent;
  border: none;
}

#imageModal .modal-body {
  border-radius: 15px;
  overflow: hidden;
}

/* تنسيق زر الإغلاق */
.custom-close {
    background-color: #fff;
    border-radius: 50%;
    opacity: 1;
    padding: 12px;
    position: absolute;
    right: 10px;
    top: 10px;
    z-index: 1055;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: transform 0.2s;
    font-size: 1rem;
    font-weight: bold;
    color: #000;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-close:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

/* تحسين شكل الصورة داخل المودل */
#modalImage {
    max-height: 90vh;
    object-fit: contain;
}

/* إخفاء شريط التمرير عند فتح المودل */
.modal-open {
    overflow: hidden;
}

/* إزالة كلمة Modal Header */
.modal-header {
    display: flex;
    justify-content: flex-end;
}