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

/* ===== Brand Identity — حلقات الخليل ===== */
/* Primary: Deep Emerald Teal | Accent: Islamic Gold  */

:root {
  /* ─── Brand Colors ─── */
  --teal:          #0d7a6b;
  --teal-dark:     #095c50;
  --teal-deeper:   #073d35;
  --teal-glow:     rgba(13,122,107,.28);
  --gold:          #c9a843;
  --gold-light:    #e8c96a;
  --gold-pale:     #f5e6b8;
  --gold-glow:     rgba(201,168,67,.25);

  /* ─── Backgrounds ─── */
  --surface:       #071c18;
  --surface-2:     #0d2b25;
  --surface-3:     #12352d;
  --surface-card:  rgba(13,43,37,.75);

  /* ─── Borders ─── */
  --border:        rgba(13,122,107,.3);
  --border-gold:   rgba(201,168,67,.25);

  /* ─── Text ─── */
  --text-primary:  #f0ede6;
  --text-secondary:#9cbdb7;
  --text-muted:    #4d7a72;

  /* ─── States ─── */
  --success:  #10b981;
  --warning:  #f59e0b;
  --danger:   #ef4444;
  --info:     #3b82f6;

  /* ─── Radius / Shadow ─── */
  --radius:    16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow:    0 8px 32px rgba(0,0,0,.5);
  --shadow-teal: 0 0 40px rgba(13,122,107,.25);
  --shadow-gold: 0 0 30px rgba(201,168,67,.2);
  --transition: all .3s cubic-bezier(.4,0,.2,1);
}

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

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

body {
  font-family: 'Cairo', sans-serif;
  background: var(--surface);
  color: var(--text-primary);
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.7;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb { background: var(--teal); border-radius: 99px; }

/* ===== Animated Background ===== */
.bg-animated {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Mosque silhouette pattern */
.bg-animated::before {
  content: '';
  position: absolute;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(13,122,107,.2) 0%, transparent 65%);
  top: -200px; right: -200px;
  animation: blob1 14s ease-in-out infinite alternate;
}
.bg-animated::after {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(201,168,67,.12) 0%, transparent 65%);
  bottom: -150px; left: -150px;
  animation: blob2 16s ease-in-out infinite alternate;
}

/* Geometric Islamic pattern overlay */
.bg-pattern {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .03;
  background-image:
    repeating-linear-gradient(45deg,  var(--gold) 0, var(--gold) 1px, transparent 0, transparent 50%),
    repeating-linear-gradient(-45deg, var(--gold) 0, var(--gold) 1px, transparent 0, transparent 50%);
  background-size: 30px 30px;
}

@keyframes blob1 { from { transform: scale(1); } to { transform: translate(60px,40px) scale(1.15); } }
@keyframes blob2 { from { transform: scale(1.1); } to { transform: translate(-40px,60px) scale(.9); } }

