/* ============================================================
   style.css – معهد بنين المنصورة النموذجي ع/ث
   Full RTL – Islamic Azhari Design – Green & Gold Theme
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&family=Amiri:ital,wght@0,400;0,700;1,400&display=swap');

/* ── CSS Variables ── */
:root {
  --green-dark  : #0F5A46;
  --green       : #14735A;
  --green-light : #5F8E7E;
  --gold        : #C9A45A;
  --gold-light  : #E2CC8E;
  --cream       : #F3E8C3;
  --black       : #1A1A1A;

  --white       : #FFFFFF;
  --bg          : #F7F5F0;
  --bg-card     : #FFFFFF;
  --text-1      : #1A1A1A;
  --text-2      : #3D3D3D;
  --text-3      : #6B6B6B;
  --border      : rgba(15,90,70,.12);

  --shadow-xs   : 0 1px 4px rgba(15,90,70,.08);
  --shadow-sm   : 0 2px 12px rgba(15,90,70,.10);
  --shadow-md   : 0 6px 28px rgba(15,90,70,.14);
  --shadow-lg   : 0 16px 56px rgba(15,90,70,.18);

  --radius-sm   : 8px;
  --radius-md   : 16px;
  --radius-lg   : 24px;
  --radius-xl   : 36px;

  --trans       : all .32s cubic-bezier(.4,0,.2,1);

  --header-h    : 72px;
  --font-main   : 'Tajawal', sans-serif;
  --font-serif  : 'Amiri', serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family   : var(--font-main);
  background    : var(--bg);
  color         : var(--text-1);
  direction     : rtl;
  line-height   : 1.7;
  overflow-x    : hidden;
}
img { max-width: 100%; display: block; }
a  { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; font-family: var(--font-main); }
input, textarea, select { font-family: var(--font-main); direction: rtl; }

/* ── Scroll Bar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--green-light); border-radius: 99px; }

/* ── Utility ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.flex      { display: flex; }
.flex-col  { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: .5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Loading Spinner ── */
.spinner-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 200px;
}
.spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--cream);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Section Title ── */
.section-title {
  text-align    : center;
  margin-bottom : 3rem;
}
.section-title .label {
  display        : inline-block;
  font-size      : .8rem;
  font-weight    : 700;
  letter-spacing : .12em;
  color          : var(--gold);
  text-transform : uppercase;
  margin-bottom  : .6rem;
}
.section-title h2 {
  font-family : var(--font-serif);
  font-size   : clamp(1.6rem, 3vw, 2.4rem);
  font-weight : 700;
  color       : var(--green-dark);
  line-height : 1.3;
}
.section-title .divider {
  width        : 80px;
  height       : 3px;
  background   : linear-gradient(90deg, var(--gold), var(--gold-light));
  margin       : .9rem auto 0;
  border-radius: 99px;
}

/* ══════════════════════════════════════════
   HEADER / NAVIGATION
══════════════════════════════════════════ */
.site-header {
  position         : fixed;
  top              : 0; right: 0; left: 0;
  z-index          : 900;
  height           : var(--header-h);
  background       : var(--green-dark);
  box-shadow       : 0 2px 20px rgba(0,0,0,.25);
  transition       : var(--trans);
}
.site-header.scrolled {
  background       : rgba(15,90,70,.97);
  backdrop-filter  : blur(16px);
}
.header-inner {
  height  : 100%;
  display : flex;
  align-items : center;
  justify-content : space-between;
  gap : 1rem;
}

/* Logo */
.site-logo {
  display     : flex;
  align-items : center;
  gap         : .75rem;
  flex-shrink : 0;
}
.logo-emblem {
  width         : 48px;
  height        : 48px;
  display       : flex;
  align-items   : center;
  justify-content: center;
  font-family   : var(--font-serif);
  font-size     : 1.3rem;
  color         : var(--green-dark);
  font-weight   : 700;
  flex-shrink   : 0;
}
.logo-text { color: var(--white); }
.logo-text .line1 { font-size: .7rem; color: var(--gold-light); }
.logo-text .line2 { font-size: .95rem; font-weight: 700; line-height: 1.1; }
.logo-text .line3 { font-size: .65rem; color: var(--cream); opacity: .8; }

/* Nav */
.main-nav { display: flex; align-items: center; gap: .25rem; }
.nav-link {
  position      : relative;
  padding       : .45rem .8rem;
  border-radius : var(--radius-sm);
  font-size     : .9rem;
  font-weight   : 500;
  color         : rgba(255,255,255,.85);
  transition    : var(--trans);
  white-space   : nowrap;
}
.nav-link::after {
  content    : '';
  position   : absolute;
  bottom     : 4px; right: 50%; left: 50%;
  height     : 2px;
  background : var(--gold);
  border-radius: 99px;
  transition : var(--trans);
}
.nav-link:hover, .nav-link.active {
  color      : var(--gold-light);
  background : rgba(255,255,255,.08);
}
.nav-link:hover::after, .nav-link.active::after {
  right: 12px; left: 12px;
}
.nav-admin {
  margin-right: .5rem;
  padding      : .45rem 1rem;
  background   : var(--gold);
  color        : var(--green-dark) !important;
  border-radius: var(--radius-sm);
  font-weight  : 700;
  font-size    : .85rem;
}
.nav-admin:hover { background: var(--gold-light); }
.nav-admin::after { display: none; }

