/* =========================================================
   المتغيرات العامة - بنفسجي ووردي
   ========================================================= */
:root {
  --purple-1: #2d1b69;
  --purple-2: #4c1d95;
  --purple-3: #7c3aed;
  --purple-light: #a78bfa;
  --pink-1: #ec4899;
  --pink-2: #f472b6;
  --pink-light: #fbcfe8;
  --rose-bg: #fdf2f8;
  --rose-bg-2: #fce7f3;
  --cream: #fff7ed;
  
  --bg-page: #1a0b3d;
  --bg-page-2: #2d1b69;
  --bg-card: #241454;
  --bg-card-2: #2d1b69;
  --bg-input: #2d1b69;
  --bg-input-focus: #3a2478;
  
  --text-primary: #ffffff;
  --text-secondary: #fbcfe8;
  --text-muted: #a78bfa;
  --text-dark-on-cream: #1f1b2e;
  --text-medium: #8b7fa8; /* ← تم إضافتها لإصلاح الخطأ */
  
  --gold: #ec4899;
  --gold-light: #f472b6;
  --gold-dark: #a78bfa;
  --gold-bright: #fbcfe8;
  
  --gradient-main: linear-gradient(135deg, #7c3aed, #ec4899);
  --gradient-hover: linear-gradient(135deg, #ec4899, #7c3aed);
  
  --border: rgba(236, 72, 153, 0.2);
  --border-focus: rgba(236, 72, 153, 0.6);
  
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --info: #3b82f6;
  
  --shadow-card: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
  --shadow-gold: 0 20px 60px -15px rgba(236, 72, 153, 0.4);
}

body.light-mode {
  --bg-page: #fdf2f8;
  --bg-page-2: #fce7f3;
  --bg-card: #ffffff;
  --bg-card-2: #fff7ed;
  --bg-input: #fdf2f8;
  --bg-input-focus: #fce7f3;
  
  --text-primary: #1f1b2e;
  --text-secondary: #be185d;
  --text-muted: #8b7fa8;
  --text-dark-on-cream: #1f1b2e;
  
  --border: rgba(124, 58, 237, 0.15);
  --border-focus: rgba(236, 72, 153, 0.5);
  
  --shadow-card: 0 30px 80px -20px rgba(124, 58, 237, 0.15);
  --shadow-gold: 0 20px 60px -15px rgba(236, 72, 153, 0.25);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  direction: rtl;
  transition: background 0.5s ease, color 0.5s ease;
  position: relative;
}

.bg-pattern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -3;
  background-image: radial-gradient(circle, var(--gold) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.04;
  pointer-events: none;
}

/* =========================================================
   أزرار عامة
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  font-family: 'Cairo', sans-serif;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transition: left 0.6s ease;
}

.btn:hover::before { left: 100%; }
.btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--purple-3), var(--pink-1));
  color: #fff;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--pink-1), var(--purple-3));
  box-shadow: 0 15px 35px -10px var(--shadow-gold);
}

.btn-success { background: linear-gradient(135deg, #059669, #10b981); color: #fff; }
.btn-danger { background: linear-gradient(135deg, #dc2626, #ef4444); color: #fff; }
.btn-accent { background: linear-gradient(135deg, var(--purple-3), var(--pink-1)); color: #fff; }
.btn-whatsapp { background: linear-gradient(135deg, #128c7e, #25d366); color: #fff; }
.btn-warning { background: linear-gradient(135deg, #d97706, #f59e0b); color: #fff; }
.btn-info { background: linear-gradient(135deg, #1e40af, #3b82f6); color: #fff; }

.btn-sm { width: auto; padding: 8px 14px; font-size: 0.8rem; }
.btn-full { width: 100%; margin-top: 10px; }

.pulse-btn { animation: pulseBtn 2s infinite; }

@keyframes pulseBtn {
  0% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.5); }
  70% { box-shadow: 0 0 0 15px rgba(236, 72, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0); }
}

/* =========================================================
   حقول الإدخال
   ========================================================= */
.input-field { margin-bottom: 16px; text-align: right; }

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

input, select, textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-family: 'Cairo', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.1);
  transform: translateY(-1px);
}

select { cursor: pointer; }
select option { background: var(--bg-card); color: var(--text-primary); }

.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* =========================================================
   شريط الإعلانات
   ========================================================= */
.announcement-bar {
  width: 100%;
  background: linear-gradient(90deg, var(--purple-3), var(--pink-1), var(--purple-3));
  color: #fff;
  padding: 10px 0;
  overflow: hidden;
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 3px 20px rgba(236, 72, 153, 0.4);
  position: relative;
  z-index: 100;
}

.announcement-track {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 30s linear infinite;
}

@keyframes marquee {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-100%, 0); }
}

/* =========================================================
   الشريط العلوي
   ========================================================= */
.top-nav-bar {
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-radius: 14px;
  margin: 14px 10px;
  border: 1px solid var(--border);
  color: var(--text-primary);
  position: relative;
  z-index: 100;
  box-shadow: var(--shadow-card);
}

.nav-brand {
  font-weight: 900;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
}

.nav-brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--pink-1);
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.5);
}

.notification-bell-container { position: relative; display: inline-block; }

.notification-bell-btn {
  background: rgba(236, 72, 153, 0.15);
  color: var(--pink-1);
  border: 1.5px solid rgba(236, 72, 153, 0.3);
  padding: 6px 12px;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 1.1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.notification-bell-btn:hover {
  background: rgba(236, 72, 153, 0.3);
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.5);
}

.notification-badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 50%;
  border: 2px solid var(--bg-page);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.7);
}

.notifications-dropdown {
  position: absolute;
  top: 52px;
  left: 0;
  width: 350px;
  max-width: 90vw;
  max-height: 460px;
  overflow-y: auto;
  background: var(--bg-card);
  backdrop-filter: blur(25px);
  color: var(--text-primary);
  border-radius: 16px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6);
  border: 1.5px solid var(--border);
  z-index: 99999;
  padding: 16px;
  display: none;
  text-align: right;
}

.notifications-dropdown.show {
  display: block;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notif-item-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.notif-item-card:hover {
  border-color: var(--pink-1);
  transform: translateX(-4px);
  box-shadow: 0 5px 20px rgba(236, 72, 153, 0.25);
}

.notif-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 800;
  padding-left: 20px;
}

.notif-item-body {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.notif-free-special {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(167, 139, 250, 0.15)) !important;
  border: 1.5px solid var(--pink-1) !important;
  box-shadow: 0 5px 20px rgba(236, 72, 153, 0.3) !important;
}

.btn-notif-delete {
  position: absolute;
  top: 8px;
  left: 8px;
  background: transparent;
  border: none;
  color: var(--danger);
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 50%;
  transition: all 0.2s;
}

.btn-notif-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  transform: scale(1.1);
}

