/* ===================================
   تراحم آل جمجوم - Main Stylesheet
   RTL Arabic Design
   =================================== */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;600;700;800;900&family=Amiri:wght@400;700&display=swap');

:root {
  --primary: #1a4f7a;
  --primary-light: #2563a8;
  --primary-dark: #0f2f4f;
  --secondary: #e85d2a;
  --secondary-light: #f07a4a;
  --accent: #c8972a;
  --accent-light: #f0c060;
  --green: #2a7a4f;
  --teal: #2a9d8f;
  --purple: #7c3aed;
  --white: #ffffff;
  --off-white: #f8f9fa;
  --light-gray: #eef0f2;
  --gray: #6b7280;
  --dark-gray: #374151;
  --text-dark: #1a202c;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.15);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.18);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  --transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Tajawal', 'Arial', sans-serif;
  direction: rtl;
  text-align: right;
  color: var(--text-dark);
  background: var(--off-white);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; transition: var(--transition); }
img { max-width: 100%; height: auto; }
ul { list-style: none; }
button { cursor: pointer; font-family: 'Tajawal', sans-serif; }
input, textarea, select { font-family: 'Tajawal', sans-serif; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--light-gray); }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 4px; }

/* ===== TOPBAR ===== */
.topbar {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.topbar-right, .topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar a { color: rgba(255,255,255,0.85); }
.topbar a:hover { color: var(--accent-light); }
.topbar i { margin-left: 5px; }

/* ===== HEADER / NAVBAR ===== */
header {
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-md);
  border-bottom: 3px solid var(--primary);
}
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  gap: 20px;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.navbar-brand img {
  height: 60px;
  width: auto;
}
.brand-text h1 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}
.brand-text span {
  font-size: 0.8rem;
  color: var(--gray);
  font-weight: 400;
}
.nav-menu { display: flex; align-items: center; gap: 4px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dark-gray);
  transition: var(--transition);
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
  background: var(--primary);
  color: var(--white);
}
.nav-link i { font-size: 0.85rem; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.btn-login {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.9rem;
  transition: var(--transition);
}
.btn-login:hover { background: var(--primary); color: var(--white); }
.btn-register {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  background: var(--secondary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.9rem;
  transition: var(--transition);
}
.btn-register:hover { background: var(--secondary-light); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(232,93,42,0.35); }
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}
.hamburger span { display: block; width: 24px; height: 2px; background: var(--primary); border-radius: 2px; transition: var(--transition); }

/* ===== HERO SECTION ===== */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  color: var(--white);
  padding: 100px 0 80px;
  position: relative;
  overflow: hidden;
}
.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%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; position: relative; z-index: 1; }
.hero-text h1 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 900; line-height: 1.2; margin-bottom: 16px; }
.hero-text h1 span { color: var(--accent-light); }
.hero-text p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 32px; line-height: 1.8; }
.hero-btns { display: flex; gap: 16px; flex-wrap: wrap; }
.btn-hero-primary {
  padding: 14px 32px;
  background: var(--secondary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 700;
  transition: var(--transition);
  display: flex; align-items: center; gap: 8px;
}
.btn-hero-primary:hover { background: var(--secondary-light); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(232,93,42,0.4); }
.btn-hero-secondary {
  padding: 14px 32px;
  background: rgba(255,255,255,0.15);
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 700;
  transition: var(--transition);
  display: flex; align-items: center; gap: 8px;
  backdrop-filter: blur(10px);
}
.btn-hero-secondary:hover { background: rgba(255,255,255,0.25); border-color: white; }
.hero-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin-top: 40px; }
.stat-card {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}
.stat-card .num { font-size: 2rem; font-weight: 900; color: var(--accent-light); }
.stat-card .lbl { font-size: 0.85rem; opacity: 0.85; }
.hero-image { display: flex; justify-content: center; align-items: center; }
.hero-image img {
  max-width: 380px;
  width: 100%;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.3));
  animation: float 3s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

/* ===== CONTAINER ===== */
.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.section { padding: 80px 0; }
.section-alt { background: var(--white); }