/* Mobile menu toggle */
.menu-toggle {
  display         : none;
  flex-direction  : column;
  gap             : 5px;
  background      : none;
  border          : none;
  padding         : 6px;
  cursor          : pointer;
}
.menu-toggle span {
  display       : block;
  width         : 26px;
  height        : 2px;
  background    : var(--white);
  border-radius : 99px;
  transition    : var(--trans);
}
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav */
.mobile-nav {
  position   : fixed;
  top        : var(--header-h);
  right      : 0; left: 0;
  background : var(--green-dark);
  padding    : 1rem;
  display    : flex;
  flex-direction: column;
  gap        : .35rem;
  transform  : translateY(-110%);
  transition : var(--trans);
  z-index    : 850;
  box-shadow : 0 8px 24px rgba(0,0,0,.3);
}
.mobile-nav.open { transform: translateY(0); }
.mobile-nav .nav-link { padding: .8rem 1rem; border-radius: var(--radius-sm); }
.mobile-nav .nav-admin { text-align: center; }

/* ══════════════════════════════════════════
   PAGE HERO BANNER
══════════════════════════════════════════ */
.page-hero {
  padding-top    : calc(var(--header-h) + 3rem);
  padding-bottom : 3rem;
  text-align     : center;
  background     : linear-gradient(160deg, var(--green-dark) 0%, var(--green) 60%, var(--green-light) 100%);
  position       : relative;
  overflow       : hidden;
}
.page-hero::before {
  content   : '';
  position  : absolute;
  inset     : 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 {
  font-family : var(--font-serif);
  font-size   : clamp(1.8rem, 4vw, 3rem);
  color       : var(--white);
  margin-bottom: .75rem;
}
.page-hero p {
  color    : var(--gold-light);
  font-size: 1.05rem;
}
.breadcrumb {
  display     : flex;
  align-items : center;
  justify-content: center;
  gap         : .5rem;
  color       : rgba(255,255,255,.7);
  font-size   : .85rem;
  margin-top  : 1rem;
}
.breadcrumb a:hover { color: var(--gold-light); }
.breadcrumb .sep { color: var(--gold); }

/* ══════════════════════════════════════════
   HOME HERO
══════════════════════════════════════════ */
.home-hero {
  padding-top    : var(--header-h);
  min-height     : 100vh;
  display        : flex;
  align-items    : center;
  position       : relative;
  overflow       : hidden;
  background     : linear-gradient(145deg, var(--green-dark) 0%, var(--green) 55%, #1A8B6A 100%);
}
.home-hero::before {
  content  : '';
  position : absolute;
  inset    : 0;
  background: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.035'%3E%3Cpath d='M50 50c0-5.523 4.477-10 10-10s10 4.477 10 10-4.477 10-10 10c0 5.523-4.477 10-10 10s-10-4.477-10-10 4.477-10 10-10zM10 10c0-5.523 4.477-10 10-10s10 4.477 10 10-4.477 10-10 10c0 5.523-4.477 10-10 10S0 25.523 0 20s4.477-10 10-10zm10 46c0 5.523-4.477 10-10 10S0 61.523 0 56s4.477-10 10-10 10 4.477 10 10zm30-30c0 5.523-4.477 10-10 10s-10-4.477-10-10 4.477-10 10-10 10 4.477 10 10z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
/* Decorative circle */
.hero-deco {
  position     : absolute;
  border-radius: 50%;
  background   : rgba(201,164,90,.08);
  animation    : pulse 4s ease-in-out infinite;
}
.hero-deco.d1 { width: 500px; height: 500px; top: -100px; left: -150px; }
.hero-deco.d2 { width: 300px; height: 300px; bottom: -50px; right: 5%; animation-delay: 2s; }
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.08)} }

