/* ======================================================
   ROOT VARIABLES
====================================================== */
:root{
  --bg:#0b0d12;
  --surface:#ffffff;
  --muted:#f5f7fb;
  --text:#111827;
  --text-muted:#6b7280;

  --brand:#2563eb;
  --brand-2:#06b6d4;

  --success:#16a34a;
  --warn:#f59e0b;
  --danger:#ef4444;

  --radius:16px;
  --shadow-sm:0 1px 3px rgba(0,0,0,.06);
  --shadow-md:0 6px 20px rgba(0,0,0,.08);
}

/* ======================================================
   RESET & BASE
====================================================== */
*{box-sizing:border-box}

html{scroll-behavior:smooth}

body{
  margin:0;
  background:var(--muted);
  color:var(--text);
  line-height:1.7;
  -webkit-font-smoothing:antialiased;
  font-family:"Cairo","Tajawal",system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
}

.container{
  width:min(1200px,92%);
  margin:auto;
}

/* ======================================================
   HEADER
====================================================== */
.site-header{
  background:var(--bg);
  color:#fff;
  position:sticky;
  top:0;
  z-index:100;
  box-shadow:0 1px 0 rgba(255,255,255,.06);
}

.site-header a{
  color:inherit;
  text-decoration:none;
}

.site-header .container{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:12px 0;
}

.brand a{
  font-weight:800;
  font-size:1.3rem;
  white-space:nowrap;
}

.nav{
  display:flex;
  align-items:center;
  gap:14px;
}

.nav a{
  font-size:.95rem;
  opacity:.9;
}

.nav a:hover{opacity:1}

/* ======================================================
   MAIN
====================================================== */
.main-content{
  padding:40px 0;
}

/* ======================================================
   HERO SLIDER
====================================================== */
.hero-slider{
  position:relative;
  isolation:isolate;
  height:420px;
  overflow:hidden;
  border-bottom:1px solid #e5e7eb;
}

@media (max-width:720px){
  .hero-slider{height:360px}
}

.hero-slider .slides{
  height:100%;
  position:relative;
}