/* ===== Layout ===== */
.page-wrapper { position: relative; z-index: 1; min-height: 100vh; }
.container      { max-width: 480px; margin: 0 auto; padding: 0 16px; }
.container-wide { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== Glass Card ===== */
.card {
  background: var(--surface-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow), var(--shadow-teal); }
.card-sm { padding: 16px; border-radius: var(--radius-sm); }
.card-lg { padding: 32px; border-radius: var(--radius-lg); }

/* ===== Login Page ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(13,43,37,.9);
  backdrop-filter: blur(30px);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 48px 36px;
  box-shadow: var(--shadow), var(--shadow-gold);
  animation: fadeInUp .6s ease;
  position: relative;
  overflow: hidden;
}

/* Decorative arc top */
.login-card::before {
  content: '';
  position: absolute;
  top: -80px; left: 50%; transform: translateX(-50%);
  width: 280px; height: 160px;
  background: rgba(13,122,107,.07);
  border-radius: 50%;
  border-bottom: 2px solid rgba(201,168,67,.15);
}

.login-logo { text-align: center; margin-bottom: 32px; position: relative; z-index: 1; }

/* Mosque dome icon */
.logo-icon {
  width: 84px; height: 84px;
  margin: 0 auto 16px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon-inner {
  width: 84px; height: 84px;
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  border: 2px solid rgba(201,168,67,.4);
  box-shadow: 0 8px 32px rgba(13,122,107,.5), 0 0 0 6px rgba(201,168,67,.1);
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%,100% { box-shadow: 0 8px 32px rgba(13,122,107,.5), 0 0 0 6px rgba(201,168,67,.1); }
  50%      { box-shadow: 0 8px 48px rgba(13,122,107,.8), 0 0 0 12px rgba(201,168,67,.07); }
}

.login-logo h1 {
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}
.login-logo .brand-sub {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: .05em;
}

/* ===== Forms ===== */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  transition: var(--transition);
  outline: none;
  direction: rtl;
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus {
  border-color: var(--teal);
  background: rgba(13,122,107,.1);
  box-shadow: 0 0 0 3px var(--teal-glow);
}
textarea.form-control { resize: vertical; min-height: 110px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  color: white;
  box-shadow: 0 4px 20px rgba(13,122,107,.4);
  border: 1px solid rgba(255,255,255,.08);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(13,122,107,.6); }
.btn-primary:active { transform: translateY(0); }

.btn-gold {
  background: linear-gradient(135deg, #a8892a, var(--gold));
  color: #0d1a14;
  font-weight: 800;
  box-shadow: 0 4px 20px rgba(201,168,67,.35);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(201,168,67,.55); }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: rgba(13,122,107,.1); color: var(--text-primary); border-color: var(--teal); }

.btn-success { background: linear-gradient(135deg, #059669, var(--success)); color: white; }
.btn-success:hover { transform: translateY(-2px); }
.btn-danger  { background: linear-gradient(135deg, #dc2626, var(--danger)); color: white; }
.btn-danger:hover { transform: translateY(-2px); }

.btn-sm  { padding: 8px 16px;  font-size: 13px; }
.btn-lg  { padding: 18px 32px; font-size: 17px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; pointer-events: none; }

/* ===== Alerts ===== */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeInDown .3s ease;
}
.alert-error   { background: rgba(239,68,68,.12);  border: 1px solid rgba(239,68,68,.3);  color: #fca5a5; }
.alert-success { background: rgba(13,122,107,.15); border: 1px solid rgba(13,122,107,.35); color: #6ee7b7; }
.alert-warning { background: rgba(201,168,67,.12); border: 1px solid rgba(201,168,67,.3); color: var(--gold-light); }
.alert-info    { background: rgba(59,130,246,.12); border: 1px solid rgba(59,130,246,.3);  color: #93c5fd; }

/* ===== Top Nav ===== */
.top-nav {
  position: sticky;
  top: 0; z-index: 100;
  background: rgba(7,28,24,.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-gold);
  padding: 0 16px;
}
.top-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 480px;
  margin: 0 auto;
  height: 56px;
}
.top-nav .nav-title {
  font-size: 17px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.top-nav .nav-back {
  width: 36px; height: 36px;
  background: rgba(13,122,107,.15);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  transition: var(--transition);
}
.top-nav .nav-back:hover { background: rgba(13,122,107,.3); }

/* ===== Bottom Nav ===== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(7,28,24,.97);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-gold);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-around;
}
.bottom-nav-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  padding: 6px 20px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  color: var(--text-muted);
  font-size: 11px; font-weight: 600;
}
.bottom-nav-item.active { color: var(--gold); }
.bottom-nav-item .nav-icon { font-size: 22px; }
.bottom-nav-item:hover { color: var(--text-secondary); }

/* ===== Stats Grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0; opacity: 0;
  transition: var(--transition);
}
.stat-card:hover::before { opacity: 1; }
.stat-card.gold::before   { background: linear-gradient(135deg, rgba(201,168,67,.12), transparent); }
.stat-card.teal::before   { background: linear-gradient(135deg, rgba(13,122,107,.12), transparent); }
.stat-card.green::before  { background: linear-gradient(135deg, rgba(16,185,129,.1), transparent); }
.stat-card.blue::before   { background: linear-gradient(135deg, rgba(59,130,246,.1), transparent); }
.stat-card:hover { transform: translateY(-2px); border-color: var(--border-gold); }

.stat-icon   { font-size: 26px; margin-bottom: 8px; }
.stat-value  { font-size: 28px; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.stat-card.gold  .stat-value { color: var(--gold); }
.stat-card.teal  .stat-value { color: #4ecdc0; }
.stat-card.green .stat-value { color: var(--success); }
.stat-card.blue  .stat-value { color: #60a5fa; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* ===== Progress Bar ===== */
.progress-wrap { margin-bottom: 24px; }
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px; color: var(--text-secondary);
  margin-bottom: 8px;
}
.progress-bar-track {
  height: 10px;
  background: rgba(255,255,255,.05);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid rgba(201,168,67,.1);
}
.progress-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 1.4s cubic-bezier(.4,0,.2,1);
  position: relative;
}
.progress-bar-fill::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 30%, rgba(255,255,255,.25) 50%, transparent 70%);
  animation: shimmer 2.5s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(200%); } }

/* ===== Week Badge ===== */
.week-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: 99px; font-size: 12px; font-weight: 700;
}
.week-badge.submitted { background: rgba(13,122,107,.2); color: #4ecdc0; border: 1px solid rgba(13,122,107,.35); }
.week-badge.pending   { background: rgba(201,168,67,.15); color: var(--gold-light); border: 1px solid rgba(201,168,67,.3); }
.week-badge.late      { background: rgba(239,68,68,.15);  color: #fca5a5;  border: 1px solid rgba(239,68,68,.3); }

/* ===== Form Section Title ===== */
.form-section-title {
  font-size: 12px; font-weight: 700;
  color: var(--gold);
  text-transform: uppercase; letter-spacing: .1em;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}
.form-section-title::after {
  content: ''; flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-gold), transparent);
}

/* ===== Timeline ===== */
.timeline { position: relative; }
.timeline-item {
  position: relative;
  padding-right: 28px;
  margin-bottom: 24px;
}
.timeline-item::before {
  content: '';
  position: absolute; right: 6px; top: 24px; bottom: -24px;
  width: 1px;
  background: linear-gradient(to bottom, var(--border-gold), transparent);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  position: absolute; right: 0; top: 8px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--gold));
  border: 2px solid var(--surface);
  box-shadow: 0 0 10px var(--teal-glow);
}