.home-hero .container {
  position       : relative;
  z-index        : 2;
  display        : flex;
  flex-direction  : column;
  align-items     : center;
  text-align      : center;
  gap             : 2rem;
}
.hero-badge {
  display       : inline-flex;
  align-items   : center;
  gap           : .5rem;
  padding       : .4rem 1.1rem;
  border        : 1px solid rgba(201,164,90,.4);
  border-radius : 99px;
  color         : var(--gold-light);
  font-size     : .85rem;
  backdrop-filter: blur(8px);
  background    : rgba(255,255,255,.06);
  animation     : fadeInUp .6s both;
}
.hero-emblem {
  width         : 140px;
  height        : 140px;
  display       : flex;
  align-items   : center;
  justify-content: center;
  animation     : fadeInUp .6s .1s both;
  font-family   : var(--font-serif);
  font-size     : 3.5rem;
  color         : var(--green-dark);
  font-weight   : 700;
}
.hero-emblem img { width: 100%; height: 100%; object-fit: contain; }
.hero-title {
  font-family : var(--font-serif);
  font-size   : clamp(2rem, 5vw, 3.5rem);
  color       : var(--white);
  line-height : 1.25;
  animation   : fadeInUp .6s .2s both;
}
.hero-title span { color: var(--gold-light); display: block; }
.hero-subtitle {
  color     : rgba(255,255,255,.75);
  font-size : 1.1rem;
  max-width : 520px;
  animation : fadeInUp .6s .3s both;
}
.hero-actions {
  display   : flex;
  gap       : 1rem;
  flex-wrap : wrap;
  justify-content: center;
  animation : fadeInUp .6s .4s both;
}