.hero-slider .slide{
  position:absolute;
  inset:0;

  /* الخلفية الصحيحة */
  background-image:var(--slide-bg, linear-gradient(135deg,#e0e7ff,#fdf2f8));
  background-size:cover;
  background-position:center;

  opacity:0;
  transform:scale(1.04);
  transition:opacity .6s ease, transform 1.2s ease;
}

.hero-slider .slide.is-active{
  opacity:1;
  transform:scale(1);
  z-index:1;
}

.hero-slider .overlay{
  position:absolute;
  inset:0;
  background:linear-gradient(to top, rgba(0,0,0,.45), rgba(0,0,0,.15));
}

.hero-slider .slide-content{
  position:relative;
  z-index:2;
  height:100%;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:10px;
  color:#fff;
}

.hero-slider h1{
  font-size:2rem;
  margin:0;
  text-shadow:0 2px 16px rgba(0,0,0,.35);
}

.hero-slider p{
  margin:0;
  color:#e5e7eb;
}

.hero-slider .cta{
  margin-top:12px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.hero-slider .slider-btn{
  position:absolute;
  top:50%;
  translate:0 -50%;
  border:0;
  width:42px;
  height:42px;
  border-radius:999px;
  background:rgba(0,0,0,.35);
  color:#fff;
  font-size:22px;
  cursor:pointer;
  display:grid;
  place-items:center;
  z-index:3;
}

.hero-slider .slider-btn:hover{
  background:rgba(0,0,0,.55);
}

.hero-slider .slider-btn.prev{inset-inline-start:14px}
.hero-slider .slider-btn.next{inset-inline-end:14px}

.hero-slider .dots{
  position:absolute;
  bottom:14px;
  inset-inline:0;
  display:flex;
  gap:8px;
  justify-content:center;
  z-index:3;
}

.hero-slider .dots button{
  width:9px;
  height:9px;
  border-radius:999px;
  border:0;
  background:rgba(255,255,255,.55);
  cursor:pointer;
}

.hero-slider .dots button.is-active{
  background:#fff;
  width:22px;
}

/* ======================================================
   COMPONENTS
====================================================== */
.btn{
  display:inline-block;
  padding:.6rem 1rem;
  border-radius:var(--radius);
  border:1px solid #ddd;
  background:#fff;
  color:var(--text);
  text-decoration:none;
  cursor:pointer;
}

.btn.primary{
  background:var(--brand);
  color:#fff;
  border-color:var(--brand);
}

.btn.warn{
  background:var(--warn);
  color:#222;
  border-color:var(--warn);
}

.btn.danger{
  background:var(--danger);
  color:#fff;
  border-color:var(--danger);
}

.grid{
  display:grid;
  gap:16px;
}

.grid.cards{
  grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
}

.card{
  background:var(--surface);
  border-radius:var(--radius);
  box-shadow:var(--shadow-sm);
  overflow:hidden;
}

.card .p{
  padding:16px;
}

.badge{
  display:inline-block;
  padding:.2rem .6rem;
  border-radius:999px;
  font-size:.75rem;
  background:#eef2ff;
  color:#1e40af;
}

.badge-text{background:#eef2ff;color:#1e40af}
.badge-audio{background:#ecfeff;color:#155e75}
.badge-video{background:#fef2f2;color:#7f1d1d}

.input, textarea, select{
  width:100%;
  padding:.6rem .8rem;
  border-radius:var(--radius);
  border:1px solid #ddd;
  background:#fff;
}

table{
  width:100%;
  border-collapse:collapse;
}

th,td{
  padding:10px;
  border-bottom:1px solid #eee;
  text-align:start;
}

.empty{
  padding:24px;
  text-align:center;
  color:var(--text-muted);
}

/* ======================================================
   FOOTER
====================================================== */
.site-footer{
  padding:24px 0;
  background:var(--bg);
  color:#bbb;
  margin-top:40px;
}
.btn:focus-visible{
  outline:2px solid var(--brand);
  outline-offset:2px;
}
.btn:focus-visible{
  outline:2px solid var(--brand);
  outline-offset:2px;
}
@media (max-width:600px){
  .hero-slider .slider-btn{
    width:36px;
    height:36px;
    font-size:18px;
  }
}
.card h3{
  overflow:hidden;
  text-overflow:ellipsis;
}
/* الأزرار الصغيرة */
.card .btn{
  padding: 11px 8px;      /* كان أكبر */
  font-size: 12px;       /* تصغير الخط */
  border-radius: 6px;    /* أنعم */
  line-height: 1.2;
}

/* الأزرار الأيقونية فقط */
.card .btn.icon-only{
  padding: 4px;          /* مربع صغير */
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.contact-form {
  padding: 24px;
}

@media (max-width: 640px) {
  .contact-form {
    padding: 16px;
  }
}
.contact-form label {
  display: block;
  margin-top: 14px;
  margin-bottom: 6px;
  font-weight: 500;
}

.contact-form .input,
.contact-form textarea {
  width: 100%;
}

.contact-form button {
  margin-top: 12px;
}
.about-hero {
  position: relative;
  padding: 120px 0;
  overflow: hidden;
}

.about-watermark{
  position: absolute;
  top: 18px;
  left: 0;
  right: 0;

  max-width: 720px;
  margin: 0 auto;

  display: flex;
  justify-content: center;
  align-items: center;

  text-align: center;

  pointer-events: none;
  user-select: none;
}

.about-watermark span{
  font-size: 120px;
  font-weight: 900;
  letter-spacing: 6px;
  line-height: 0.95;
  color: rgba(0,0,0,0.035);
}





.about-wrap {
  max-width: 1100px;
  margin: auto;
  display: grid;
  gap: 50%;
  align-items: center;
  position: relative;
  z-index: 2;
}

.about-image img {
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.18);
}

.about-label {
  display: inline-block;
  margin-bottom: 18px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #6b7f2d;
    text-transform: uppercase;
    font-size: 22px;
}


.about-content{
  font-size: 17px;
  line-height: 1.9;
  color: #2f2f2f;
}



.about-content p {
  margin-bottom: 22px;
  max-width: 460px;
  font-size: 17px;
  font-weight: 400;
  transition: color 0.35s ease;}


@media (max-width: 900px) {
  .about-wrap {
    grid-template-columns: 1fr;
    gap: 48px;
  }

}





.about-content p:hover {
  color: #1f2937;
}

/* ===============================
   ABOUT PAGE – FONT SCALE
================================ */

.about-hero{
  font-size: inherit;
  line-height: 1.9;
}

/* ===============================
   BOOKS PAGE
================================ */

.books-hero{
  position: relative;
  padding: 120px 0 140px;
  background: var(--muted);
  overflow: hidden;
}

.books-watermark{
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 180px;
  font-weight: 900;
  letter-spacing: 6px;
  color: rgba(0,0,0,0.035);
  pointer-events: none;
  user-select: none;
  text-align: center;
  line-height: 1;
}

.books-label{
  display: inline-block;
  margin-bottom: 48px;
  font-weight: 700;
  letter-spacing: 3px;
  font-size: 14px;
  color: var(--brand);
}

.books-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px,1fr));
  gap: 42px;
  max-width: 900px;
}

.book-card{
  text-align: center;
}

.book-card img{
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 20px 40px rgba(0,0,0,.15);
  transition: transform .35s ease, box-shadow .35s ease;
}

.book-card img:hover{
  transform: translateY(-6px);
  box-shadow: 0 30px 60px rgba(0,0,0,.22);
}

.book-card h3{
  margin-top: 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

/* Mobile */
@media (max-width: 768px){
  .books-watermark{
    font-size: 90px;
  }
}

/* ======================================================
   BOOKS PAGE
====================================================== */

.books-hero{
  position: relative;
  padding: 120px 0 100px;
  background: #f7f7f4;
  overflow: hidden;
}

.books-watermark{
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 180px;
  font-weight: 900;
  letter-spacing: 8px;
  color: rgba(0,0,0,0.035);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

.books-label{
  display: inline-block;
  margin-bottom: 50px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #6b7f2d;
  font-size: 13px;
}

/* GRID */
.books-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px,1fr));
  gap: 48px 36px;
}

/* CARD */
.book-card{
  text-align: center;
  transition: transform .35s ease;
}

.book-card:hover{
  transform: translateY(-6px);
}

/* COVER */




.book-card:hover img{
  transform: scale(1.06);
}

/* TITLE */
.book-title{
  margin: 16px 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
}

/* YEAR */
.book-year{
  font-size: 13px;
  color: #6b7280;
}

/* RESPONSIVE */
@media (max-width: 900px){
  .books-watermark{
    font-size: 90px;
  }
}

@media (max-width: 600px){
  .books-grid{
    grid-template-columns: repeat(2, 1fr);
    gap: 32px 20px;
  }
}
/* ===============================
   BOOKS PAGE
================================ */

.books-grid{
  margin-top: 32px;
}

.book-card{
  transition: transform .25s ease, box-shadow .25s ease;
}

.book-card:hover{
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}



.book-cover img{
  height:100%;
  border-radius:12px;
  object-fit: contain;      /* 🔥 الحل السحري */
  background:#fff;
  display:block;
}




/* ================= PAGE HERO TITLE ================= */

.page-hero-title{
  padding: 80px 0 50px;
  text-align: center;
}

.hero-title{
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 3px;
  margin: 0;
  color: #111827;
}

.hero-subtitle{
  display: inline-block;
  margin-top: 14px;
  font-size: 14px;
  letter-spacing: 4px;
  font-weight: 700;
  color: #6b7f2d;
}

/* موبايل */
@media (max-width: 768px){
  .hero-title{
    font-size: 28px;
    letter-spacing: 2px;
  }
}

.books-watermark {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 180px;
  font-weight: 900;
  letter-spacing: 6px;
  color: rgba(0,0,0,0.03);
  white-space: nowrap;
}

@media (max-width: 768px) {

  .books-watermark {
    font-size: 72px;          /* تصغير الحجم */
    letter-spacing: 2px;      /* تقليل المسافات */
    white-space: normal;      /* السماح بالكسر */
    text-align: center;
    width: 50%;
    left: 50%;
    transform: translateX(-50%);
    line-height: 1.1;
    height: 360px;
  }

}




.books-page{
  padding-top: 40px;
}



.book-cover-large{
  width:260px;
  aspect-ratio: 2 / 3;
  background:#f3f4f6;
  border-radius:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}

.book-cover-large img{
  width:100%;
  height:100%;
  object-fit: contain;
  background:#fff;
}

.book-info{
  text-align:center;
}

.book-title{
  font-size: 15px;
  font-weight: 600;
  margin: 10px 0 4px;
}

.book-year{
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.book-desc{
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}



.books-grid{
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.book-card{
  transition: transform .3s ease, box-shadow .3s ease;
}

.book-card:hover{
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,.12);
}

.book-cover{
  width:100%;
  aspect-ratio: 2 / 3;      /* نسبة كتاب حقيقية */
  background:#f3f4f6;
  overflow:hidden;
  border-radius:12px;
  display:flex;
  align-items:center;
  padding:12px;
  justify-content:center;
}

/* ===============================
   BOOK DETAILS – MOBILE FIX
================================ */

.book-cover-large {
  max-width: 260px;
}

.book-cover-large img {
  width: 100%;
  height: auto;
  object-fit: contain; /* مهم */
}

/* Hide PDF iframe on mobile */
@media (max-width: 768px) {
  #book-reader iframe {
    display: none;
  }
}

@media (max-width: 768px) {
  .book-title-main,
  .book-meta h1 {
    font-size: 22px;
    text-align: center;
  }

  .book-author-main,
  .book-desc-main {
    text-align: center;
  }
}



/* Buttons – Mobile */
@media (max-width: 768px) {
  .book-actions {
    gap: 8px;
  }

  .book-actions .btn {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 10px;
  }
}

/* ===============================
   BOOK VIEW PAGE
================================ */

.book-view{
  padding:60px 0;
}

.book-header{
  display:flex;
  gap:48px;
  align-items:flex-start;
  flex-wrap:wrap;
}

.book-cover-large{
  flex:0 0 280px;
  max-width:280px;
}

.book-cover-large img{
  width:100%;
  aspect-ratio:3/4;
  object-fit:cover;
  border-radius:16px;
  box-shadow:0 16px 40px rgba(0,0,0,.18);
}

.book-meta{
  flex:1;
  min-width:260px;
}

.book-title-main{
  font-size:32px;
  margin:0 0 8px;
}

.book-author-main{
  font-size:16px;
  color:#6b7280;
  margin-bottom:14px;
}

.book-desc-main{
  font-size:16px;
  line-height:1.7;
  max-width:640px;
  color:#374151;
}

.book-actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top:20px;
}

/* PDF */
.book-reader{
  margin-top:50px;
  border-radius:16px;
  overflow:hidden;
  box-shadow:0 10px 30px rgba(0,0,0,.12);
}

.book-reader iframe{
  width:100%;
  height:70vh;
  border:0;
}

/* AUDIO */
.book-audio{
  margin-top:40px;
}

.book-audio audio{
  width:100%;
  max-width:520px;
}

/* 📱 MOBILE */




.book-info{
  text-align:center;
}

.book-title{
  font-size:15px;
  font-weight:600;
  margin:6px 0;
}

.book-author{
  font-size:13px;
  color:#6b7280;
}

.book-year{
  font-size:12px;
  color:#9ca3af;
}

.book-desc{
  font-size:13px;
  color:#374151;
  margin-top:8px;
}
.book-header{
  display:flex;
  gap:40px;
  align-items:flex-start;
  margin-top:40px;
  flex-wrap:wrap;
}

.book-cover-large{
  flex:0 0 260px;
}
.book-cover-large img{
  width:100%;
  border-radius:16px;
  box-shadow:0 12px 30px rgba(0,0,0,.15);
  background:#fff;
}

.book-meta{
  flex:1;
  min-width:260px;
}

.book-title-main{
  font-size:34px;
  margin:0 0 10px;
}
.book-author-main{
  font-size:16px;
  color:#666;
  margin-bottom:16px;
}
.book-desc-main{
  font-size:17px;
  line-height:1.7;
  color:#444;
  max-width:650px;
}

.book-actions{
  display:flex;
  gap:12px;
  margin-top:22px;
  flex-wrap:wrap;
}


@media (max-width:768px){
  .book-cover-large{
    width:220px;
    aspect-ratio: 3 / 4;
    margin:auto;
  }
}

@media (max-width:768px){
  .pdf-viewer iframe{
    display:none;
  }
}

@media (max-width:768px){

  .book-header{
    flex-direction:column;
    align-items:center;
    text-align:center;
  }

  .book-cover-large{
    max-width:220px;
  }

  .book-title-main{
    font-size:24px;
  }

  .book-actions{
    justify-content:center;
  }

  .book-reader iframe{
    height:60vh;
  }
}


/* Buttons – Mobile */
@media (max-width: 768px) {
  .book-actions {
    gap: 8px;
  }

  .book-actions .btn {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 10px;
  }
}



/* موبايل */
@media (max-width: 768px) {
  .book-cover-large {
    max-width: 200px;
    margin: 0 auto;
  }
}


@media (max-width:768px){
  .book-header{
    flex-direction:column;
    text-align:center;
  }
  .book-cover-large{
    margin:auto;
  }
  .book-actions{
    justify-content:center;
  }
}

/* ===== Books Page ===== */

.books-page {
  padding: 60px 0;
}

.books-title {
  text-align: center;
  margin-bottom: 40px;
  font-size: 28px;
  letter-spacing: 2px;
}

/* ✅ الحل هنا */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px;

  /* أهم 3 سطور */
  max-width: 1200px;
  margin: 0 auto;
  justify-items: center;
}