/* ===== Badges ===== */
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: 99px;
  font-size: 12px; font-weight: 700;
}
.badge-gold   { background: rgba(201,168,67,.2); color: var(--gold);   border: 1px solid rgba(201,168,67,.3); }
.badge-silver { background: rgba(156,189,183,.15); color: #9cbdb7; border: 1px solid rgba(156,189,183,.25); }
.badge-teal   { background: rgba(13,122,107,.2); color: #4ecdc0; border: 1px solid rgba(13,122,107,.3); }
.badge-green  { background: rgba(16,185,129,.15); color: var(--success); border: 1px solid rgba(16,185,129,.25); }

/* ===== Greeting Banner ===== */
.greeting-banner {
  background: linear-gradient(135deg, var(--teal-dark) 0%, #073d35 60%, #0a2e28 100%);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-bottom: 24px;
  position: relative; overflow: hidden;
}
/* Arch decoration */
.greeting-banner::before {
  content: '🕌';
  position: absolute;
  left: -10px; bottom: -20px;
  font-size: 100px;
  opacity: .06;
  line-height: 1;
}
.greeting-banner::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(201,168,67,.12) 0%, transparent 70%);
}
.greeting-title {
  font-size: 22px; font-weight: 800;
  background: linear-gradient(135deg, #fff, var(--gold-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  position: relative; z-index: 1;
}
.greeting-subtitle {
  font-size: 13px; color: var(--text-secondary);
  position: relative; z-index: 1; margin-top: 4px;
}
.greeting-emoji {
  font-size: 34px;
  position: relative; z-index: 1;
  float: left;
  filter: drop-shadow(0 2px 6px rgba(201,168,67,.3));
}

/* ===== Submit CTA ===== */
.submit-cta {
  background: linear-gradient(135deg, rgba(201,168,67,.12), rgba(201,168,67,.04));
  border: 1px solid rgba(201,168,67,.3);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 24px;
  transition: var(--transition);
}
.submit-cta:hover {
  background: linear-gradient(135deg, rgba(201,168,67,.2), rgba(201,168,67,.08));
  transform: scale(1.01);
  box-shadow: var(--shadow-gold);
}
.submit-cta-icon { font-size: 32px; flex-shrink: 0; }
.submit-cta-text h3 { font-size: 16px; font-weight: 700; }
.submit-cta-text p  { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ===== Section ===== */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.section-action { font-size: 13px; color: var(--gold); font-weight: 600; }

/* ===== Student Row ===== */
.student-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(13,122,107,.12);
  transition: var(--transition);
}
.student-row:last-child { border-bottom: none; }

.student-avatar {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: white;
  flex-shrink: 0;
  border: 1px solid rgba(201,168,67,.2);
  box-shadow: 0 4px 12px rgba(13,122,107,.3);
}
.student-info { flex: 1; min-width: 0; }
.student-name { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.student-meta { font-size: 12px; color: var(--text-muted); }

/* ===== Empty State ===== */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: .4; }
.empty-state h3  { font-size: 18px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p   { font-size: 14px; }

/* ===== Gold Divider ===== */
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--border-gold), transparent); margin: 20px 0; }

/* ===== Spinner ===== */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(13,122,107,.15);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Utilities ===== */
.mb-4  { margin-bottom: 4px; }  .mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; } .mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mt-4  { margin-top: 4px; }     .mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }    .mt-24 { margin-top: 24px; }
.text-center  { text-align: center; }
.text-sm      { font-size: 13px; }
.text-xs      { font-size: 11px; }
.text-muted   { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }
.text-gold    { color: var(--gold); }
.text-teal    { color: #4ecdc0; }
.font-bold    { font-weight: 700; }
.font-black   { font-weight: 900; }
.d-flex       { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }  .gap-12 { gap: 12px; }
.w-full { width: 100%; }
.has-bottom-nav { padding-bottom: 80px; }

/* ===== Animations ===== */
@keyframes fadeInUp   { from { opacity:0; transform:translateY(28px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeInDown { from { opacity:0; transform:translateY(-16px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn     { from { opacity:0; } to { opacity:1; } }

.animate-in { animation: fadeInUp .5s ease both; }
.animate-in:nth-child(2) { animation-delay:.1s; }
.animate-in:nth-child(3) { animation-delay:.2s; }
.animate-in:nth-child(4) { animation-delay:.3s; }

/* ===== Responsive ===== */
@media (max-width:420px) {
  .stats-grid { grid-template-columns:1fr 1fr; gap:8px; }
  .stat-value { font-size:22px; }
  .card       { padding:14px; }
  .greeting-title { font-size:18px; }
  .login-card { padding:32px 20px; }
}
