/* ========== التخطيط العام ========== */
body {
  margin: 0;
  background: linear-gradient(180deg, #0d0d0d, #121212 60%);
  color: #d6c9b8;
  font-family: 'Noto Naskh Arabic', serif;
  line-height: 1.8;
  direction: rtl;
}

a {
  color: #b2946f;
  text-decoration: none;
  transition: color 0.3s ease;
}
a:hover { color: #ddc78a; }

/* ========== الرأس والترويسة ========== */
header {
  background: #1f1f1f;
  padding: 20px 30px;
  text-align: center;
  border-bottom: 1px solid #3a3a3a;
}
header h1 {
  font-size: 2.5rem;
  color: #b2946f;
  margin: 30px 0 0;
  font-weight: 700;
  letter-spacing: 0.1em;
  font-family: 'Amiri', serif; /* خط مختلف للعناوين */
}
nav {
  margin-top: 10px;
}
nav a {
  margin: 0 15px;
  font-weight: 600;
  font-size: 1.1rem;
}

/* ========== الأقسام والمحتوى الرئيسي ========== */
main {
  max-width: 960px;
  margin: 40px auto;
  padding: 0 20px;
}
section {
  margin-bottom: 50px;
}
section h2 {
  font-size: 2rem;
  color: #b2946f;
  border-bottom: 2px solid #7a6b4f;
  padding-bottom: 8px;
  margin-bottom: 25px;
  font-weight: 700;
  letter-spacing: 0.07em;
  font-family: 'Amiri', serif;
}

/* ========== عرض الكتب ========== */
.book-list {
  display: flex;
  flex-wrap: wrap;
  gap: 25px;
  justify-content: center;
}
.book-item {
  background: #1e1e1e;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(178, 148, 111, 0.3);
  flex: 1 1 220px;        /* مرن بدل العرض الثابت */
  max-width: 260px;
  padding: 15px;
  text-align: center;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.book-item:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 0 25px rgba(221, 199, 138, 0.6);
}
.book-item img {
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 15px;
  transition: transform 0.4s ease;
}
.book-item img:hover {
  transform: scale(1.05);
}
.book-item h3 {
  font-size: 1.3rem;
  margin: 0 0 10px;
  color: #d6c9b8;
}
.book-item p {
  font-size: 1rem;
  color: #9c8e7c; /* لون موحد للنصوص الثانوية */
  height: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========== فقرة صدى الحرف ========== */
.excerpt-shadow {
  background: linear-gradient(to left, #1b1b1b, #222);
  padding: 25px;
  border-right: 5px solid #b2946f;
  box-shadow: inset 0 0 15px #00000055;
  border-radius: 12px;
  margin-top: 20px;
  position: relative;
  font-size: 1.25rem;
  color: #e0d8cc;
  font-style: italic;
  line-height: 2;
  text-align: center;
  animation: glow 8s infinite alternate; /* لمسة أنيميشن ناعمة */
}
.excerpt-shadow::before,
.excerpt-shadow::after {
  font-size: 3rem;
  color: #7a6b4f;
  opacity: 0.2;
  position: absolute;
}
.excerpt-shadow::before {
  content: "\275D"; left : 15px; bottom: -20px;
}
.excerpt-shadow::after {
  content: "\275E"; right : 15px; top: -20px;
}
@keyframes glow {
  from { box-shadow: inset 0 0 10px #00000055; }
  to   { box-shadow: inset 0 0 20px #b2946f33; }
}

#quoteDisplay {
  background: rgba(255, 255, 255, 0.02);
  padding: 20px;
  border-right: 4px solid #b2946f;
  border-radius: 6px;
  box-shadow: 0 0 10px #b2946f44;
}

/* ========== زر العودة للأعلى ========== */
#backToTop {
  position: fixed;
  bottom: 30px;
  left: 30px;
  background: linear-gradient(135deg, #b2946f, #ddc78a);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  box-shadow: 0 0 15px #b2946f88;
  color: #121212;
  font-size: 28px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
#backToTop.show {
  opacity: 1;
  visibility: visible;
}
#backToTop:hover {
  background: linear-gradient(135deg, #ddc78a, #b2946f);
  box-shadow: 0 0 25px #ddc78a;
  transform: scale(1.1);
}

/* ========== تأثير ديل الفأرة ========== */
.trail-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  background: #b2946f;
  border-radius: 50%;
  opacity: 0.8;
  pointer-events: none;
  animation: fadeOut 0.8s linear forwards;
  z-index: 999;
}
@keyframes fadeOut {
  from { transform: scale(1); opacity: 0.8; }
  to   { transform: scale(0.2); opacity: 0; }
}

.shadow-trail {
  position: fixed;
  width: 25px;
  height: 25px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 50%;
  filter: blur(12px);
  pointer-events: none;
  opacity: 0.7;
  animation: fadeShadow 1.3s forwards;
  z-index: 998;
}
@keyframes fadeShadow {
  from { opacity: 0.7; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.4); }
}

/* ========== تذييل الصفحة ========== */
footer {
  background: #1f1f1f;
  text-align: center;
  padding: 20px;
  color: #7a6b4f;
  font-size: 0.9rem;
  border-top: 1px solid #3a3a3a;
  margin-top: 80px;
}

/* القسم يغطي كامل الشاشة */
#contact {
  height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #1e1e1e 0%, #000000 100%);
  animation: pulseBg 20s infinite alternate;
  color: #b2946f;
  font-family: 'Amiri', serif;
  position: relative;
  overflow: hidden;
}
@keyframes pulseBg {
  from { background: radial-gradient(circle at center, #1e1e1e, #000000); }
  to   { background: radial-gradient(circle at center, #2a2a2a, #000000); }
}

/* صندوق المحتوى */
.contact-inner {
  text-align: center;
  max-width: 600px;
  padding: 40px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #b2946f44;
  border-radius: 12px;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 30px rgba(178, 148, 111, 0.1);
  animation: fadeIn 3s ease-in-out;
}
.contact-inner h2 {
  font-size: 32px;
  margin-bottom: 20px;
}
.contact-inner p {
  font-size: 18px;
  line-height: 1.9;
  margin-bottom: 30px;
  color: #d6c3a6;
}
.contact-btn {
  text-decoration: none;
  color: #000;
  background-color: #b2946f;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 16px;
  transition: all 0.3s ease;
}
.contact-btn:hover {
  background-color: #d6c3a6;
  color: #000;
  letter-spacing: 1px;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* زر العودة للخلف */
#backBtn {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #1e1e1e;
  color: #b2946f;
  border: none;
  border-radius: 50%; /* توحيد الشكل مع زر العودة للأعلى */
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 1000;
  transition: background 0.3s ease, transform 0.3s ease;
}
#backBtn:hover {
  background: #2a2a2a;
  transform: scale(1.1);
}

/* ========== استجابة للهاتف ========== */
@media (max-width: 600px) {
  header h1 { font-size: 1.8rem; }
  section h2 { font-size: 1.5rem; }
  .book-item { max-width: 100%; }
  #backBtn {
    width: 38px; height: 38px;
    font-size: 0.9rem;
  }
}


/* ===== خلفية النافذة ===== */
.book-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  background: radial-gradient(circle at center, rgba(30, 20, 10, 0.95) 20%, rgba(0, 0, 0, 0.9) 90%);
  backdrop-filter: blur(4px);
  animation: fadeBackdrop 0.7s ease forwards;
}

@keyframes fadeBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== محتوى النافذة ===== */
.book-modal-content {
  position: relative;
  background: linear-gradient(145deg, #1c1b1a, #22201e);
  color: #f0e8d8;
  margin: 8% auto;
  padding: 40px 30px;
  border-radius: 20px;
  width: 85%;
  max-width: 550px;
  text-align: center;
  box-shadow: 0 0 25px rgba(255, 240, 210, 0.15);
  border: 1px solid rgba(178, 148, 111, 0.3);
  font-family: 'Noto Naskh Arabic', serif;
  animation: fadeUp 0.6s ease forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== زر الإغلاق ===== */
.close-modal {
  position: absolute;
  top: 10px;
  left: 15px;
  color: #b2946f;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s;
}
.close-modal:hover {
  color: #ffcc99;
}

/* ===== العنوان ===== */
.modal-title {
  font-size: 1.5rem;
  color: #e8d8b0;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

/* ===== الخط الفاصل ===== */
.modal-line {
  width: 40%;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin: 10px auto 20px;
}

/* ===== النص ===== */
.modal-text {
  font-size: 1.05rem;
  color: #f1e7d3;
  line-height: 2;
  text-align: justify;
  text-indent: 1.5em;
}

/* ===== الاقتباس في الأسفل ===== */
.modal-quote {
  margin-top: 25px;
  font-style: italic;
  font-size: 0.95rem;
  color: #bfa67a;
  opacity: 0.9;
}

   /* === الزر الفلسفي العميق === */
.mystic-btn {
  position: relative;
  background: linear-gradient(135deg, #2c2a28, #1a1817);
  color: #f5e8c7;
  border: 1px solid rgba(190, 164, 114, 0.4);
  border-radius: 12px;
  padding: 10px 20px;
  font-family: "Noto Naskh Arabic", serif;
  font-size: 1rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.4s ease;
  text-shadow: 0 0 5px rgba(240, 220, 180, 0.4);
  box-shadow: 0 0 10px rgba(178, 148, 111, 0.1);
}

/* وهج خفيف متدرج */
.mystic-btn::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(120deg, rgba(255,255,255,0.2), rgba(190,164,114,0.3), rgba(255,255,255,0.2));
  border-radius: 14px;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.mystic-btn:hover::before {
  opacity: 1;
}

/* حركة الضوء الداخلية */
.mystic-btn span {
  position: relative;
  z-index: 2;
  display: inline-block;
  background: linear-gradient(90deg, #b2946f, #f5e8c7, #b2946f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s infinite linear;
}

@keyframes shimmer {
  0% { background-position: -100px; }
  100% { background-position: 200px; }
}

/* عند تمرير الفأرة */
.mystic-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 25px rgba(191,166,122,0.25);
}

/* عند النقر */
.mystic-btn:active {
  transform: scale(0.98);
  box-shadow: 0 0 8px rgba(191,166,122,0.2);
}

