/* ==========================================================================
   مركز مسجد مراد غرايبة رحمه الله - الأنماط البصرية والهوية الإسلامية الفاخرة
   Quran Center Management System - Design & Stylesheet
   ========================================================================== */

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

:root {
  /* درجات الأخضر القرآني الملكي */
  --primary-deep: #052617;
  --primary-dark: #0b462c;
  --primary: #0f5b3a;
  --primary-light: #167d51;
  --primary-soft: #e8f5ee;
  --primary-glass: rgba(15, 91, 58, 0.08);

  /* درجات الذهب الملكي الفاخر */
  --gold-deep: #7a5c1a;
  --gold-dark: #9e7d2e;
  --gold: #c5a059;
  --gold-light: #e0be7d;
  --gold-soft: #fbf6ec;
  --gold-gradient: linear-gradient(135deg, #dfbe7d 0%, #c5a059 50%, #9e7d2e 100%);
  --gold-glass: rgba(197, 160, 89, 0.12);

  /* الألوان المحايدة والخلفيات */
  --bg-body: #f8faf9;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f3;
  --bg-dark: #0a1f16;
  
  /* النصوص */
  --text-main: #14241e;
  --text-secondary: #3b5247;
  --text-muted: #647b71;
  --text-white: #ffffff;
  
  /* التقييمات والحالات */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --info: #0284c7;
  --info-bg: #f0f9ff;

  /* الظلال والانحناءات */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(15, 91, 58, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 91, 58, 0.08);
  --shadow-lg: 0 16px 40px rgba(15, 91, 58, 0.12);
  --shadow-gold: 0 8px 25px rgba(197, 160, 89, 0.25);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);

  /* الخطوط */
  --font-heading: 'Amiri', 'Cairo', serif;
  --font-body: 'Cairo', 'Tajawal', sans-serif;
  --font-quran: 'Amiri', serif;
}

/* Reset & Global */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-body);
  color: var(--text-main);
  direction: rtl;
  text-align: right;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}

img {
  max-width: 100%;
  display: block;
}

/* الحاوية العامة */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==========================================================================
   رأس الموقع (Header & Navigation)
   ========================================================================== */
.main-header {
  background: #ffffff;
  border-bottom: 1px solid rgba(15, 91, 58, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-deep);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(5, 38, 23, 0.2);
  flex-shrink: 0;
}

.mosque-svg-icon {
  width: 36px;
  height: 36px;
}

.brand-text h1 {
  font-family: var(--font-heading);
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--primary-deep);
  line-height: 1.2;
}

.sub-blessing {
  font-size: 0.75rem;
  color: var(--gold-dark);
  font-weight: 700;
}

.supervisor-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: block;
  font-weight: 600;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: var(--primary-glass);
}

/* أزرار العمليات والتصميم */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 91, 58, 0.25);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 18px rgba(15, 91, 58, 0.35);
}

.btn-gold {
  background: var(--gold-gradient);
  color: #ffffff;
  box-shadow: var(--shadow-gold);
}

.btn-gold:hover {
  filter: brightness(1.05);
  box-shadow: 0 8px 24px rgba(197, 160, 89, 0.4);
}

.btn-outline {
  background: transparent;
  border-color: var(--gold);
  color: var(--gold-deep);
}

.btn-outline:hover {
  background: var(--gold-soft);
  color: var(--gold-dark);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

/* ==========================================================================
   قسم Hero والترحيب المطابق للشاشة الأولى (Splash / Home)
   ========================================================================== */
.hero-section {
  padding: 40px 0 60px;
}

.hero-card-main {
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 45px 30px;
  box-shadow: 0 10px 40px rgba(15, 91, 58, 0.06);
  border: 1px solid rgba(197, 160, 89, 0.2);
  text-align: center;
  position: relative;
  overflow: hidden;
  max-width: 580px;
  margin: 0 auto;
}

.hero-card-main::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--gold-gradient);
}

.splash-logo-wrap {
  margin-bottom: 30px;
}

.splash-logo-circle {
  width: 120px;
  height: 120px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 10px 25px rgba(197, 160, 89, 0.2);
  padding: 6px;
  border: 2px solid var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-inner-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
}

.logo-svg-big {
  width: 100%;
  height: 100%;
}

.center-title-grand {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  color: var(--primary-deep);
  line-height: 1.35;
  font-weight: 800;
  margin-bottom: 12px;
}

.center-title-grand strong {
  font-size: 2.1rem;
  color: var(--primary);
  display: block;
}

.mercy-tag {
  font-size: 1.1rem;
  color: var(--gold-dark);
  font-weight: 700;
}

.supervisor-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 18px 0;
}

.ornament-line {
  height: 1px;
  width: 45px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.supervisor-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.supervisor-text strong {
  color: var(--primary-deep);
  font-size: 1.05rem;
  font-weight: 800;
}

/* البطاقتان الرئيسيتان لتسجيل الدخول */
.dual-login-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 28px 0;
}

.login-action-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  text-align: right;
  font-family: var(--font-body);
}

.login-action-card:hover {
  transform: translateY(-2px);
}

.admin-entry-card {
  background: var(--primary-deep);
  color: #ffffff;
  border-color: rgba(197, 160, 89, 0.4);
  box-shadow: 0 6px 20px rgba(5, 38, 23, 0.25);
}

.admin-entry-card:hover {
  background: var(--primary-dark);
  box-shadow: 0 10px 25px rgba(5, 38, 23, 0.35);
}