.nav-btn-menu {
  background: rgba(236, 72, 153, 0.15);
  color: var(--pink-1);
  border: 1.5px solid rgba(236, 72, 153, 0.3);
  padding: 8px 16px;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-btn-menu:hover {
  background: rgba(236, 72, 153, 0.3);
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.5);
}
/* =========================================================
   القائمة الجانبية
   ========================================================= */
.nav-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100vh;
  background: var(--bg-card);
  backdrop-filter: blur(25px);
  z-index: 20000;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  padding: 22px;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 1.5px solid var(--border);
  overflow-y: auto;
}

.nav-drawer.open { right: 0; }

.nav-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.nav-drawer-close {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s;
}

.nav-drawer-close:hover {
  color: var(--pink-1);
  transform: rotate(90deg);
}

.nav-drawer-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  z-index: 19999;
  display: none;
  backdrop-filter: blur(4px);
}

.drawer-overlay.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.main-wrapper {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 14px 30px;
  position: relative;
  z-index: 1;
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(25px) saturate(180%);
  border-radius: 20px;
  padding: 26px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: background 0.5s ease, border-color 0.5s ease;
}

.hidden { display: none !important; }

/* =========================================================
   كروت الدروس
   ========================================================= */
.lessons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
  margin-top: 16px;
}

.lesson-card {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
}

.lesson-card:hover {
  transform: translateY(-6px);
  border-color: var(--pink-1);
  box-shadow: 0 20px 40px -12px rgba(236, 72, 153, 0.4);
}

.lesson-thumb-wrapper {
  width: 100%;
  height: 150px;
  background: var(--bg-page);
  position: relative;
  overflow: hidden;
}

.lesson-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.lesson-card:hover .lesson-thumb-img { transform: scale(1.08); }

.lesson-card-body {
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.lesson-card h4 {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 800;
  line-height: 1.4;
}

.lesson-card.free-lesson-card {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(167, 139, 250, 0.15));
  border: 2px solid var(--pink-1);
  box-shadow: 0 10px 30px -8px rgba(236, 72, 153, 0.5);
  animation: pulseFreeCard 2.5s infinite;
}

@keyframes pulseFreeCard {
  0% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.5); }
  70% { box-shadow: 0 0 0 15px rgba(236, 72, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0); }
}

.free-ribbon {
  position: absolute;
  top: 15px;
  left: -35px;
  background: linear-gradient(90deg, var(--purple-3), var(--pink-1));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 2px;
  padding: 4px 32px;
  transform: rotate(-45deg);
  z-index: 10;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

.completed-badge-ribbon {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--success);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  z-index: 10;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.status-pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: auto;
}

.status-locked {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-unlocked {
  background: rgba(236, 72, 153, 0.15);
  color: var(--pink-light);
  border: 1px solid rgba(236, 72, 153, 0.3);
}

/* =========================================================
   كروت المجموعات (Terms)
   ========================================================= */
.term-card {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(236, 72, 153, 0.1));
  border: 2px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.term-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.15), transparent 60%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.term-card:hover::before { opacity: 1; }

.term-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--pink-1);
  box-shadow: 0 25px 60px -15px rgba(236, 72, 153, 0.5);
}

.term-card-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--purple-3), var(--pink-1));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.6rem;
  font-weight: 900;
  box-shadow: 0 10px 30px -8px rgba(236, 72, 153, 0.6);
  flex-shrink: 0;
}

.term-card-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.3;
}

.term-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1.6;
}

.term-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.term-price-badge {
  background: linear-gradient(135deg, var(--purple-3), var(--pink-1));
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 900;
  font-size: 0.85rem;
  box-shadow: 0 5px 15px rgba(236, 72, 153, 0.4);
}

.term-videos-count {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}

.term-status-badge {
  padding: 5px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 800;
}

.term-status-locked {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.term-status-unlocked {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.term-status-free {
  background: rgba(236, 72, 153, 0.15);
  color: var(--pink-light);
  border: 1px solid rgba(236, 72, 153, 0.3);
}

/* =========================================================
   أزرار القائمة الجانبية
   ========================================================= */
.side-nav-btn {
  background: transparent;
  border: 1.5px solid transparent;
  color: var(--text-primary);
  padding: 12px 14px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-align: right;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  width: 100%;
}

.side-nav-btn:hover {
  background: rgba(236, 72, 153, 0.1);
  border-color: rgba(236, 72, 153, 0.25);
  color: var(--pink-1);
  transform: translateX(-3px);
}

.side-nav-btn.active {
  background: linear-gradient(135deg, var(--purple-3), var(--pink-1));
  color: #fff;
  box-shadow: 0 8px 25px -8px rgba(236, 72, 153, 0.6);
  border-color: transparent;
  transform: translateX(0);
}

.btn-logout-side {
  color: var(--danger) !important;
  border-color: rgba(239, 68, 68, 0.2) !important;
  margin-top: 8px;
}

.btn-logout-side:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}

/* =========================================================
   Dashboard Layout
   ========================================================= */
.dashboard-layout-wrapper {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: start;
  width: 100%;
}

#student-dashboard { grid-template-columns: 1fr; }
#student-dashboard .adaptive-sidebar { display: none !important; }

.adaptive-sidebar {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 20px;
}

.sidebar-menu { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.main-content-panel { min-height: 500px; width: 100%; }

.dash-box {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  transition: all 0.3s ease;
}

.dash-box:hover { border-color: rgba(236, 72, 153, 0.4); }

.box-title {
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.box-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: linear-gradient(180deg, var(--purple-3), var(--pink-1));
  border-radius: 2px;
  box-shadow: 0 0 10px var(--pink-1);
}

/* =========================================================
   صور الطلاب
   ========================================================= */
.student-avatar-container {
  position: relative;
  width: 95px;
  height: 95px;
  min-width: 95px;
  margin: 0 auto;
}

.student-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--pink-1);
  box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.25), 0 10px 30px -5px rgba(236, 72, 153, 0.5);
}

.avatar-edit-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  background: linear-gradient(135deg, var(--purple-3), var(--pink-1));
  color: #fff;
  border: 2px solid var(--bg-page);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.6);
  transition: all 0.3s;
}

.avatar-edit-badge:hover { transform: scale(1.15); }

.code-pill {
  background: rgba(236, 72, 153, 0.15);
  color: var(--pink-light);
  padding: 3px 10px;
  border-radius: 8px;
  font-weight: 800;
  border: 1px solid rgba(236, 72, 153, 0.3);
  font-family: 'Courier New', monospace;
}

.student-profile-summary-box {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.profile-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  font-size: 0.88rem;
}

.profile-details-grid span { color: var(--text-muted); font-weight: 600; }

/* =========================================================
   شريط التقدم
   ========================================================= */
.progress-bar-container {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  height: 12px;
  overflow: hidden;
  margin-top: 8px;
  border: 1px solid rgba(236, 72, 153, 0.2);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple-3), var(--pink-1), var(--pink-2));
  width: 0%;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 15px rgba(236, 72, 153, 0.7);
}