/* ===== SECTION HEADER ===== */
.section-header { text-align: center; margin-bottom: 56px; }
.section-header .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 18px;
  background: rgba(26,79,122,0.1);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 14px;
}
.section-header h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 14px;
}
.section-header p {
  font-size: 1.05rem;
  color: var(--gray);
  max-width: 600px;
  margin: 0 auto;
}
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  max-width: 80px;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--primary));
}
.divider::after { background: linear-gradient(to left, transparent, var(--primary)); }
.divider-icon { color: var(--secondary); font-size: 1.1rem; }

/* ===== CARDS GRID ===== */
.cards-grid { display: grid; gap: 24px; }
.cards-grid-2 { grid-template-columns: repeat(2,1fr); }
.cards-grid-3 { grid-template-columns: repeat(3,1fr); }
.cards-grid-4 { grid-template-columns: repeat(4,1fr); }

/* ===== MAIN CARD ===== */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  border: 1px solid var(--border);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-xl); }
.card-img { position: relative; overflow: hidden; aspect-ratio: 16/9; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.card:hover .card-img img { transform: scale(1.06); }
.card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--primary);
  color: white;
}
.card-body { padding: 20px; }
.card-date { font-size: 0.82rem; color: var(--gray); margin-bottom: 8px; display: flex; align-items: center; gap: 5px; }
.card-title { font-size: 1.05rem; font-weight: 700; color: var(--primary-dark); margin-bottom: 10px; line-height: 1.4; }
.card-text { font-size: 0.9rem; color: var(--gray); line-height: 1.7; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }

/* ===== NAVIGATION SECTIONS ===== */
.sections-nav { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }
.section-nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 20px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 2px solid transparent;
  transition: var(--transition);
  cursor: pointer;
  gap: 12px;
}
.section-nav-card:hover, .section-nav-card.active {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}
.section-nav-card .icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
}
.icon-blue { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }
.icon-red { background: linear-gradient(135deg, var(--secondary), #ff6b35); }
.icon-gold { background: linear-gradient(135deg, var(--accent), var(--accent-light)); }
.icon-green { background: linear-gradient(135deg, var(--green), #3dbb75); }
.icon-teal { background: linear-gradient(135deg, var(--teal), #4ecdc4); }
.icon-purple { background: linear-gradient(135deg, var(--purple), #a78bfa); }
.icon-indigo { background: linear-gradient(135deg, #4338ca, #818cf8); }
.icon-pink { background: linear-gradient(135deg, #db2777, #f472b6); }
.section-nav-card h3 { font-size: 0.95rem; font-weight: 700; color: var(--primary-dark); }
.section-nav-card p { font-size: 0.8rem; color: var(--gray); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-family: 'Tajawal', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(26,79,122,0.3); }
.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { background: var(--secondary-light); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-sm { padding: 7px 16px; font-size: 0.85rem; }
.btn-lg { padding: 14px 36px; font-size: 1.05rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-ghost { background: transparent; border: none; color: var(--primary); }
.btn-ghost:hover { background: rgba(26,79,122,0.08); }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--green); color: white; }
.btn-success:hover { background: #1d6b40; }

/* ===== QUOTE / BANNER ===== */
.quote-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 60px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.quote-banner::before {
  content: '"';
  position: absolute;
  font-family: 'Amiri', serif;
  font-size: 300px;
  opacity: 0.04;
  top: -60px;
  right: 40px;
  line-height: 1;
}
.quote-banner blockquote {
  font-family: 'Amiri', serif;
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  line-height: 1.8;
  margin-bottom: 12px;
  position: relative;
}
.quote-banner cite { font-size: 0.95rem; opacity: 0.75; font-style: normal; }

/* ===== PAGE HERO ===== */
.page-hero {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  padding: 70px 0 50px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-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='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='40' cy='40' r='6'/%3E%3C/g%3E%3C/svg%3E");
}
.page-hero-content { position: relative; z-index: 1; }
.page-hero h1 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); font-weight: 900; margin-bottom: 12px; }
.page-hero p { font-size: 1.1rem; opacity: 0.85; max-width: 600px; margin: 0 auto 20px; }
.breadcrumb {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  opacity: 0.8;
  margin-top: 16px;
}
.breadcrumb a { color: var(--accent-light); }
.breadcrumb span { opacity: 0.6; }

/* ===== TABS ===== */
.tabs-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: var(--light-gray);
  border-radius: var(--radius-full);
  margin-bottom: 32px;
  overflow-x: auto;
}
.tab-btn {
  padding: 9px 22px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray);
  transition: var(--transition);
  white-space: nowrap;
  display: flex; align-items: center; gap: 7px;
}
.tab-btn.active, .tab-btn:hover { background: white; color: var(--primary); box-shadow: var(--shadow-sm); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-weight: 600; margin-bottom: 7px; color: var(--dark-gray); font-size: 0.95rem; }
.form-label span { color: var(--secondary); margin-right: 3px; }
.form-control {
  width: 100%;
  padding: 11px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-family: 'Tajawal', sans-serif;
  font-size: 0.95rem;
  color: var(--text-dark);
  background: var(--white);
  transition: var(--transition);
  direction: rtl;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,79,122,0.12); }
.form-control::placeholder { color: #9ca3af; }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 14px center; padding-left: 40px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 0.82rem; color: var(--gray); margin-top: 5px; }
.form-error { font-size: 0.82rem; color: #dc2626; margin-top: 5px; display: none; }
.form-control.error { border-color: #dc2626; }
.form-control.error + .form-error { display: block; }

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; animation: fadeIn 0.25s ease; }
.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 0;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s cubic-bezier(0.4,0,0.2,1);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.2rem; font-weight: 800; color: var(--primary-dark); }
.modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--light-gray);
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  color: var(--gray);
  cursor: pointer;
  transition: var(--transition);
}
.modal-close:hover { background: var(--border); color: var(--text-dark); }
.modal-body { padding: 24px 28px; }
.modal-footer { padding: 16px 28px 24px; display: flex; gap: 12px; }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ===== ALERTS ===== */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.alert-success { background: #dcfce7; border: 1px solid #86efac; color: #15803d; }
.alert-error { background: #fee2e2; border: 1px solid #fca5a5; color: #b91c1c; }
.alert-info { background: #dbeafe; border: 1px solid #93c5fd; color: #1d4ed8; }
.alert-warning { background: #fef3c7; border: 1px solid #fcd34d; color: #92400e; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
}
.badge-primary { background: rgba(26,79,122,0.12); color: var(--primary); }
.badge-secondary { background: rgba(232,93,42,0.12); color: var(--secondary); }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-info { background: #dbeafe; color: #1d4ed8; }

/* ===== PROGRESS BAR ===== */
.progress { height: 8px; background: var(--light-gray); border-radius: var(--radius-full); overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light)); border-radius: var(--radius-full); transition: width 1.2s cubic-bezier(0.4,0,0.2,1); }
.progress-bar-secondary { background: linear-gradient(90deg, var(--secondary), var(--secondary-light)); }
.progress-bar-success { background: linear-gradient(90deg, var(--green), #3dbb75); }

/* ===== TIMELINE ===== */
.timeline { position: relative; padding-right: 28px; }
.timeline::before { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 32px; }
.timeline-item::before {
  content: '';
  position: absolute;
  right: -35px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid white;
  box-shadow: 0 0 0 2px var(--primary);
}
.timeline-date { font-size: 0.82rem; color: var(--gray); font-weight: 600; margin-bottom: 6px; }
.timeline-content { background: var(--white); padding: 16px 20px; border-radius: var(--radius-md); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }

/* ===== STATS STRIP ===== */
.stats-strip { background: var(--primary); color: white; padding: 50px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 40px; }
.stat-item { text-align: center; }
.stat-item .number { font-size: 2.8rem; font-weight: 900; color: var(--accent-light); display: block; line-height: 1; }
.stat-item .label { font-size: 0.95rem; opacity: 0.85; margin-top: 6px; }

/* ===== FAMILY TREE ===== */
.family-tree-container {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  overflow-x: auto;
}
.tree-wrap { min-width: 800px; }
.tree-node {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.tree-person {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 20px;
  background: var(--white);
  border: 2px solid var(--primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  min-width: 120px;
  text-align: center;
}
.tree-person:hover { background: var(--primary); color: white; transform: scale(1.05); }
.tree-person .avatar-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 1.2rem;
  margin-bottom: 8px;
}
.tree-person .name { font-size: 0.85rem; font-weight: 700; line-height: 1.3; }
.tree-person .gen { font-size: 0.75rem; color: var(--gray); }
.tree-person:hover .gen { color: rgba(255,255,255,0.8); }

/* ===== PHOTO GALLERY ===== */
.gallery-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.gallery-item:hover img { transform: scale(1.08); }
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  opacity: 0;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px;
  color: white;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }

/* ===== PERSON CARD ===== */
.person-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.person-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-xl); }
.person-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem;
  color: white;
  margin: 0 auto 16px;
  border: 4px solid var(--light-gray);
}
.person-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--primary-dark); margin-bottom: 4px; }
.person-card .role { font-size: 0.88rem; color: var(--secondary); font-weight: 600; margin-bottom: 12px; }
.person-card p { font-size: 0.88rem; color: var(--gray); line-height: 1.6; }

/* ===== SIDEBAR ===== */
.sidebar-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}
.sidebar-card h3 { font-size: 1rem; font-weight: 700; color: var(--primary-dark); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--primary); display: flex; align-items: center; gap: 8px; }

/* ===== DONATION CARD ===== */
.donation-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--border);
  transition: var(--transition);
}
.donation-card:hover { border-color: var(--primary); }
.donation-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.donation-amount { font-size: 1.6rem; font-weight: 900; color: var(--secondary); }
.donation-progress { margin: 16px 0; }
.donation-goal { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--gray); margin-bottom: 8px; }

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  font-size: 0.92rem;
  font-weight: 600;
  min-width: 280px;
  border-right: 4px solid var(--primary);
  animation: slideInLeft 0.3s ease;
  transition: var(--transition);
}
.toast.success { border-right-color: var(--green); }
.toast.error { border-right-color: #dc2626; }
.toast.warning { border-right-color: var(--accent); }
.toast-icon { font-size: 1.1rem; }
.toast.success .toast-icon { color: var(--green); }
.toast.error .toast-icon { color: #dc2626; }
.toast.warning .toast-icon { color: var(--accent); }
@keyframes slideInLeft { from { transform: translateX(-40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== FOOTER ===== */
footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.85);
  padding: 60px 0 0;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-brand img { height: 56px; margin-bottom: 16px; }
.footer-brand p { font-size: 0.92rem; line-height: 1.8; opacity: 0.8; }
.footer-social { display: flex; gap: 10px; margin-top: 20px; }
.social-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  color: white;
  transition: var(--transition);
  font-size: 0.95rem;
}
.social-btn:hover { background: var(--primary-light); transform: translateY(-2px); }
.footer-links h4 { font-size: 1rem; font-weight: 700; color: white; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid rgba(255,255,255,0.15); }
.footer-links ul { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { font-size: 0.9rem; color: rgba(255,255,255,0.7); transition: var(--transition); display: flex; align-items: center; gap: 6px; }
.footer-links a:hover { color: var(--accent-light); padding-right: 4px; }
.footer-links a i { font-size: 0.75rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  opacity: 0.65;
}

/* ===== SEARCH BAR ===== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  transition: var(--transition);
}
.search-bar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,79,122,0.12); }
.search-bar input {
  flex: 1;
  padding: 12px 18px;
  border: none;
  background: transparent;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.95rem;
  color: var(--text-dark);
  outline: none;
}
.search-bar button {
  padding: 12px 20px;
  background: var(--primary);
  border: none;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}
.search-bar button:hover { background: var(--primary-light); }

/* ===== ADMIN PANEL ===== */
.admin-sidebar {
  width: 260px;
  background: var(--primary-dark);
  min-height: 100vh;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 500;
  overflow-y: auto;
  transition: transform 0.3s;
}
.admin-main { margin-right: 260px; min-height: 100vh; background: var(--off-white); }
.admin-sidebar-header { padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.admin-sidebar-header img { height: 48px; }
.admin-nav { padding: 16px 12px; }
.admin-nav-group { margin-bottom: 20px; }
.admin-nav-group-label { font-size: 0.75rem; font-weight: 700; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 0.1em; padding: 0 8px; margin-bottom: 8px; }
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: rgba(255,255,255,0.7);
  font-size: 0.92rem;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: right;
}
.admin-nav-link:hover, .admin-nav-link.active { background: rgba(255,255,255,0.12); color: white; }
.admin-nav-link i { width: 20px; text-align: center; font-size: 0.95rem; }
.admin-header {
  background: var(--white);
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.admin-content { padding: 28px; }
.admin-section { display: none; }
.admin-section.active { display: block; }
.admin-stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.admin-stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); }
.admin-stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  color: white;
  flex-shrink: 0;
}
.admin-stat-info .value { font-size: 1.8rem; font-weight: 900; color: var(--text-dark); line-height: 1; }
.admin-stat-info .lbl { font-size: 0.88rem; color: var(--gray); margin-top: 4px; }
.admin-table-wrap { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden; border: 1px solid var(--border); }
.admin-table-header { padding: 18px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.admin-table-header h3 { font-size: 1rem; font-weight: 700; color: var(--primary-dark); }
table { width: 100%; border-collapse: collapse; }
th { background: var(--off-white); padding: 12px 16px; font-size: 0.85rem; font-weight: 700; color: var(--gray); text-align: right; border-bottom: 1px solid var(--border); }
td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 0.9rem; color: var(--dark-gray); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--off-white); }

/* ===== USER MENU ===== */
.user-menu {
  position: relative;
  display: none;
}
.user-menu.visible { display: block; }
.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--light-gray);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-family: 'Tajawal', sans-serif;
}
.user-menu-trigger:hover { background: var(--border); }
.user-avatar-sm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
}
.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  min-width: 200px;
  overflow: hidden;
  display: none;
  z-index: 200;
}
.user-menu-dropdown.open { display: block; animation: fadeIn 0.2s ease; }
.user-menu-dropdown a, .user-menu-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--dark-gray);
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
  width: 100%;
  text-align: right;
  border: none;
  background: none;
  font-family: 'Tajawal', sans-serif;
  cursor: pointer;
}
.user-menu-dropdown a:hover, .user-menu-dropdown button:hover { background: var(--off-white); color: var(--primary); }
.user-menu-dropdown .divider-line { height: 1px; background: var(--border); }
.user-menu-dropdown .logout-btn { color: #dc2626; }
.user-menu-dropdown .logout-btn:hover { background: #fee2e2; }

/* ===== NOTIFICATION BADGE ===== */
.notif-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--light-gray);
  display: flex; align-items: center; justify-content: center;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  color: var(--dark-gray);
  font-size: 1rem;
}
.notif-btn:hover { background: var(--border); }
.notif-dot {
  position: absolute;
  top: 7px;
  left: 7px;
  width: 9px;
  height: 9px;
  background: var(--secondary);
  border-radius: 50%;
  border: 2px solid white;
}