/* ══════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════ */
.btn {
  display       : inline-flex;
  align-items   : center;
  justify-content: center;
  gap           : .5rem;
  padding       : .7rem 1.8rem;
  border-radius : var(--radius-sm);
  font-size     : .95rem;
  font-weight   : 600;
  border        : 2px solid transparent;
  transition    : var(--trans);
  line-height   : 1;
}
.btn-primary {
  background    : var(--gold);
  color         : var(--green-dark);
  box-shadow    : 0 4px 18px rgba(201,164,90,.35);
}
.btn-primary:hover {
  background    : var(--gold-light);
  transform     : translateY(-2px);
  box-shadow    : 0 8px 28px rgba(201,164,90,.45);
}
.btn-outline {
  background    : transparent;
  color         : var(--white);
  border-color  : rgba(255,255,255,.4);
}
.btn-outline:hover {
  background    : rgba(255,255,255,.1);
  border-color  : var(--white);
}
.btn-green {
  background    : var(--green);
  color         : var(--white);
  box-shadow    : 0 4px 18px rgba(20,115,90,.3);
}
.btn-green:hover {
  background    : var(--green-dark);
  transform     : translateY(-2px);
}
.btn-ghost {
  background    : transparent;
  color         : var(--green);
  border-color  : var(--green);
}
.btn-ghost:hover { background: var(--green); color: var(--white); }
.btn-danger {
  background    : #DC2626;
  color         : var(--white);
}
.btn-danger:hover { background: #B91C1C; }
.btn-sm { padding: .5rem 1.1rem; font-size: .85rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none !important; }

/* ══════════════════════════════════════════
   SECTIONS
══════════════════════════════════════════ */
.section {
  padding : 5rem 0;
}
.section-alt {
  background : var(--cream);
}
.section-dark {
  background : var(--green-dark);
  color      : var(--white);
}
.section-dark .section-title h2 { color: var(--white); }
.section-dark .section-title .label { color: var(--gold-light); }

/* ══════════════════════════════════════════
   CARDS – NEWS
══════════════════════════════════════════ */
.news-grid {
  display               : grid;
  grid-template-columns : repeat(auto-fill, minmax(300px, 1fr));
  gap                   : 1.75rem;
}
.news-card {
  background    : var(--bg-card);
  border-radius : var(--radius-md);
  overflow      : hidden;
  box-shadow    : var(--shadow-sm);
  transition    : var(--trans);
  border        : 1px solid var(--border);
  display       : flex;
  flex-direction: column;
}
.news-card:hover {
  transform  : translateY(-6px);
  box-shadow : var(--shadow-md);
}
.news-img-wrap {
  position   : relative;
  overflow   : hidden;
  height     : 200px;
  background : var(--cream);
  cursor     : pointer;
}
.news-img-wrap img {
  width       : 100%;
  height      : 100%;
  object-fit  : cover;
  transition  : var(--trans);
}
.news-card:hover .news-img-wrap img { transform: scale(1.06); }
.news-img-placeholder {
  height          : 200px;
  display         : flex;
  align-items     : center;
  justify-content : center;
  background      : linear-gradient(135deg, var(--cream), #e8ddb5);
  font-family     : var(--font-serif);
  font-size       : 2rem;
  color           : var(--gold);
}
.news-img-count {
  position      : absolute;
  bottom        : 10px;
  left          : 10px;
  background    : rgba(0,0,0,.55);
  color         : #fff;
  padding       : .2rem .65rem;
  border-radius : 99px;
  font-size     : .78rem;
  display       : flex;
  align-items   : center;
  gap           : .3rem;
  backdrop-filter: blur(4px);
}
.news-category {
  position      : absolute;
  top           : 10px;
  right         : 10px;
  background    : var(--green);
  color         : var(--white);
  padding       : .25rem .75rem;
  border-radius : 99px;
  font-size     : .75rem;
  font-weight   : 600;
}
.news-body {
  padding  : 1.25rem;
  flex     : 1;
  display  : flex;
  flex-direction: column;
  gap      : .6rem;
}
.news-date {
  font-size : .78rem;
  color     : var(--text-3);
  display   : flex;
  align-items: center;
  gap       : .35rem;
}
.news-date svg { width: 14px; color: var(--gold); }
.news-title {
  font-weight   : 700;
  font-size     : 1rem;
  color         : var(--green-dark);
  line-height   : 1.5;
}
.news-excerpt {
  font-size  : .88rem;
  color      : var(--text-2);
  flex       : 1;
  line-height: 1.6;
}
.news-footer {
  padding        : 0 1.25rem 1.25rem;
  display        : flex;
  align-items    : center;
  justify-content: space-between;
}
.news-read-more {
  font-size   : .85rem;
  font-weight : 600;
  color       : var(--green);
  display     : flex;
  align-items : center;
  gap         : .3rem;
  transition  : var(--trans);
}
.news-read-more:hover { color: var(--gold); gap: .6rem; }

/* ══════════════════════════════════════════
   CARDS – DOWNLOADS
══════════════════════════════════════════ */
.downloads-grid {
  display               : grid;
  grid-template-columns : repeat(auto-fill, minmax(280px, 1fr));
  gap                   : 1.5rem;
}
.dl-card {
  background    : var(--bg-card);
  border-radius : var(--radius-md);
  padding       : 1.5rem;
  box-shadow    : var(--shadow-sm);
  border        : 1px solid var(--border);
  transition    : var(--trans);
  display       : flex;
  flex-direction: column;
  gap           : 1rem;
}
.dl-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.dl-card-top { display: flex; align-items: flex-start; gap: 1rem; }
.dl-icon {
  width         : 56px;
  height        : 56px;
  border-radius : var(--radius-sm);
  display       : flex;
  align-items   : center;
  justify-content: center;
  flex-shrink   : 0;
  font-size     : 1.5rem;
}
.dl-icon.pdf   { background: #FEE2E2; color: #DC2626; }
.dl-icon.image { background: var(--cream); color: var(--gold); }
.dl-icon.book  { background: #DBEAFE; color: #1D4ED8; }
.dl-icon.exam  { background: #D1FAE5; color: #059669; }
.dl-icon.result{ background: #FEF3C7; color: #D97706; }

.dl-card-img {
  width         : 100%;
  height        : 160px;
  object-fit    : cover;
  border-radius : var(--radius-sm);
  cursor        : pointer;
  transition    : var(--trans);
}
.dl-card-img:hover { opacity: .9; transform: scale(1.02); }

.dl-info { flex: 1; min-width: 0; }
.dl-title {
  font-weight : 700;
  font-size   : .95rem;
  color       : var(--green-dark);
  line-height : 1.4;
  margin-bottom: .4rem;
}
.dl-desc { font-size: .82rem; color: var(--text-3); }
.dl-tags {
  display   : flex;
  gap       : .5rem;
  flex-wrap : wrap;
}
.dl-tag {
  padding       : .2rem .7rem;
  border-radius : 99px;
  font-size     : .75rem;
  font-weight   : 600;
}
.dl-tag.type  { background: var(--cream); color: var(--green-dark); }
.dl-tag.stage { background: rgba(20,115,90,.12); color: var(--green-dark); }
.dl-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

/* ══════════════════════════════════════════
   FILTERS
══════════════════════════════════════════ */
.filters-bar {
  display    : flex;
  flex-wrap  : wrap;
  gap        : .5rem;
  margin-bottom: 2.5rem;
}
.filter-btn {
  padding       : .45rem 1.1rem;
  border-radius : 99px;
  font-size     : .85rem;
  font-weight   : 600;
  border        : 2px solid var(--border);
  background    : var(--white);
  color         : var(--text-2);
  transition    : var(--trans);
}
.filter-btn:hover { border-color: var(--green-light); color: var(--green); }
.filter-btn.active {
  background    : var(--green);
  color         : var(--white);
  border-color  : var(--green);
}
.filter-label {
  font-size   : .8rem;
  font-weight : 700;
  color       : var(--text-3);
  align-self  : center;
  margin-left : .5rem;
}

/* ══════════════════════════════════════════
   STAGES
══════════════════════════════════════════ */
.stages-grid {
  display               : grid;
  grid-template-columns : repeat(auto-fill, minmax(200px, 1fr));
  gap                   : 1.25rem;
  margin-bottom         : 3rem;
}
.stage-card {
  background     : var(--bg-card);
  border         : 2px solid var(--border);
  border-radius  : var(--radius-md);
  padding        : 1.5rem 1rem;
  text-align     : center;
  cursor         : pointer;
  transition     : var(--trans);
}
.stage-card:hover, .stage-card.active {
  border-color   : var(--green);
  background     : var(--green);
  color          : var(--white);
  transform      : translateY(-4px);
  box-shadow     : var(--shadow-md);
}
.stage-icon { font-size: 2.2rem; margin-bottom: .6rem; }
.stage-name { font-weight: 700; font-size: .95rem; }
.stage-level { font-size: .78rem; opacity: .7; margin-top: .2rem; }
.stage-content { animation: fadeIn .4s; }

/* ══════════════════════════════════════════
   SHEIKH / ABOUT
══════════════════════════════════════════ */
.sheikh-wrap {
  display   : grid;
  grid-template-columns: 1fr 2fr;
  gap       : 3rem;
  align-items: start;
}
.sheikh-photo-wrap {
  position  : sticky;
  top       : calc(var(--header-h) + 1rem);
}
.sheikh-photo {
  width         : 100%;
  aspect-ratio  : 3/4;
  object-fit    : cover;
  border-radius : var(--radius-md);
  box-shadow    : var(--shadow-md);
}
.sheikh-photo-placeholder {
  width         : 100%;
  aspect-ratio  : 3/4;
  background    : linear-gradient(135deg, var(--cream), #e8ddb5);
  border-radius : var(--radius-md);
  display       : flex;
  align-items   : center;
  justify-content: center;
  font-size     : 5rem;
}
.sheikh-name-card {
  background    : var(--green-dark);
  color         : var(--white);
  padding       : 1.25rem;
  border-radius : var(--radius-sm);
  margin-top    : 1rem;
  text-align    : center;
}
.sheikh-name-card .name { font-family: var(--font-serif); font-size: 1.2rem; font-weight: 700; }
.sheikh-name-card .role { font-size: .82rem; color: var(--gold-light); margin-top: .25rem; }
.sheikh-message-text {
  font-family   : var(--font-serif);
  font-size     : 1.15rem;
  line-height   : 2.2;
  color         : var(--text-1);
  background    : var(--bg-card);
  padding       : 2.5rem;
  border-radius : var(--radius-md);
  box-shadow    : var(--shadow-sm);
  border-right  : 5px solid var(--gold);
  position      : relative;
}
.sheikh-message-text::before {
  content     : '❝';
  font-family : serif;
  font-size   : 5rem;
  color       : var(--gold-light);
  opacity     : .3;
  position    : absolute;
  top         : 0;
  right       : 1.5rem;
  line-height : 1;
}

.about-content {
  background    : var(--bg-card);
  padding       : 2.5rem;
  border-radius : var(--radius-md);
  box-shadow    : var(--shadow-sm);
  font-size     : 1.02rem;
  line-height   : 2;
  white-space   : pre-wrap;
  border-right  : 5px solid var(--green);
}

/* ══════════════════════════════════════════
   QUICK LINKS
══════════════════════════════════════════ */
.quick-links-grid {
  display               : grid;
  grid-template-columns : repeat(auto-fill, minmax(180px, 1fr));
  gap                   : 1rem;
}
.quick-link-card {
  background     : rgba(255,255,255,.06);
  border         : 1px solid rgba(255,255,255,.12);
  border-radius  : var(--radius-md);
  padding        : 1.5rem 1rem;
  text-align     : center;
  color          : var(--white);
  cursor         : pointer;
  transition     : var(--trans);
  backdrop-filter: blur(4px);
}
.quick-link-card:hover {
  background  : rgba(255,255,255,.14);
  transform   : translateY(-4px);
  border-color: var(--gold);
}
.quick-link-card .icon { font-size: 2rem; margin-bottom: .6rem; }
.quick-link-card .label { font-size: .9rem; font-weight: 600; }

/* ══════════════════════════════════════════
   STATS BAR
══════════════════════════════════════════ */
.stats-bar {
  background    : var(--green-dark);
  padding       : 2rem 0;
}
.stats-grid {
  display               : grid;
  grid-template-columns : repeat(auto-fit, minmax(160px, 1fr));
  gap                   : 1rem;
  text-align            : center;
}
.stat-item { color: var(--white); }
.stat-item .num {
  font-family  : var(--font-serif);
  font-size    : 2.2rem;
  font-weight  : 700;
  color        : var(--gold-light);
  display      : block;
}
.stat-item .text { font-size: .85rem; color: rgba(255,255,255,.75); }

/* ══════════════════════════════════════════
   LIGHTBOX
══════════════════════════════════════════ */
.lightbox-overlay {
  position   : fixed;
  inset      : 0;
  z-index    : 2000;
  background : rgba(0,0,0,.94);
  display    : flex;
  align-items: center;
  justify-content: center;
  opacity    : 0;
  visibility : hidden;
  transition : var(--trans);
}
.lightbox-overlay.open { opacity: 1; visibility: visible; }
.lightbox-inner {
  position : relative;
  max-width: 92vw;
  max-height: 90vh;
}
.lightbox-img {
  max-width  : 88vw;
  max-height : 85vh;
  object-fit : contain;
  border-radius: var(--radius-sm);
  box-shadow : 0 20px 80px rgba(0,0,0,.8);
  animation  : lbIn .3s ease;
}
@keyframes lbIn { from{transform:scale(.85);opacity:0} to{transform:scale(1);opacity:1} }
.lightbox-close {
  position      : absolute;
  top           : -48px;
  left          : 0;
  width         : 40px;
  height        : 40px;
  border-radius : 50%;
  background    : rgba(255,255,255,.15);
  color         : #fff;
  border        : none;
  font-size     : 1.3rem;
  display       : flex;
  align-items   : center;
  justify-content: center;
  transition    : var(--trans);
  cursor        : pointer;
}
.lightbox-close:hover { background: rgba(255,255,255,.3); }
.lightbox-nav {
  position      : absolute;
  top           : 50%;
  transform     : translateY(-50%);
  width         : 44px;
  height        : 44px;
  border-radius : 50%;
  background    : rgba(255,255,255,.15);
  color         : #fff;
  border        : none;
  font-size     : 1.4rem;
  display       : flex;
  align-items   : center;
  justify-content: center;
  cursor        : pointer;
  transition    : var(--trans);
  z-index       : 10;
}
.lightbox-nav:hover { background: rgba(255,255,255,.3); }
.lightbox-nav.prev { right: calc(100% + 12px); }
.lightbox-nav.next { left:  calc(100% + 12px); }
.lightbox-counter {
  text-align  : center;
  color       : rgba(255,255,255,.7);
  font-size   : .85rem;
  margin-top  : .75rem;
}

/* ══════════════════════════════════════════
   GALLERY (Multi-image display)
══════════════════════════════════════════ */
.gallery {
  display               : grid;
  grid-template-columns : repeat(auto-fill, minmax(160px, 1fr));
  gap                   : .6rem;
  margin-top            : .75rem;
}
.gallery-thumb {
  aspect-ratio  : 1;
  object-fit    : cover;
  border-radius : var(--radius-sm);
  cursor        : pointer;
  transition    : var(--trans);
  width         : 100%;
}
.gallery-thumb:hover { opacity: .85; transform: scale(1.03); }

/* Back to top */
.back-to-top {
  position    : fixed;
  left        : 20px;
  bottom      : 20px;
  z-index     : 800;
  width       : 44px;
  height      : 44px;
  border-radius: 50%;
  background  : var(--green);
  color       : var(--white);
  border      : none;
  display     : flex;
  align-items : center;
  justify-content: center;
  box-shadow  : var(--shadow-md);
  cursor      : pointer;
  transition  : var(--trans);
  opacity     : 0;
  visibility  : hidden;
  font-size   : 1.1rem;
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--green-dark); transform: translateY(-3px); }

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
.site-footer {
  background : var(--green-dark);
  color      : rgba(255,255,255,.8);
  padding    : 4rem 0 1.5rem;
}
.footer-grid {
  display               : grid;
  grid-template-columns : 2fr 1fr 1fr;
  gap                   : 3rem;
  padding-bottom        : 3rem;
  border-bottom         : 1px solid rgba(255,255,255,.1);
}
.footer-brand .logo-emblem { margin-bottom: 1rem; }
.footer-brand p { font-size: .88rem; line-height: 1.8; color: rgba(255,255,255,.65); }
.footer-social {
  display : flex;
  gap     : .6rem;
  margin-top: 1.25rem;
}
.footer-social-btn {
  width         : 38px;
  height        : 38px;
  border-radius : 50%;
  background    : rgba(255,255,255,.1);
  display       : flex;
  align-items   : center;
  justify-content: center;
  color         : var(--white);
  font-size     : 1rem;
  transition    : var(--trans);
  text-decoration: none;
}
.footer-social-btn:hover { background: var(--gold); color: var(--green-dark); }
.footer-col h4 {
  font-size   : .95rem;
  font-weight : 700;
  color       : var(--gold-light);
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-links { display: flex; flex-direction: column; gap: .5rem; }
.footer-links a {
  font-size  : .87rem;
  color      : rgba(255,255,255,.65);
  transition : var(--trans);
  display    : flex;
  align-items: center;
  gap        : .4rem;
}
.footer-links a:hover { color: var(--gold-light); padding-right: .4rem; }
.footer-links a::before { content: '›'; color: var(--gold); }
.footer-bottom {
  display         : flex;
  align-items     : center;
  justify-content : space-between;
  flex-wrap       : wrap;
  gap             : .75rem;
  padding-top     : 1.5rem;
  font-size       : .82rem;
  color           : rgba(255,255,255,.45);
}
.footer-bottom a { color: var(--gold-light); }

/* ══════════════════════════════════════════
   ADMIN PANEL
══════════════════════════════════════════ */
.admin-body {
  background : #F1F5F9;
  min-height : 100vh;
}
.admin-login {
  min-height      : 100vh;
  display         : flex;
  align-items     : center;
  justify-content : center;
  background      : linear-gradient(145deg, var(--green-dark), var(--green));
  padding         : 1rem;
}
.login-card {
  background    : var(--white);
  border-radius : var(--radius-lg);
  padding       : 3rem;
  width         : 100%;
  max-width     : 440px;
  box-shadow    : var(--shadow-lg);
  text-align    : center;
}
.login-card .logo-emblem { margin: 0 auto 1.5rem; width: 72px; height: 72px; font-size: 2rem; }
.login-card h2 { font-family: var(--font-serif); font-size: 1.6rem; color: var(--green-dark); margin-bottom: .4rem; }
.login-card p { font-size: .88rem; color: var(--text-3); margin-bottom: 2rem; }

.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width      : 260px;
  background : var(--green-dark);
  flex-shrink: 0;
  position   : fixed;
  top        : 0; right: 0; bottom: 0;
  overflow-y : auto;
  z-index    : 100;
  display    : flex;
  flex-direction: column;
  transition : var(--trans);
}
.admin-sidebar-head {
  padding   : 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  text-align: center;
}
.admin-sidebar-head .logo-emblem { margin: 0 auto .75rem; }
.admin-sidebar-head h3 { color: var(--white); font-size: .95rem; }
.admin-sidebar-head p { color: var(--gold-light); font-size: .78rem; }
.admin-nav { flex: 1; padding: 1rem; }
.admin-nav-item {
  display       : flex;
  align-items   : center;
  gap           : .75rem;
  padding       : .75rem 1rem;
  border-radius : var(--radius-sm);
  color         : rgba(255,255,255,.75);
  cursor        : pointer;
  transition    : var(--trans);
  margin-bottom : .25rem;
  font-size     : .9rem;
  border        : none;
  background    : none;
  width         : 100%;
  text-align    : right;
}
.admin-nav-item:hover, .admin-nav-item.active {
  background  : rgba(255,255,255,.1);
  color       : var(--white);
}
.admin-nav-item.active { background: var(--gold); color: var(--green-dark); font-weight: 700; }
.admin-nav-item .icon { font-size: 1.1rem; width: 20px; flex-shrink: 0; }
.admin-sidebar-footer {
  padding : 1rem;
  border-top: 1px solid rgba(255,255,255,.1);
}
.admin-main {
  margin-right : 260px;
  flex         : 1;
  display      : flex;
  flex-direction: column;
  min-height   : 100vh;
}
.admin-topbar {
  background    : var(--white);
  padding       : 1rem 2rem;
  display       : flex;
  align-items   : center;
  justify-content: space-between;
  box-shadow    : var(--shadow-xs);
  position      : sticky;
  top           : 0;
  z-index       : 50;
}
.admin-topbar h2 { font-size: 1.1rem; font-weight: 700; color: var(--green-dark); }
.admin-user { display: flex; align-items: center; gap: .75rem; font-size: .88rem; color: var(--text-2); }
.admin-content { padding: 2rem; flex: 1; }
.admin-panel { display: none; }
.admin-panel.active { display: block; animation: fadeIn .3s; }

/* Admin cards */
.admin-card {
  background    : var(--white);
  border-radius : var(--radius-md);
  padding       : 1.5rem;
  box-shadow    : var(--shadow-xs);
  margin-bottom : 1.5rem;
}
.admin-card-head {
  display         : flex;
  align-items     : center;
  justify-content : space-between;
  margin-bottom   : 1.25rem;
  padding-bottom  : 1rem;
  border-bottom   : 1px solid var(--border);
}
.admin-card-head h3 { font-size: 1rem; font-weight: 700; color: var(--green-dark); }

/* Form fields */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display      : block;
  font-size    : .85rem;
  font-weight  : 600;
  color        : var(--text-2);
  margin-bottom: .4rem;
}
.form-control {
  width         : 100%;
  padding       : .65rem 1rem;
  border        : 2px solid var(--border);
  border-radius : var(--radius-sm);
  font-size     : .9rem;
  color         : var(--text-1);
  transition    : var(--trans);
  background    : var(--white);
}
.form-control:focus {
  outline      : none;
  border-color : var(--green);
  box-shadow   : 0 0 0 3px rgba(20,115,90,.12);
}
textarea.form-control { min-height: 120px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.img-inputs-wrap { display: flex; flex-direction: column; gap: .5rem; }
.img-input-row { display: flex; align-items: center; gap: .5rem; }
.img-input-row .form-control { flex: 1; }
.img-preview { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.img-preview img { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius-sm); cursor: pointer; }
.img-preview-single { width: 100%; max-height: 200px; object-fit: cover; border-radius: var(--radius-sm); margin-top: .5rem; cursor: pointer; }

/* Data table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align    : right;
  padding       : .75rem 1rem;
  font-size     : .82rem;
  font-weight   : 700;
  color         : var(--text-3);
  background    : #F8FAFC;
  border-bottom : 2px solid var(--border);
  white-space   : nowrap;
}
.data-table td {
  padding       : .8rem 1rem;
  font-size     : .88rem;
  border-bottom : 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:hover td { background: #F8FAFC; }
.data-table td img { width: 50px; height: 50px; object-fit: cover; border-radius: var(--radius-sm); }
.tbl-actions { display: flex; gap: .4rem; }

/* Alert messages */
.alert {
  padding       : .85rem 1.1rem;
  border-radius : var(--radius-sm);
  font-size     : .88rem;
  margin-bottom : 1rem;
  display       : flex;
  align-items   : center;
  gap           : .5rem;
}
.alert-success { background: #D1FAE5; color: #065F46; border-right: 4px solid #059669; }
.alert-error   { background: #FEE2E2; color: #991B1B; border-right: 4px solid #DC2626; }
.alert-info    { background: #DBEAFE; color: #1E40AF; border-right: 4px solid #3B82F6; }

/* Modal (Admin) */
.modal-overlay {
  position   : fixed;
  inset      : 0;
  z-index    : 1500;
  background : rgba(0,0,0,.55);
  display    : flex;
  align-items: center;
  justify-content: center;
  padding    : 1rem;
  opacity    : 0;
  visibility : hidden;
  transition : var(--trans);
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-box {
  background    : var(--white);
  border-radius : var(--radius-md);
  padding       : 2rem;
  width         : 100%;
  max-width     : 600px;
  max-height    : 90vh;
  overflow-y    : auto;
  animation     : fadeInUp .3s;
}
.modal-head {
  display         : flex;
  align-items     : center;
  justify-content : space-between;
  margin-bottom   : 1.5rem;
  padding-bottom  : 1rem;
  border-bottom   : 1px solid var(--border);
}
.modal-head h3 { font-size: 1.1rem; font-weight: 700; color: var(--green-dark); }
.modal-close {
  width         : 32px;
  height        : 32px;
  border-radius : 50%;
  border        : none;
  background    : #F1F5F9;
  color         : var(--text-2);
  cursor        : pointer;
  display       : flex;
  align-items   : center;
  justify-content: center;
  font-size     : 1.1rem;
  transition    : var(--trans);
}
.modal-close:hover { background: #E2E8F0; }

/* Empty state */
.empty-state {
  text-align  : center;
  padding     : 4rem 2rem;
  color       : var(--text-3);
}
.empty-state .icon { font-size: 3.5rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.1rem; color: var(--text-2); margin-bottom: .5rem; }
.empty-state p { font-size: .88rem; }

/* Error state */
.error-notice {
  background    : #FFF7ED;
  border        : 1px solid #FED7AA;
  border-right  : 4px solid var(--gold);
  border-radius : var(--radius-sm);
  padding       : 1rem 1.25rem;
  color         : #92400E;
  font-size     : .88rem;
  margin-bottom : 1rem;
}

/* ══════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════ */
@keyframes fadeIn       { from { opacity: 0; }                      to { opacity: 1; } }
@keyframes fadeInUp     { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown   { from { opacity: 0; transform: translateY(-24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: translateX(0); } }

.animate-fade    { animation: fadeIn    .5s both; }
.animate-up      { animation: fadeInUp  .5s both; }
.animate-up-2    { animation: fadeInUp  .5s .1s both; }
.animate-up-3    { animation: fadeInUp  .5s .2s both; }

/* Scroll-triggered reveal */
.reveal {
  opacity  : 0;
  transform: translateY(30px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .sheikh-wrap { grid-template-columns: 1fr; }
  .sheikh-photo-wrap { position: static; display: flex; gap: 1rem; align-items: center; }
  .sheikh-photo, .sheikh-photo-placeholder { width: 180px; flex-shrink: 0; }
}

@media (max-width: 768px) {
  .main-nav { display: none; }
  .menu-toggle { display: flex; }
  .news-grid { grid-template-columns: 1fr; }
  .downloads-grid { grid-template-columns: 1fr; }
  .stages-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .admin-sidebar { width: 100%; position: relative; height: auto; }
  .admin-main { margin-right: 0; }
  .admin-layout { flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr; }
  .home-hero { min-height: auto; padding-bottom: 4rem; }
  .sheikh-photo-wrap { flex-direction: column; }
  .sheikh-photo, .sheikh-photo-placeholder { width: 100%; }
}

@media (max-width: 480px) {
  .stages-grid { grid-template-columns: 1fr 1fr; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .quick-links-grid { grid-template-columns: repeat(2, 1fr); }
  .lightbox-nav.prev { right: 8px; top: auto; bottom: -56px; transform: none; }
  .lightbox-nav.next { left: 8px; top: auto; bottom: -56px; transform: none; }
}

/* ─── dynamic logo rendering ─── */
.logo-emblem img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ─── home sheikh card layout ─── */
.sheikh-home-wrap {
  display: flex;
  gap: 2.5rem;
  background: var(--white);
  padding: 2.5rem;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  border: 1px solid var(--border);
  align-items: center;
  transition: var(--trans);
}
.sheikh-home-wrap:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.08);
}
.sheikh-home-img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--gold);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  flex-shrink: 0;
}
.sheikh-home-text-side {
  flex: 1;
}

@media (max-width: 768px) {
  .sheikh-home-wrap {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
    gap: 1.5rem;
  }
  .sheikh-home-wrap .sheikh-home-text-side {
    text-align: justify;
  }
}
