/* ✅ خطوط للغتين */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&family=Poppins:wght@400;600;700&display=swap');

/* ✅ إعداد عام للصفحة */
body {
  font-family: "Cairo", "Poppins", Tahoma, Arial, sans-serif;
  background: #f3f4f6;
  margin: 0;
  padding: 40px;
  color: #333;
  direction: auto;
  text-align: start;
}
/* ✅ شبكة 4 كروت في الصف - مستقلة عن .gallery الأصلية */
.gallery-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 كروت في الصف */
  gap: 20px;
  justify-content: center; /* يخلي العناصر في النص لو عددهم أقل */
}

/* ✅ إعداد كل كارت */
.gallery-4 .gallery-item {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  background: #fff;
  transition: transform 0.3s ease;
  cursor: pointer;
  max-width: 260px; /* 👈 يمنع الكارت يتمد بعرض الصفحة */
  margin: 0 auto;   /* 👈 يوسّط الكارت داخل العمود */
}

/* ✅ الصورة داخل الكارت */
.gallery-4 .gallery-item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.gallery-4 .gallery-item:hover img {
  transform: scale(1.05);
}

/* ✅ الأيقونات على الصور */
.gallery-4 .actions {
  position: absolute;
  bottom: 10px;
  inset-inline-start: 10px;
  display: flex;
  gap: 10px;
}
.gallery-4 .actions span {
  background: rgba(255,255,255,0.9);
  padding: 5px 8px;
  border-radius: 30px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.gallery-4 .actions .heart { color: #e11d48; }
.gallery-4 .actions .like { color: #2563eb; }

/* ✅ استجابة حسب حجم الشاشة (Responsive) */

/* الموبايل الصغير جدًا */
@media (max-width: 480px) {
  .gallery-4 {
    grid-template-columns: repeat(1, 1fr);
  }
}

/* الموبايل العادي */
@media (max-width: 768px) {
  .gallery-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* التابلت */
@media (max-width: 992px) {
  .gallery-4 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* الكمبيوتر واللابتوب الكبير */
@media (min-width: 993px) {
  .gallery-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}


/* ✅ الأزرار */
.top-buttons {
  text-align: center;
  margin-bottom: 30px;
}
.top-buttons button {
  border: none;
  padding: 12px 25px;
  margin: 0 8px;
  font-size: 16px;
  border-radius: 30px;
  color: #fff;
  cursor: pointer;
  transition: 0.3s ease;
}

/* الألوان */
.btn-green { background: #16a34a; }
.btn-green:hover { background: #15803d; }

.btn-blue { background: #2563eb; }
.btn-blue:hover { background: #1d4ed8; }

.btn-gold {
  background: linear-gradient(135deg, #C9A227, #f5d76e);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 8px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(212, 175, 55, 0.4);
}
.btn-gold:hover {
  background: linear-gradient(135deg, #C9A227, #f0c93d);
  box-shadow: 0 6px 14px rgba(212, 175, 55, 0.6);
  transform: translateY(-2px);
}

.btn-pink { background: #db2777; }
.btn-pink:hover { background: #be185d; }

/* ✅ الكروت */
.intro-card {
  background: #fff;
  padding: 20px;
  margin-bottom: 30px;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  text-align: center;
}
.intro-card h2 {
  margin: 0 0 10px;
  font-size: 26px;
  color: #111827;
}
.intro-card p {
  font-size: 15px;
  color: #555;
  line-height: 1.6;
}

/* ✅ معرض الصور */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}
.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  background: #fff;
  transition: transform 0.3s ease;
  cursor: pointer;
}
.gallery-item:hover { transform: translateY(-6px); }
.gallery-item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.gallery-item:hover img { transform: scale(1.05); }

/* ✅ الأيقونات على الصور */
.actions {
  position: absolute;
  bottom: 10px;
  inset-inline-start: 10px;
  display: flex;
  gap: 10px;
}
.actions span {
  background: rgba(255,255,255,0.9);
  padding: 5px 8px;
  border-radius: 30px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.actions .heart { color: #e11d48; }
.actions .like { color: #2563eb; }

/* ✅ الترقيم (Pagination) */
.custom-pagination {
  text-align: center;
  margin: 25px 0;
}
.custom-pagination ul {
  list-style: none;
  display: inline-flex;
  padding: 0;
  margin: 0;
}
.custom-pagination li { margin: 0 4px; }
.custom-pagination li a {
  display: block;
  padding: 6px 12px;
  background: #f2f2f2;
  border-radius: 4px;
  text-decoration: none;
  color: #333;
  font-size: 14px;
}
.custom-pagination li.active a {
  background: #28a745;
  color: #fff;
  font-weight: bold;
}
.custom-pagination li.disabled a {
  background: #ccc;
  pointer-events: none;
}
.custom-pagination .page-info {
  margin-top: 8px;
  font-size: 13px;
  color: #555;
}

/* ✅ نموذج الكتابة */
.topic-container {
  background: #ffffff;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  direction: inherit;
  text-align: start;
}
.topic-container h3 {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 20px;
  color: #333;
  border-bottom: 2px solid #eee;
  padding-bottom: 8px;
}
.reply-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.reply-form input[type="text"],
.reply-form input[type="file"],
.reply-form textarea {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px 15px;
  font-size: 15px;
  background: #fafafa;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
.reply-form input[type="text"]:focus,
.reply-form input[type="file"]:focus,
.reply-form textarea:focus {
  border-color: #0d6efd;
  background: #fff;
  box-shadow: 0 0 6px rgba(13,110,253,0.25);
  outline: none;
}
.reply-form button {
  align-self: flex-start;
  background: linear-gradient(45deg, #0d6efd, #0a58ca);
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  padding: 12px 25px;
  cursor: pointer;
  transition: 0.3s ease-in-out;
}
.reply-form button:hover {
  background: linear-gradient(45deg, #0a58ca, #084298);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
/* ✅ Lightbox */
#lightbox {
  display: none;
  position: fixed; /* مهم جداً */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  justify-content: center;
  align-items: center;
  text-align: center;
  z-index: 9999; /* فوق الكل */
}

#lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  box-shadow: 0 0 25px rgba(255,255,255,0.3);
  transition: transform 0.3s ease;
}

#lightbox .close {
  position: absolute;
  top: 20px;
  right: 35px;
  font-size: 40px;
  color: #fff;
  cursor: pointer;
  transition: color 0.3s ease;
}

#lightbox .close:hover {
  color: #f0c93d;
}

/* ✅ إعداد البوب أب */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center; /* 👈 دي اللي بتخلي الصورة في نص الشاشة عموديًا */
  z-index: 9999;
}

.popup-content {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  max-width: 90%;
  max-height: 90%;
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
  animation: fadeIn 0.3s ease;
}

/* ✅ الصورة داخل البوب أب */
.popup-content img {
  max-width: 100%;
  max-height: 70vh; /* 👈 يخلي الصورة كاملة بدون قص */
  object-fit: contain; /* 👈 مهم جدًا يمنع القص */
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

/* ✅ العنوان والوصف */
.popup-content h3 {
  margin-top: 15px;
  color: #333;
}

.popup-content p {
  color: #444;
  margin-top: 10px;
  line-height: 1.6;
  text-align: left;
}

/* ✅ زر الإغلاق */
.close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  background: #f87171;
  color: white;
  border: none;
  font-size: 22px;
  font-weight: bold;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 50%;
  cursor: pointer;
  transition: 0.3s ease;
}
.close-btn:hover {
  background: #dc2626;
}


.invalid-link-highlight {
    background-color: #ffdddd;
    color: red;
}


/* ✅ تأثير الدخول */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}