/* =========================================================
   إحصائيات
   ========================================================= */
.student-analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.stat-analytics-box {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s ease;
}

.stat-analytics-box:hover {
  border-color: var(--pink-1);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px -10px rgba(236, 72, 153, 0.4);
}

.sa-icon { font-size: 28px; filter: drop-shadow(0 0 10px currentColor); }
.sa-info { flex: 1; }
.sa-info h4 { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 4px; font-weight: 600; }
.sa-val { font-size: 1.15rem; font-weight: 800; color: var(--pink-light); }

/* =========================================================
   الجداول
   ========================================================= */
.table-responsive { overflow-x: auto; margin-top: 10px; border-radius: 12px; }

.custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: right;
}

.custom-table th, .custom-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
}

.custom-table th {
  background: rgba(236, 72, 153, 0.1);
  font-weight: 800;
  color: var(--pink-1);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.custom-table tr:hover { background: rgba(236, 72, 153, 0.05); }

.status-badge-active {
  background: rgba(236, 72, 153, 0.15);
  color: var(--pink-light);
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 700;
  border: 1px solid rgba(236, 72, 153, 0.3);
  font-size: 0.78rem;
}

.status-badge-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 700;
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 0.78rem;
}

.badge-score-pill {
  background: rgba(236, 72, 153, 0.15);
  color: var(--pink-light);
  padding: 4px 12px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 0.82rem;
  border: 1px solid rgba(236, 72, 153, 0.3);
}

.pill-grade {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 800;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.views-badge {
  background: rgba(236, 72, 153, 0.15);
  color: var(--pink-light);
  padding: 5px 12px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.8rem;
  border: 1px solid rgba(236, 72, 153, 0.3);
}

/* =========================================================
   النوافذ المنبثقة
   ========================================================= */
.quiz-popup-modal, .cert-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  padding: 15px;
}

.quiz-modal-content {
  background: var(--bg-card);
  backdrop-filter: blur(25px);
  border-radius: 20px;
  padding: 26px;
  max-width: 650px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
  border: 1.5px solid var(--border);
  position: relative;
}

.quiz-modal-content::-webkit-scrollbar { width: 6px; }
.quiz-modal-content::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); border-radius: 10px; }
.quiz-modal-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--purple-3), var(--pink-1));
  border-radius: 10px;
}

/* =========================================================
   بوابة الدفع
   ========================================================= */
.payment-gate-box {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.1), rgba(167, 139, 250, 0.1));
  border: 2px dashed var(--pink-1);
  border-radius: 18px;
  padding: 24px;
  text-align: center;
  margin-top: 16px;
}

.lock-icon {
  font-size: 42px;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 15px rgba(236, 72, 153, 0.7));
}

.price-tag {
  font-size: 1.2rem;
  color: var(--pink-light);
  margin: 12px 0;
  font-weight: 800;
}

.quick-code-box {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin: 14px auto;
  max-width: 480px;
}

.payment-methods-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 460px;
  margin: 14px auto;
}

.pay-card {
  padding: 16px;
  border-radius: 14px;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  transition: all 0.3s;
}

.pay-card:hover { transform: translateY(-3px); }
.v-cash { background: linear-gradient(135deg, #e11d48, #be123c); }
.e-cash { background: linear-gradient(135deg, #059669, #047857); }

.wallet-num {
  font-size: 1.05rem;
  display: block;
  margin-top: 6px;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
}

/* =========================================================
   فيديو محمي
   ========================================================= */
.secure-video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 14px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  background: #000;
  user-select: none;
  border: 1px solid var(--border);
}

.secure-video-wrapper iframe, .secure-video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-anti-piracy-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  pointer-events: none;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.015) 0, rgba(255, 255, 255, 0.015) 2px, transparent 2px, transparent 42px);
}

.video-security-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 25;
  pointer-events: none;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(26, 11, 61, 0.8);
  border: 1px solid rgba(236, 72, 153, 0.5);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.7rem;
  font-weight: 900;
  backdrop-filter: blur(8px);
}

.floating-watermark {
  position: absolute;
  z-index: 30;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8rem;
  font-weight: 900;
  pointer-events: none;
  background: rgba(26, 11, 61, 0.7);
  padding: 5px 10px;
  border-radius: 6px;
  transition: all 1.2s ease-in-out;
  user-select: none;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(236, 72, 153, 0.4);
}

.video-control-bar {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
  background: var(--bg-input);
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

/* =========================================================
   كروت الشحن
   ========================================================= */
.printable-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.scratch-card-mini {
  border: 2px dashed var(--pink-1);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  background: var(--bg-input);
  color: var(--text-primary);
  box-shadow: 0 5px 20px rgba(236, 72, 153, 0.2);
  position: relative;
  transition: all 0.3s;
}

.scratch-card-mini:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(236, 72, 153, 0.4);
}

.scratch-card-mini h5 { font-size: 0.82rem; color: var(--pink-1); margin-bottom: 6px; }

.scratch-card-mini .card-code-val {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--pink-light);
  background: rgba(236, 72, 153, 0.15);
  padding: 6px 12px;
  border-radius: 8px;
  display: inline-block;
  margin: 6px 0;
  border: 1px solid rgba(236, 72, 153, 0.3);
  font-family: 'Courier New', monospace;
}

.btn-card-del {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.btn-card-del:hover { transform: scale(1.15) rotate(90deg); }
/* =========================================================
   السوشيال ميديا
   ========================================================= */
.teacher-social-bar {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 0 10px;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 50px;
  color: #fff !important;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 800;
  font-family: 'Cairo', sans-serif;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
  min-width: 140px;
}

.social-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transition: left 0.6s ease;
}

.social-btn:hover::before { left: 100%; }

.social-btn:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.4);
}

.social-btn:active { transform: translateY(-2px) scale(1.02); }

.social-btn-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.social-btn:hover .social-btn-icon { transform: scale(1.2) rotate(-8deg); }
.social-btn-text { display: inline-block; letter-spacing: 0.5px; white-space: nowrap; }