/* ===== BACK TO TOP ===== */
.back-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  opacity: 0;
  pointer-events: none;
  border: none;
  font-size: 1rem;
  z-index: 999;
}
.back-top.visible { opacity: 1; pointer-events: all; }
.back-top:hover { background: var(--primary-light); transform: translateY(-3px); }

/* ===== LOADING ===== */
.loading { display: flex; justify-content: center; padding: 48px; }
.spinner { width: 44px; height: 44px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--light-gray) 25%, #e8ebee 50%, var(--light-gray) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-md); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ===== PAGE TRANSITIONS ===== */
.page { display: none; animation: fadeIn 0.35s ease; }
.page.active { display: block; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cards-grid-4 { grid-template-columns: repeat(2,1fr); }
  .stats-grid { grid-template-columns: repeat(2,1fr); gap: 24px; }
}
@media (max-width: 1024px) {
  .admin-sidebar { transform: translateX(100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-right: 0; }
  .sections-nav { grid-template-columns: repeat(4,1fr); }
}
@media (max-width: 900px) {
  .hero-content { grid-template-columns: 1fr; text-align: center; }
  .hero-image { display: none; }
  .hero-btns { justify-content: center; }
  .hero-stats { grid-template-columns: repeat(3,1fr); }
  .sections-nav { grid-template-columns: repeat(2,1fr); }
  .cards-grid-3 { grid-template-columns: repeat(2,1fr); }
  .gallery-grid { grid-template-columns: repeat(3,1fr); }
  .nav-menu { display: none; }
  .hamburger { display: flex; }
  .nav-actions .btn-register { display: none; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .section { padding: 56px 0; }
  .cards-grid-2, .cards-grid-3, .cards-grid-4 { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2,1fr); }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-stats { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .topbar .container { flex-direction: column; gap: 4px; }
  .footer-bottom { flex-direction: column; gap: 6px; text-align: center; }
  .sections-nav { grid-template-columns: repeat(2,1fr); }
  .tabs-nav { flex-wrap: wrap; border-radius: var(--radius-lg); }
}

/* ===== MOBILE NAV OPEN ===== */
.mobile-nav-open .nav-menu {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  background: white;
  padding: 80px 20px 30px;
  box-shadow: var(--shadow-xl);
  z-index: 2000;
  overflow-y: auto;
  gap: 4px;
}
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1999;
  backdrop-filter: blur(2px);
}
.mobile-nav-open .nav-overlay { display: block; }
.nav-close-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--light-gray);
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  display: none;
}
.mobile-nav-open .nav-close-btn { display: flex; }