.student-entry-card {
  background: #ffffff;
  color: var(--text-main);
  border: 1.5px solid rgba(15, 91, 58, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.student-entry-card:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.card-icon-bubble {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.green-bubble {
  background: rgba(255, 255, 255, 0.1);
  color: var(--gold-light);
  border: 1px solid rgba(223, 190, 125, 0.3);
}

.cream-bubble {
  background: var(--gold-soft);
  color: var(--primary);
  border: 1px solid var(--gold-light);
}

.card-text-group {
  flex-grow: 1;
}

.card-text-group h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.admin-entry-card .card-text-group h3 {
  color: #ffffff;
}

.student-entry-card .card-text-group h3 {
  color: var(--primary-deep);
}

.card-text-group p {
  font-size: 0.82rem;
  opacity: 0.85;
}

.card-arrow-icon {
  font-size: 1.3rem;
  color: var(--gold);
  transition: transform 0.2s ease;
}

.login-action-card:hover .card-arrow-icon {
  transform: translateX(-4px);
}

/* حبوب الإحصائيات السريعة */
.quick-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px dashed rgba(15, 91, 58, 0.15);
}

.stat-pill {
  background: var(--bg-subtle);
  padding: 10px 6px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(15, 91, 58, 0.06);
}

.stat-pill strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.stat-pill span {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ==========================================================================
   قسم الطلاب المتميزين أسبوعياً (Weekly Outstanding Cards)
   ========================================================================== */
.section {
  padding: 60px 0;
}

.section-title-wrap {
  text-align: center;
  margin-bottom: 36px;
}

.section-badge {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--gold-dark);
  background: var(--gold-soft);
  border: 1px solid var(--gold-light);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--primary-deep);
  margin-bottom: 8px;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

.outstanding-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.week-badge-banner {
  background: var(--gold-soft);
  color: var(--gold-deep);
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 0.92rem;
  border: 1px solid var(--gold-light);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.outstanding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.outstanding-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 22px;
  border: 1px solid rgba(197, 160, 89, 0.25);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.outstanding-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(15, 91, 58, 0.08);
  border-color: var(--gold);
}

.outstanding-ribbon {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--gold-gradient);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-gold);
}

.student-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.student-avatar-wrap {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  overflow: hidden;
  flex-shrink: 0;
}

.student-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.student-meta h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary-deep);
  margin-bottom: 2px;
}

.branch-tag {
  font-size: 0.78rem;
  color: var(--gold-dark);
  font-weight: 700;
}

.achievement-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  padding: 12px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  line-height: 1.5;
  border-right: 3px solid var(--gold);
}

.outstanding-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--bg-subtle);
  padding-top: 10px;
}

/* ==========================================================================
   قسم الشُّعب الخمس (Branches Grid)
   ========================================================================== */
.branches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.branch-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid rgba(15, 91, 58, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  transition: all 0.3s ease;
  text-align: center;
}

.branch-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(15, 91, 58, 0.08);
  border-color: var(--primary);
}

.branch-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.branch-card h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-deep);
  margin-bottom: 4px;
}

.branch-card-stats {
  display: flex;
  justify-content: space-around;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--bg-subtle);
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ==========================================================================
   بطاقة المشرف العام (الشيخ بكر الزقيبي)
   ========================================================================== */
.director-feature-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 35px;
  border: 1px solid rgba(197, 160, 89, 0.25);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  gap: 30px;
  max-width: 900px;
  margin: 0 auto;
}

.director-avatar-wrap {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(197, 160, 89, 0.25);
  flex-shrink: 0;
  background: var(--gold-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 54px;
}

.director-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.director-content h3 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--primary-deep);
  margin-bottom: 4px;
}

.director-role-tag {
  font-size: 0.88rem;
  color: var(--gold-dark);
  font-weight: 700;
  margin-bottom: 14px;
}

.director-quote-text {
  font-family: var(--font-quran);
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 16px;
}

.director-footer-signatures {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.seal-badge {
  background: var(--gold-soft);
  color: var(--gold-deep);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 800;
  border: 1px solid var(--gold-light);
}

/* ==========================================================================
   التذييل (Footer)
   ========================================================================== */
.main-footer {
  background: var(--primary-deep);
  color: #e2e8f0;
  padding: 60px 0 20px;
  border-top: 4px solid var(--gold);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 30px;
  margin-bottom: 40px;
}

.footer-col h4 {
  color: var(--gold-light);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.footer-col p {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.7;
  margin-bottom: 8px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  font-size: 0.88rem;
  color: #cbd5e1;
}

.footer-links a:hover {
  color: var(--gold-light);
  padding-right: 4px;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.82rem;
  color: #94a3b8;
}

/* ==========================================================================
   النوافذ المنبثقة والإشعارات (Modals & Toasts)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 38, 23, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 30px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(197, 160, 89, 0.3);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-box {
  transform: translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  left: 18px;
  background: var(--bg-subtle);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary-deep);
  margin-bottom: 4px;
}

.modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* النماذج وحقول الإدخال */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #d1d9d4;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text-main);
  background: #ffffff;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 91, 58, 0.12);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* إشعارات Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  border-right: 4px solid var(--primary);
  min-width: 260px;
  animation: slideInLeft 0.3s ease;
}

.toast.success { border-right-color: var(--success); }
.toast.error { border-right-color: var(--danger); }
.toast.info { border-right-color: var(--info); }

@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   التجاوب مع الشاشات والهواتف (Responsive Mobile Adjustments)
   ========================================================================== */
@media (max-width: 900px) {
  .header-container {
    height: 64px;
  }

  .nav-links {
    display: none;
  }

  .hero-section {
    padding: 20px 0 40px;
  }

  .hero-card-main {
    padding: 30px 18px;
    border-radius: var(--radius-lg);
  }

  .center-title-grand {
    font-size: 1.5rem;
  }

  .center-title-grand strong {
    font-size: 1.7rem;
  }

  .director-feature-card {
    flex-direction: column;
    text-align: center;
    padding: 24px 18px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}