.social-fb { background: linear-gradient(135deg, #1877f2, #0c63d4); box-shadow: 0 8px 25px rgba(24, 119, 242, 0.35); }
.social-tt { background: linear-gradient(135deg, #000000, #2d2d2d); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.45); }
.social-yt { background: linear-gradient(135deg, #ff0000, #cc0000); box-shadow: 0 8px 25px rgba(255, 0, 0, 0.35); }
.social-wa { background: linear-gradient(135deg, #25d366, #128c7e); box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4); }

.auth-social-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 32px 0 20px;
  padding: 20px 10px 0;
  border-top: 1px solid rgba(236, 72, 153, 0.25);
  position: relative;
  animation: fadeIn 1s ease 1.5s backwards;
}

.auth-social-bar::before {
  content: 'تابعنا على منصاتنا';
  position: absolute;
  top: -10px;
  right: 50%;
  transform: translateX(50%);
  background: linear-gradient(135deg, #fdf2f8, #fce7f3);
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.social-btn-mini {
  padding: 9px 16px;
  min-width: auto;
  gap: 7px;
  font-size: 0.8rem;
  border-radius: 40px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.social-btn-mini .social-btn-icon { width: 18px; height: 18px; }
.social-btn-mini .social-btn-text { font-size: 0.8rem; }

.social-btn-mini:hover {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.social-btn-mini:hover .social-btn-icon { transform: scale(1.25) rotate(-10deg); }

/* =========================================================
   الفوتر
   ========================================================= */
.designer-footer { margin-top: 30px; text-align: center; width: 100%; }

.footer-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--bg-card);
  backdrop-filter: blur(15px);
  padding: 10px 22px;
  border-radius: 30px;
  color: var(--text-primary);
  font-size: 0.82rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.footer-badge strong { color: var(--pink-light); }
.dev-divider { color: var(--text-muted); }

.dev-contact-btn {
  background: linear-gradient(135deg, #128c7e, #25d366);
  color: #ffffff !important;
  text-decoration: none;
  padding: 4px 14px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
  transition: all 0.3s ease;
}

.dev-contact-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.6);
}

/* =========================================================
   أنيميشن احترافي
   ========================================================= */
.anime-fade-in { animation: fadeIn 0.5s ease-out forwards; }
.anime-slide-up { animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.anime-slide-down { animation: slideDown 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.anime-scale-in { animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.anime-slide-in-right { animation: slideInRight 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.anime-slide-in-left { animation: slideInLeft 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.anime-rotate-in { animation: rotateIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-40px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(80px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-80px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes rotateIn {
  from { opacity: 0; transform: rotate(-15deg) scale(0.8); }
  to { opacity: 1; transform: rotate(0) scale(1); }
}

.ltr-field { direction: ltr !important; text-align: left !important; }

.dash-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.menu-toggle-btn {
  background: rgba(236, 72, 153, 0.15);
  border: 1.5px solid rgba(236, 72, 153, 0.3);
  color: var(--pink-1);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-family: inherit;
  transition: all 0.3s;
}

.menu-toggle-btn:hover { background: rgba(236, 72, 153, 0.3); transform: scale(1.03); }

.exam-status-item {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  transition: all 0.3s;
}

.exam-status-item:hover { border-color: var(--pink-1); transform: translateX(-3px); }

.exams-status-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 350px;
  overflow-y: auto;
  padding-right: 4px;
}

.exams-status-list::-webkit-scrollbar { width: 5px; }
.exams-status-list::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); border-radius: 10px; }
.exams-status-list::-webkit-scrollbar-thumb { background: var(--pink-1); border-radius: 10px; }

.system-msg {
  margin-top: 14px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  min-height: 20px;
}

/* =========================================================
   صفحة تسجيل الدخول - Split Screen
   ========================================================= */
.auth-split-screen {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  position: relative;
}

.visual-side {
  position: relative;
  background: linear-gradient(135deg, #1a0b3d 0%, #2d1b69 50%, #1a0b3d 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
}

.visual-side::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(236, 72, 153, 0.25) 0%, transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(124, 58, 237, 0.35) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(167, 139, 250, 0.15) 0%, transparent 60%);
  animation: bgRotate 25s linear infinite;
}

@keyframes bgRotate {
  from { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.15); }
  to { transform: rotate(360deg) scale(1); }
}

.waves-svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 200px;
  opacity: 0.3;
}

.wave-path { animation: waveMove 8s ease-in-out infinite; }
.wave-path:nth-child(2) { animation-delay: -2s; animation-duration: 10s; }
.wave-path:nth-child(3) { animation-delay: -4s; animation-duration: 12s; }

@keyframes waveMove {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-30px); }
}

.stars-container, .particles-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.star {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #fbcfe8;
  border-radius: 50%;
  box-shadow: 0 0 10px #fbcfe8, 0 0 20px rgba(236, 72, 153, 0.8);
  animation: twinkleStar 3s infinite ease-in-out;
}

@keyframes twinkleStar {
  0%, 100% { opacity: 0.1; transform: scale(0.5); }
  50% { opacity: 1; transform: scale(1.8); }
}

.shooting-star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 20px #ec4899, 0 0 40px #a78bfa;
  animation: shootingStar 4s linear infinite;
}

.shooting-star::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, #fff, transparent);
  transform: rotate(-45deg);
  transform-origin: right center;
}

@keyframes shootingStar {
  0% { transform: translate(0, 0) rotate(-45deg); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translate(500px, 500px) rotate(-45deg); opacity: 0; }
}

.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: rgba(236, 72, 153, 0.6);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.9);
  animation: particleBurst 8s infinite ease-in-out;
}

@keyframes particleBurst {
  0%, 100% { transform: translate(0, 0) scale(0.5); opacity: 0; }
  20% { transform: translate(20px, -40px) scale(1.5); opacity: 1; }
  50% { transform: translate(-30px, -80px) scale(1); opacity: 0.7; }
  80% { transform: translate(40px, -120px) scale(1.3); opacity: 0.4; }
}

.visual-decoration {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.visual-decoration::before,
.visual-decoration::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.visual-decoration::before {
  width: 900px;
  height: 900px;
  border: 2px solid rgba(236, 72, 153, 0.15);
  animation: rotateDecor 60s linear infinite;
}

.visual-decoration::after {
  width: 700px;
  height: 700px;
  border: 2px dashed rgba(167, 139, 250, 0.15);
  animation: rotateDecor 90s linear infinite reverse;
}

@keyframes rotateDecor {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.visual-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #fff;
  max-width: 480px;
}

.teacher-wrapper {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0 auto 40px;
  animation: floatPhoto 5s ease-in-out infinite;
}

@keyframes floatPhoto {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-15px) rotate(-2deg); }
  75% { transform: translateY(-15px) rotate(2deg); }
}

.teacher-orb {
  position: absolute;
  inset: -60px;
  border-radius: 50%;
  background: 
    radial-gradient(circle at 30% 30%, rgba(236, 72, 153, 0.6), transparent 50%),
    radial-gradient(circle at 70% 70%, rgba(124, 58, 237, 0.6), transparent 50%);
  filter: blur(30px);
  animation: orbPulse 4s ease-in-out infinite;
  z-index: 0;
}

@keyframes orbPulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
}

.teacher-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 3;
  padding: 6px;
  background: #1a0b3d;
  box-shadow: 
    0 0 0 3px rgba(236, 72, 153, 0.5),
    0 0 0 6px rgba(124, 58, 237, 0.3),
    0 30px 80px -20px rgba(236, 72, 153, 0.7);
}

.teacher-ring {
  position: absolute;
  inset: -15px;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    transparent 0%,
    #ec4899 10%,
    #f472b6 20%,
    #a78bfa 30%,
    #7c3aed 40%,
    transparent 50%,
    transparent 60%,
    #ec4899 70%,
    #f472b6 80%,
    #a78bfa 90%,
    transparent 100%);
  animation: spinRing 3s linear infinite;
  filter: blur(2px);
  z-index: 1;
}