.book-card {
  width: 100%;
  max-width: 300px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 25px rgba(0,0,0,.08);
  overflow: hidden;
  transition: transform .3s ease;
}

.book-card:hover {
  transform: translateY(-6px);
}

.book-cover img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  display: block;
}

.book-info {
  padding: 18px;
  text-align: center;
}

.book-info h3 {
  font-size: 18px;
  margin-bottom: 6px;
}

.book-author {
  font-size: 14px;
  color: #777;
  margin-bottom: 14px;
}

/* ===============================
   BOOK VIEW PAGE
================================ */

.book-view{
  padding:60px 0;
}

.book-header{
  display:flex;
  gap:48px;
  align-items:flex-start;
  flex-wrap:wrap;
}

.book-cover-large{
  flex:0 0 280px;
  max-width:280px;
}

.book-cover-large img{
  width:100%;
  aspect-ratio:3/4;
  object-fit:cover;
  border-radius:16px;
  box-shadow:0 16px 40px rgba(0,0,0,.18);
}

.book-meta{
  flex:1;
  min-width:260px;
}

.book-title-main{
  font-size:32px;
  margin:0 0 8px;
}

.book-author-main{
  font-size:16px;
  color:#6b7280;
  margin-bottom:14px;
}

.book-desc-main{
  font-size:16px;
  line-height:1.7;
  max-width:640px;
  color:#374151;
}

