/* تثبيت الخطوط والألوان الفخمة الواجهة المظلمة */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}

body {
  background-color: #0b0f19; /* الخلفية الداكنة العميقة */
  direction: rtl;
  color: #ffffff;
  overflow-x: hidden;
}

/* 1. تنسيق شريط الملاحة العلوي (Navbar) */
.navbar {
  background-color: #111827;
  padding: 12px 15px;
  border-bottom: 1px solid #1f2937;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* زرار الـ 3 شرط الفخم */
.menu-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.menu-btn:hover {
  color: #3b82f6;
}

.logo {
  font-size: 20px;
  font-weight: 900;
  background: linear-gradient(135deg, #ffffff, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

.logo span {
  -webkit-text-fill-color: initial;
}

.search-box {
  flex: 1;
  max-width: 250px;
}

.search-box input {
  width: 100%;
  padding: 8px 14px;
  background-color: #1f2937;
  border: 1px solid #374151;
  border-radius: 99px;
  color: white;
  font-size: 12px;
  text-align: right;
  outline: none;
}

/* 2. هندسة القائمة الجانبية للتصنيفات (Sidebar Drawer) */
.sidebar {
  position: fixed;
  top: 0;
  right: -280px; /* مستخبي برة الشاشة تماماً في الأول */
  width: 280px;
  height: 100%;
  background-color: #111827;
  border-left: 1px solid #1f2937;
  z-index: 1000;
  transition: right 0.3s ease; /* حركة الانزلاق الناعمة */
  padding: 20px;
  box-shadow: -10px 0 25px rgba(0,0,0,0.5);
}

/* لما تفتح القائمة الجانبية */
.sidebar.active {
  right: 0;
}

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

.sidebar-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #9ca3af;
}

.close-sidebar {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 26px;
  cursor: pointer;
}

/* قائمة العناصر جوة التصنيفات */
.categories-list {
  list-style: none;
}

.categories-list li {
  padding: 12px 15px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #9ca3af;
  transition: all 0.2s;
  text-align: right;
}

.categories-list li:hover, .categories-list li.active {
  background-color: #1f2937;
  color: #3b82f6;
  padding-right: 20px; /* تأثير حركة خفيفة عند الاختيار */
}

/* غطاء التعتيم خلف القائمة */
.sidebar-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.6);
  z-index: 999;
  display: none;
}
.sidebar-overlay.active {
  display: block;
}

/* 3. تنسيق قسم الـ Hero */
.hero-section {
  text-align: center;
  padding: 30px 15px;
  max-width: 600px;
  margin: 0 auto;
}

.hero-section h2 {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 10px;
  line-height: 1.4;
}

.hero-section h2 span {
  background: linear-gradient(135deg, #3b82f6, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-section p {
  color: #9ca3af;
  font-size: 12px;
  line-height: 1.6;
}

/* حاوية الإعلانات الذكية الشفافة (لا تشغل مساحة وهي فارغة) */
.ads-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  clear: both;
}

/* 4. إعداد شبكة بنترست الخارقة (Masonry) - صورتين جنب بعض للموبايل */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 10px;
}

.masonry-grid {
  column-count: 2; /* صورتين جنب بعض بالظبط على الموبايل */
  column-gap: 12px;
  width: 100%;
}

/* لما نفتح من شاشات أوسع (كمبيوتر أو تابلت) تفرش تلقائياً لـ 3 أو 4 صور */
@media (min-width: 768px) {
  .masonry-grid { column-count: 3; column-gap: 16px; }
}
@media (min-width: 1024px) {
  .masonry-grid { column-count: 4; column-gap: 20px; }
}

/* كروت العرض الفاخرة بدون أي قص للصورة */
.prompt-card {
  background-color: #111827;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  border: 1px solid #1f2937;
  margin-bottom: 12px; /* مسافة بين الصور بالطول */
  break-inside: avoid; /* تمنع انقسام الكارت بين الأعمدة */
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.prompt-card:active {
  transform: scale(0.97);
}

.prompt-card img {
  width: 100%;
  height: auto; /* الارتفاع حر تماماً بناءً على أبعاد الصورة الأصلية (لا للقص) */
  display: block;
}

/* شريط العنوان المتراكب أسفل الصورة */
.card-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(11, 15, 25, 0.95), rgba(11, 15, 25, 0.2));
  padding: 10px;
}

.card-overlay h3 {
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

/* زرار اكتشف المزيد */
.load-more-zone {
  text-align: center;
  padding: 30px 0;
  clear: both;
}

.load-more-btn {
  background: linear-gradient(135deg, #1a73e8, #0d47a1);
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(26, 115, 232, 0.3);
}

/* 5. شاشة تفاصيل التصميم الكاملة (زيادة وقت البقاء والأرباح) */
.detail-view {
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.back-btn {
  background-color: #1f2937;
  border: 1px solid #374151;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 20px;
}

.detail-main-content {
  display: flex;
  flex-direction: column; /* فوق بعض على الموبايل لراحة اليد */
  gap: 20px;
  background-color: #111827;
  border: 1px solid #1f2937;
  border-radius: 16px;
  padding: 15px;
}

@media (min-width: 768px) {
  .detail-main-content { flex-direction: row; padding: 25px; }
}

.detail-image-box {
  flex: 1;
}

.detail-image-box img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

.detail-info-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.detail-info-box h2 {
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 15px;
}

.prompt-card-box {
  background-color: #0b0f19;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 15px;
}

.prompt-badge {
  font-size: 11px;
  color: #a855f7;
  font-weight: 700;
  display: block;
  margin-bottom: 8px;
}

.prompt-code-zone {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  color: #e5e7eb;
  direction: ltr;
  text-align: left;
  line-height: 1.5;
  max-height: 150px;
  overflow-y: auto;
  margin-bottom: 15px;
}

.copy-full-btn {
  width: 100%;
  background-color: #3b82f6;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.copy-full-btn.copied {
  background-color: #10b981;
}

/* قسم تصاميم قد تعجبك */
.related-section {
  margin-top: 40px;
  border-top: 1px solid #1f2937;
  padding-top: 25px;
}

.related-title {
  font-size: 15px;
  font-weight: 900;
  margin-bottom: 20px;
  color: #9ca3af;
}

/* الفوتر السفلي */
.main-footer {
  text-align: center;
  padding: 25px;
  color: #4b5563;
  font-size: 11px;
  border-top: 1px solid #1f2937;
  margin-top: 50px;
}

.loading-text {
  text-align: center;
  color: #6b7280;
  font-size: 13px;
  grid-column: 1 / -1;
  padding: 50px 0;
}