@keyframes spinRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.teacher-ring-2 {
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  border: 2px dashed rgba(244, 114, 182, 0.6);
  animation: spinRing 15s linear infinite reverse;
  z-index: 1;
}

.teacher-ring-3 {
  position: absolute;
  inset: -50px;
  border-radius: 50%;
  border: 1px solid rgba(167, 139, 250, 0.4);
  animation: spinRing 25s linear infinite;
  z-index: 1;
}

.teacher-ring-4 {
  position: absolute;
  inset: -70px;
  border-radius: 50%;
  border: 1px dotted rgba(236, 72, 153, 0.3);
  animation: spinRing 40s linear infinite reverse;
  z-index: 1;
}

.teacher-shine {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, transparent 30%, rgba(255, 255, 255, 0.6) 50%, transparent 70%);
  animation: shinePass 3s ease-in-out infinite;
  pointer-events: none;
  z-index: 4;
}

@keyframes shinePass {
  0%, 100% { opacity: 0; transform: translateX(-100%) rotate(0deg); }
  50% { opacity: 1; transform: translateX(100%) rotate(180deg); }
}

.visual-title {
  font-size: 40px;
  font-weight: 900;
  margin-bottom: 14px;
  letter-spacing: -0.5px;
  line-height: 1.3;
  background: linear-gradient(90deg, #fff, #fbcfe8, #a78bfa, #fff);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: 
    fadeInUp 0.8s ease-out 0.3s backwards,
    titleGradient 4s ease-in-out infinite;
  filter: drop-shadow(0 4px 30px rgba(236, 72, 153, 0.6));
}

@keyframes titleGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.visual-subtitle {
  font-size: 14px;
  color: #fbcfe8;
  letter-spacing: 10px;
  font-weight: 800;
  margin-bottom: 34px;
  animation: 
    fadeInUp 0.8s ease-out 0.5s backwards,
    letterGlow 3s ease-in-out infinite;
}

@keyframes letterGlow {
  0%, 100% { text-shadow: 0 0 15px rgba(236, 72, 153, 0.5); }
  50% { text-shadow: 0 0 30px rgba(236, 72, 153, 1), 0 0 60px rgba(124, 58, 237, 0.8); }
}

.visual-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 28px 0;
  animation: fadeInUp 0.8s ease-out 0.7s backwards;
}

.visual-divider-line {
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ec4899, #a78bfa, transparent);
  box-shadow: 0 0 15px rgba(236, 72, 153, 0.8);
}

.visual-divider-diamond {
  color: #fbcfe8;
  font-size: 18px;
  animation: 
    rotateDiamond 3s linear infinite,
    diamondGlow 2s ease-in-out infinite;
}

@keyframes rotateDiamond {
  from { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.3); }
  to { transform: rotate(360deg) scale(1); }
}

@keyframes diamondGlow {
  0%, 100% { text-shadow: 0 0 15px #fbcfe8; }
  50% { text-shadow: 0 0 30px #ec4899, 0 0 60px #a78bfa; }
}

.visual-teacher-name {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: 2px;
  font-weight: 700;
  animation: fadeInUp 0.8s ease-out 0.9s backwards;
  text-shadow: 0 4px 30px rgba(236, 72, 153, 0.8);
}

.visual-tagline {
  font-size: 15px;
  color: rgba(251, 207, 232, 0.85);
  line-height: 1.9;
  margin-top: 14px;
  animation: fadeInUp 0.8s ease-out 1.1s backwards;
}

.form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 50%, #fff7ed 100%);
  position: relative;
  overflow: hidden;
}

.form-side::before {
  content: '';
  position: absolute;
  top: -150px;
  right: -150px;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.15) 0%, transparent 70%);
  animation: orbFloat 12s ease-in-out infinite;
}

.form-side::after {
  content: '';
  position: absolute;
  bottom: -200px;
  left: -150px;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.15) 0%, transparent 70%);
  animation: orbFloat 15s ease-in-out infinite reverse;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-40px, 50px) scale(1.2); }
}

.form-container {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  animation: slideInLeft 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s backwards;
}

.welcome-header { margin-bottom: 30px; text-align: center; }

.welcome-badge {
  display: inline-block;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(124, 58, 237, 0.15));
  color: #be185d;
  padding: 8px 22px;
  border-radius: 25px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 16px;
  border: 1.5px solid rgba(236, 72, 153, 0.3);
  animation: 
    bounceIn 0.8s ease-out 0.5s backwards,
    badgeGlow 3s ease-in-out infinite;
  box-shadow: 0 5px 20px rgba(236, 72, 153, 0.2);
}

@keyframes badgeGlow {
  0%, 100% { box-shadow: 0 5px 20px rgba(236, 72, 153, 0.2); }
  50% { box-shadow: 0 8px 30px rgba(236, 72, 153, 0.5); }
}

@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.3); }
  50% { opacity: 1; transform: scale(1.15); }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.welcome-header h2 {
  font-size: 34px;
  font-weight: 900;
  color: var(--text-dark-on-cream);
  margin-bottom: 10px;
  animation: fadeInUp 0.8s ease-out 0.7s backwards;
}

.welcome-header p {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  animation: fadeInUp 0.8s ease-out 0.9s backwards;
}

.tabs {
  display: flex;
  margin-bottom: 28px;
  background: rgba(236, 72, 153, 0.08);
  border-radius: 14px;
  padding: 5px;
  animation: fadeInUp 0.8s ease-out 1s backwards;
  position: relative;
}

.tab-btn {
  flex: 1;
  padding: 13px 8px;
  background: transparent;
  border: none;
  font-family: 'Cairo', sans-serif;
  font-weight: 800;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
}