.book-actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top:20px;
}

/* PDF */
.book-reader{
  margin-top:50px;
  border-radius:16px;
  overflow:hidden;
  box-shadow:0 10px 30px rgba(0,0,0,.12);
}

.book-reader iframe{
  width:100%;
  height:70vh;
  border:0;
}

/* AUDIO */
.book-audio{
  margin-top:40px;
}

.book-audio audio{
  width:100%;
  max-width:520px;
}

/* 📱 MOBILE */
@media (max-width:768px){

  .book-header{
    flex-direction:column;
    align-items:center;
    text-align:center;
  }

  .book-cover-large{
    max-width:220px;
  }

  .book-title-main{
    font-size:24px;
  }

  .book-actions{
    justify-content:center;
  }

  .book-reader iframe{
    height:60vh;
  }
}

/* ===== BOOK VIEW ENHANCEMENTS ===== */

.book-share{
  margin-top:18px;
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  font-size:14px;
}

.share-btn{
  padding:6px 14px;
  border-radius:999px;
  font-size:13px;
  text-decoration:none;
  color:#fff;
}

.share-btn.fb{ background:#1877f2; }
.share-btn.ig{ background:#e1306c; }

@media (max-width:768px){
  .book-actions{
    justify-content:center;
  }

  .book-share{
    justify-content:center;
  }

  .book-reader iframe{
    display:none; /* PDF مخفي على الموبايل */
  }
}
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.admin-actions {
  display: flex;
  gap: 6px;
}

.table-actions {
  display: flex;
  gap: 6px;
}

.badge {
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 12px;
}

.badge.active {
  background: #ecfdf5;
  color: #065f46;
}

.badge.inactive {
  background: #fef2f2;
  color: #991b1b;
}

.btn.icon {
  padding: 4px 6px;
  font-size: 12px;
}

.btn.danger {
  background: #fee2e2;
  color: #991b1b;
}

.btn.star {
  background: #fef3c7;
  color: #92400e;
}

.btn.icon.star {
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn.icon.star.on {
  color: #facc15;
}

.btn.icon.star.off {
  color: #cbd5e1;
}



.mobile-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #000;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 0;
    z-index: 9999;

    /* أهم سطرين */
    font-size: 13px !important;
    font-family: Arial, sans-serif !important;
}

.mobile-tabs a {
    color: #fff;
    text-decoration: none;

    /* تثبيت الحجم */
    font-size: 13px !important;
    font-weight: 500;
    letter-spacing: 0.5px;

    flex: 1;
    text-align: center;
}

.mobile-tabs a.active {
    color: #4CAF50;
    font-weight: bold;
}

.mobile-tabs a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
}