/* ===== SPECIAL COMPONENTS ===== */
.highlight-box {
  background: linear-gradient(135deg, rgba(26,79,122,0.06), rgba(26,79,122,0.02));
  border: 2px solid rgba(26,79,122,0.15);
  border-right: 5px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 20px 24px;
}
.highlight-box.gold { border-right-color: var(--accent); background: linear-gradient(135deg, rgba(200,151,42,0.08), rgba(200,151,42,0.02)); border-color: rgba(200,151,42,0.2); }
.highlight-box.green { border-right-color: var(--green); background: linear-gradient(135deg, rgba(42,122,79,0.06), rgba(42,122,79,0.02)); border-color: rgba(42,122,79,0.15); }
.highlight-box h4 { font-size: 1rem; font-weight: 700; color: var(--primary-dark); margin-bottom: 8px; }

.section-divider { display: flex; align-items: center; gap: 16px; margin: 40px 0; }
.section-divider::before, .section-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.section-divider span { font-size: 1.2rem; color: var(--border); }

/* ===== SMOOTH MARQUEE / FOUNDERS STRIP ===== */
.founders-strip { overflow: hidden; padding: 32px 0; background: white; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.founders-track {
  display: flex; gap: 32px;
  width: max-content;
  animation: smoothMarquee 25s linear infinite;
  will-change: transform;
}
.founders-track:hover { animation-play-state: paused; }
.founder-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 22px; background: var(--off-white);
  border-radius: var(--radius-full); border: 1px solid var(--border);
  white-space: nowrap; font-size: 0.92rem; font-weight: 600; color: var(--dark-gray);
  flex-shrink: 0;
}
.founder-chip .fa, .founder-chip i { color: var(--accent); }
@keyframes smoothMarquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===== LOGO FIX IN HEADER ===== */
.navbar-brand a img {
  height: 48px;
  width: 48px;
  object-fit: contain;
}

/* ===== WIKI PAGE RESPONSIVE ===== */
@media (max-width: 768px) {
  .founders-track { animation-duration: 18s; }
  .wiki-grid { grid-template-columns: 1fr !important; }
  .video-grid { grid-template-columns: 1fr !important; }
}

/* ===== TAKAFUL PAGE ===== */
.btn-hero-primary, .btn-hero-secondary {
  display: inline-flex; align-items: center; gap: 8px;
}

/* ===== ADDITIONAL RESPONSIVE GRID ===== */
@media (max-width: 900px) {
  .cards-grid[style*="grid-template-columns:repeat(4"] {
    grid-template-columns: repeat(2,1fr) !important;
  }
  .process-steps {
    grid-template-columns: 1fr 1fr !important;
  }
}
@media (max-width: 600px) {
  .cards-grid[style*="grid-template-columns:repeat(3"] {
    grid-template-columns: 1fr !important;
  }
  .cards-grid[style*="grid-template-columns:repeat(4"] {
    grid-template-columns: 1fr !important;
  }
}