.tab-btn.active {
  background: linear-gradient(135deg, #ec4899, #a78bfa);
  color: #fff;
  box-shadow: 0 8px 25px -5px rgba(236, 72, 153, 0.6);
  transform: translateY(-2px);
}

.tab-btn:not(.active):hover {
  color: var(--text-dark-on-cream);
  background: rgba(236, 72, 153, 0.1);
}

.auth-form { animation: formFadeIn 0.6s ease-out; }

@keyframes formFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-group {
  margin-bottom: 22px;
  position: relative;
  animation: formSlide 0.6s ease-out backwards;
}

.form-group:nth-of-type(1) { animation-delay: 1.1s; }
.form-group:nth-of-type(2) { animation-delay: 1.2s; }
.form-group:nth-of-type(3) { animation-delay: 1.3s; }
.form-group:nth-of-type(4) { animation-delay: 1.4s; }

@keyframes formSlide {
  from { opacity: 0; transform: translateX(40px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-medium);
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
  background: #ffffff;
  border: 2px solid rgba(236, 72, 153, 0.15);
  border-radius: 14px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.input-wrapper::before {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #ec4899, #a78bfa, #ec4899);
  background-size: 200% 100%;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 20px #ec4899;
  animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.input-wrapper:focus-within {
  border-color: #ec4899;
  box-shadow: 
    0 10px 30px -10px rgba(236, 72, 153, 0.5),
    0 0 0 4px rgba(236, 72, 153, 0.1);
  transform: translateY(-3px);
}

.input-wrapper:focus-within::before { width: 100%; }

.form-input {
  width: 100%;
  padding: 15px 45px 15px 45px;
  background: transparent;
  border: none;
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark-on-cream);
  outline: none;
}

.form-input::placeholder { color: #c4b5d4; font-weight: 500; }

.input-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 17px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.input-wrapper:focus-within .input-icon {
  color: #ec4899;
  transform: translateY(-50%) scale(1.3) rotate(-10deg);
}

.toggle-password {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 17px;
  padding: 4px;
  transition: all 0.4s ease;
}

.toggle-password:hover {
  color: #ec4899;
  transform: translateY(-50%) scale(1.3) rotate(15deg);
}

select.form-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ec4899' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: left 14px center;
  background-size: 16px;
  cursor: pointer;
}

.btn-submit {
  width: 100%;
  padding: 17px 24px;
  background: linear-gradient(135deg, #7c3aed, #ec4899, #a78bfa);
  background-size: 200% 200%;
  border: none;
  border-radius: 14px;
  font-family: 'Cairo', sans-serif;
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  cursor: pointer;
  margin-top: 16px;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 10px 30px -10px rgba(124, 58, 237, 0.6),
    0 10px 30px -10px rgba(236, 72, 153, 0.4);
  animation: 
    btnGradient 4s ease-in-out infinite,
    btnPulseMulti 3s ease-in-out 2s infinite;
}

@keyframes btnGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes btnPulseMulti {
  0%, 100% { 
    box-shadow: 
      0 10px 30px -10px rgba(124, 58, 237, 0.6),
      0 10px 30px -10px rgba(236, 72, 153, 0.4); 
  }
  50% { 
    box-shadow: 
      0 15px 40px -5px rgba(124, 58, 237, 0.9),
      0 15px 40px -5px rgba(236, 72, 153, 0.7),
      0 0 0 8px rgba(236, 72, 153, 0.1); 
  }
}

.btn-submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transition: left 0.8s ease;
}

.btn-submit:hover::before { left: 100%; }

.btn-submit:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 
    0 25px 60px -10px rgba(124, 58, 237, 0.8),
    0 25px 60px -10px rgba(236, 72, 153, 0.6);
}

.btn-green {
  background: linear-gradient(135deg, #047857, #10b981, #34d399) !important;
  box-shadow: 
    0 10px 30px -10px rgba(5, 150, 105, 0.6),
    0 10px 30px -10px rgba(52, 211, 153, 0.4) !important;
}

.btn-blue {
  background: linear-gradient(135deg, #1e40af, #3b82f6, #60a5fa) !important;
  box-shadow: 
    0 10px 30px -10px rgba(30, 64, 175, 0.6),
    0 10px 30px -10px rgba(96, 165, 250, 0.4) !important;
}

.forgot-link {
  display: block;
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s ease;
  background: none;
  border: none;
  width: 100%;
}

.forgot-link:hover {
  color: #ec4899;
  transform: translateX(-5px);
  text-shadow: 0 0 15px rgba(236, 72, 153, 0.5);
}

/* =========================================================
   قائمة الأبناء (لولي الأمر)
   ========================================================= */
.parent-children-card {
  background: #ffffff;
  border: 2px solid rgba(236, 72, 153, 0.25);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-wrap: wrap;
}

.parent-children-card:hover {
  border-color: #ec4899;
  box-shadow: 0 10px 30px -10px rgba(236, 72, 153, 0.5);
  transform: translateY(-3px);
}

.parent-children-card img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid #ec4899;
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
}

.parent-children-card .child-info { text-align: right; flex: 1; }
.parent-children-card .child-name { font-weight: 800; color: #1f1b2e; font-size: 0.92rem; margin-bottom: 4px; }
.parent-children-card .child-grade { font-size: 0.78rem; color: #8b7fa8; font-weight: 600; }
.parent-children-card .child-code { font-size: 0.72rem; color: #ec4899; font-weight: 700; margin-top: 2px; }

.parent-children-card .enter-btn {
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  color: #fff;
  border: none;
  padding: 8px 18px;
  font-size: 0.82rem;
  font-weight: 800;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(236, 72, 153, 0.4);
}

.parent-children-card .enter-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(236, 72, 153, 0.6);
}

.footer-note {
  text-align: center;
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  animation: fadeIn 0.8s ease 1.9s backwards;
}
/* =========================================================
   نظام الصلاحيات (Permissions)
   ========================================================= */
.permission-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.88rem;
  font-weight: 700;
}

.permission-item:hover {
  border-color: var(--pink-1);
  background: rgba(236, 72, 153, 0.08);
}

.permission-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #ec4899;
  cursor: pointer;
  flex-shrink: 0;
}

.permissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.role-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.role-admin {
  background: linear-gradient(135deg, #ec4899, #a78bfa);
  color: #fff;
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
}

.role-limited {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1.5px solid rgba(59, 130, 246, 0.3);
}

.assistant-card {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  transition: all 0.3s;
  flex-wrap: wrap;
}

.assistant-card:hover {
  border-color: var(--pink-1);
  box-shadow: 0 10px 30px -10px rgba(236, 72, 153, 0.3);
}

.section-pill {
  display: inline-block;
  padding: 6px 12px;
  background: rgba(124, 58, 237, 0.15);
  color: var(--purple-light);
  border: 1.5px solid rgba(124, 58, 237, 0.3);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
  margin: 4px 4px 4px 0;
}

/* =========================================================
   نافذة استعادة كلمة المرور
   ========================================================= */
.reset-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(26, 11, 61, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100000;
  padding: 15px;
  animation: fadeIn 0.3s ease;
}

.reset-modal-content {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: 32px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.8);
  position: relative;
  overflow: hidden;
  animation: resetSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes resetSlideIn {
  from { opacity: 0; transform: translateY(-30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.reset-modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.2), transparent 70%);
  pointer-events: none;
}

.reset-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.8rem;
  color: #fff;
  box-shadow: 0 15px 40px -10px rgba(236, 72, 153, 0.6);
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.reset-title {
  font-size: 1.4rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.reset-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.7;
  margin-bottom: 24px;
  font-weight: 600;
}

/* =========================================================
   صفحة تغيير كلمة المرور
   ========================================================= */
.reset-password-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a0b3d 0%, #2d1b69 50%, #1a0b3d 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100001;
  padding: 15px;
  overflow-y: auto;
}

.reset-password-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 20% 30%, rgba(236, 72, 153, 0.25) 0%, transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(124, 58, 237, 0.35) 0%, transparent 45%);
  animation: bgRotate 25s linear infinite;
  pointer-events: none;
}

.reset-page-content {
  background: rgba(36, 20, 84, 0.95);
  backdrop-filter: blur(30px);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: 36px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 50px 120px -20px rgba(0, 0, 0, 0.9);
  position: relative;
  z-index: 2;
  animation: resetSlideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reset-password-logo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: block;
  border: 3px solid var(--pink-1);
  box-shadow: 0 0 40px rgba(236, 72, 153, 0.6);
  object-fit: cover;
  animation: floatPhoto 5s ease-in-out infinite;
}

.password-strength-bar {
  height: 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 10px;
  border: 1px solid rgba(236, 72, 153, 0.15);
}

.password-strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  transition: all 0.4s ease;
}

.password-strength-text {
  font-size: 0.75rem;
  font-weight: 800;
  margin-top: 6px;
  text-align: right;
}

.match-indicator {
  font-size: 0.75rem;
  font-weight: 800;
  margin-top: 6px;
  text-align: right;
  display: none;
}
/* =========================================================
   الموبايل - Responsive
   ========================================================= */
@media (max-width: 900px) {
  .dashboard-layout-wrapper {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  
  .adaptive-sidebar { padding: 14px; position: static; }
  
  .sidebar-menu {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  
  .side-nav-btn {
    font-size: 0.8rem;
    padding: 10px 8px;
    justify-content: center;
    text-align: center;
  }
  
  .student-analytics-grid { grid-template-columns: repeat(2, 1fr); }
  
  .grid-2col, .grid-3col, .payment-methods-grid { grid-template-columns: 1fr; }
  
  .teacher-social-bar { gap: 12px; }
  .social-btn { padding: 10px 18px; font-size: 0.82rem; min-width: 120px; }
  .social-btn-icon { width: 20px; height: 20px; }
  
  .auth-split-screen { grid-template-columns: 1fr; }
  
  .visual-side {
    min-height: 45vh;
    padding: 40px 20px;
  }
  
  .teacher-wrapper { width: 150px; height: 150px; }
  .visual-title { font-size: 26px; }
  .visual-teacher-name { font-size: 20px; }
  .visual-tagline { font-size: 12px; }
  
  .form-side { padding: 40px 20px; }
  .welcome-header h2 { font-size: 26px; }
  
  .permissions-grid { grid-template-columns: 1fr; }
  
  .glass-card,
  .adaptive-sidebar,
  .top-nav-bar,
  .notifications-dropdown {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

@media (max-width: 500px) {
  .auth-social-bar {
    gap: 8px;
    margin: 26px 0 16px;
    padding: 16px 5px 0;
  }
  
  .social-btn-mini { padding: 8px 12px; font-size: 0.74rem; gap: 6px; }
  .social-btn-mini .social-btn-icon { width: 16px; height: 16px; }
  .social-btn-mini .social-btn-text { font-size: 0.74rem; }
  
  .grid-2col, .grid-3col { grid-template-columns: 1fr; }
  .parent-children-card { padding: 12px; }
  .parent-children-card img { width: 42px; height: 42px; }
  
  .reset-modal-content, .reset-page-content { padding: 24px; }
  .reset-title { font-size: 1.15rem; }
}

@media (max-width: 380px) {
  .social-btn { padding: 9px 14px; font-size: 0.78rem; min-width: 100px; gap: 7px; }
  .social-btn-icon { width: 18px; height: 18px; }
  .social-btn-mini .social-btn-text { display: none; }
  .social-btn-mini {
    padding: 10px;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    min-width: auto;
  }
  .social-btn-mini .social-btn-icon { width: 20px; height: 20px; }
}

/* =========================================================
   EL-AFENDI PLATFORM — PROFESSIONAL UI OVERRIDES
   ========================================================= */
:root {
  --brand-name-en: "El-Afendi Platform";
  --brand-purple-deep: #16082f;
  --brand-purple: #4c1d95;
  --brand-violet: #7c3aed;
  --brand-pink: #ec4899;
  --brand-pink-soft: #f9a8d4;
  --surface-glass: rgba(36, 20, 84, 0.88);
  --surface-light: rgba(255, 255, 255, 0.94);
  --focus-ring: 0 0 0 4px rgba(236, 72, 153, 0.16);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --content-width: 1280px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html {
  min-width: 280px;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 280px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  -webkit-appearance: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(236, 72, 153, 0.42);
  outline-offset: 2px;
}

button:disabled,
.btn:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none !important;
  filter: none !important;
}

h1, h2, h3, h4, h5, h6, p, label, button, a, td, th, span {
  overflow-wrap: anywhere;
}

img, video, iframe {
  max-width: 100%;
}

img {
  height: auto;
}

#platform-wrapper,
#auth-section,
#leaderboard-section {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
}

.top-nav-bar {
  width: calc(100% - 20px);
  max-width: var(--content-width);
  margin: 12px auto;
  min-height: 68px;
  padding: 10px 16px;
  gap: 12px;
}

.nav-brand {
  min-width: 0;
  max-width: 70%;
}

.nav-brand span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-brand-logo {
  flex: 0 0 42px;
}

.platform-brand-name,
.el-afendi-brand,
[data-brand="el-afendi"] {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  font-weight: 900;
  color: var(--text-primary);
}

.glass-card,
.dash-box,
.student-profile-summary-box,
.adaptive-sidebar,
.lesson-card,
.term-card,
.stat-analytics-box,
.assistant-card,
.permission-item,
.notifications-dropdown,
.reset-modal-content,
.reset-page-content {
  isolation: isolate;
}

.glass-card {
  width: 100%;
  max-width: 100%;
}

.lessons-grid,
.terms-grid,
#terms-grid-container,
#lessons-grid-container {
  width: 100%;
  contain: layout paint;
}

.lesson-card,
.term-card,
.stat-analytics-box {
  min-width: 0;
}

.btn,
.side-nav-btn,
.menu-toggle-btn,
.nav-btn-menu,
.notification-bell-btn,
.tab-btn,
.toggle-password {
  touch-action: manipulation;
}

.side-nav-btn {
  min-height: 44px;
}

.table-responsive {
  width: 100%;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.custom-table {
  min-width: 620px;
}

.custom-table th,
.custom-table td {
  vertical-align: middle;
}

.secure-video-wrapper {
  width: 100%;
  contain: layout paint;
}

.secure-video-wrapper iframe,
.secure-video-wrapper video {
  display: block;
}

.video-control-bar .btn {
  min-height: 42px;
}

.quiz-popup-modal,
.cert-modal,
.reset-modal {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-top: max(15px, env(safe-area-inset-top));
  padding-bottom: max(15px, calc(15px + var(--safe-bottom)));
}

.quiz-modal-content,
.reset-modal-content,
.reset-page-content {
  overscroll-behavior: contain;
}

.notifications-dropdown {
  scrollbar-width: thin;
  overscroll-behavior: contain;
}

input,
select,
textarea {
  min-height: 46px;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
  min-height: auto;
  width: 18px;
  height: 18px;
  accent-color: var(--pink-1);
}

.search-input,
input[type="search"] {
  padding-inline-start: 44px;
}

.search-wrap,
.search-box,
.platform-search {
  position: relative;
  width: 100%;
}

.search-wrap::before,
.search-box::before,
.platform-search::before {
  content: "⌕";
  position: absolute;
  z-index: 2;
  inset-inline-start: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.25rem;
  pointer-events: none;
}

.is-loading,
.loading-state {
  pointer-events: none;
  user-select: none;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.10), transparent);
  animation: skeletonShimmer 1.25s infinite;
}

@keyframes skeletonShimmer {
  100% { transform: translateX(100%); }
}

.empty-state,
.error-state,
.success-state,
.loading-state {
  width: 100%;
  padding: 28px 18px;
  text-align: center;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
  color: var(--text-muted);
  background: var(--bg-input);
}

.error-state {
  border-color: rgba(239,68,68,.35);
  color: #fca5a5;
}

.success-state {
  border-color: rgba(16,185,129,.35);
  color: #6ee7b7;
}

.dash-header-flex h2 {
  line-height: 1.35;
}

.dash-header-flex > * {
  min-width: 0;
}

.profile-details-grid > div {
  min-width: 0;
}

.code-pill {
  direction: ltr;
  unicode-bidi: plaintext;
  display: inline-block;
}

.payment-methods-grid {
  width: 100%;
}

.pay-card {
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.social-btn,
.social-btn-mini {
  touch-action: manipulation;
}

.social-btn-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.designer-footer {
  padding-bottom: calc(18px + var(--safe-bottom));
}

/* =========================================================
   Print Styles
   ========================================================= */
@media print {
  @page {
    size: A4;
    margin: 10mm;
  }

  body {
    background: #fff !important;
    color: #111 !important;
  }

  .bg-pattern,
  .announcement-bar,
  .top-nav-bar,
  .nav-drawer,
  .drawer-overlay,
  .teacher-social-bar,
  .auth-social-bar,
  .designer-footer,
  .btn,
  button {
    display: none !important;
  }

  .glass-card,
  .dash-box,
  .student-profile-summary-box {
    background: #fff !important;
    color: #111 !important;
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }

  .custom-table {
    min-width: 0;
    color: #111 !important;
  }

  .custom-table th,
  .custom-table td {
    color: #111 !important;
    background: #fff !important;
  }
}

/* =========================================================
   Reduced Motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }

  .announcement-track {
    animation: none !important;
    padding-inline-start: 0;
  }
}

/* =========================================================
   Responsive Tweaks
   ========================================================= */
@media (max-width: 1100px) {
  .main-wrapper {
    padding-inline: 12px;
  }

  .dashboard-layout-wrapper {
    grid-template-columns: 240px 1fr;
    gap: 14px;
  }

  .lessons-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .student-analytics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  body {
    font-size: 14px;
  }

  .announcement-bar {
    font-size: .78rem;
    padding-block: 8px;
  }

  .top-nav-bar {
    width: calc(100% - 12px);
    margin: 8px auto;
    padding: 9px 10px;
    border-radius: 12px;
  }

  .nav-brand {
    max-width: 62%;
    gap: 8px;
    font-size: .82rem;
  }

  .nav-brand-logo {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .notification-bell-btn {
    width: 38px;
    height: 38px;
  }

  .main-wrapper {
    padding: 0 8px calc(20px + var(--safe-bottom));
  }

  .glass-card {
    border-radius: 16px;
    padding: 16px;
  }

  .dash-box {
    padding: 15px;
  }

  .lessons-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .lesson-thumb-wrapper {
    height: 120px;
  }

  .lesson-card-body {
    padding: 11px;
  }

  .lesson-card h4 {
    font-size: .82rem;
  }

  .term-card {
    padding: 16px;
  }

  .term-card-title {
    font-size: 1rem;
  }

  .term-card-icon {
    width: 50px;
    height: 50px;
    font-size: 1.3rem;
  }

  .student-analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .stat-analytics-box {
    padding: 11px;
    gap: 8px;
  }

  .sa-icon {
    font-size: 22px;
  }

  .sa-val {
    font-size: 1rem;
  }

  .sidebar-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notifications-dropdown {
    position: fixed;
    top: 70px;
    inset-inline: 8px;
    width: auto;
    max-width: none;
    max-height: 70vh;
  }

  .payment-methods-grid {
    grid-template-columns: 1fr;
  }

  .teacher-social-bar {
    gap: 8px;
  }

  .social-btn {
    min-width: 0;
    flex: 1 1 45%;
    padding: 10px 12px;
  }
}

@media (max-width: 420px) {
  .lessons-grid {
    grid-template-columns: 1fr;
  }

  .student-analytics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .sidebar-menu {
    grid-template-columns: 1fr;
  }

  .side-nav-btn {
    justify-content: flex-start;
    text-align: right;
  }

  .dash-header-flex {
    align-items: stretch;
  }

  .dash-header-flex > div {
    width: 100%;
  }

  .dash-header-flex .btn {
    width: 100%;
  }

  .form-container {
    max-width: 100%;
  }

  .social-btn {
    flex-basis: 100%;
  }
}

@media (max-height: 600px) and (orientation: landscape) {
  .visual-side {
    min-height: 100vh;
    padding-block: 24px;
  }

  .form-side {
    padding-block: 24px;
  }

  .notifications-dropdown {
    max-height: 78vh;
  }
}

/* =========================================================
   Light Mode Overrides
   ========================================================= */
body.light-mode .input-wrapper {
  background: #fff;
}

body.light-mode .form-input {
  color: #1f1b2e;
}

body.light-mode .parent-children-card {
  background: #fff;
}

body:not(.light-mode) .input-wrapper {
  background: rgba(45,27,105,.72);
}

body:not(.light-mode) .form-input {
  color: #fff;
}

/* =========================================================
   LTR Helpers
   ========================================================= */
[dir="ltr"],
.ltr {
  direction: ltr;
}

[dir="ltr"] input,
[dir="ltr"] textarea,
[dir="ltr"] select,
.ltr-field {
  direction: ltr !important;
  text-align: left !important;
}

/* =========================================================
   Overflow Fixes
   ========================================================= */
#platform-wrapper,
#student-dashboard,
#teacher-dashboard,
#leaderboard-section,
.auth-split-screen {
  overflow-x: clip;
}

#lessons-grid-container,
#terms-grid-container,
#teacher-students-list,
#teacher-results-list,
#teacher-homework-list,
#teacher-questions-list,
#leaderboard-cards-container {
  contain: content;
}

/* =========================================================
   END — EL-AFENDI PLATFORM PROFESSIONAL CSS
   ========================================================= */