/* ============================================================
   DASHBOARD CSS — Student & Parent Dashboards
   Mohamed Yousef Theme
   ============================================================ */

/* ─── Dashboard Layout ──────────────────────────────────────── */
.dashboard-page {
  padding-top: 100px;
  min-height: 100vh;
}

.dashboard-topbar {
  background: linear-gradient(135deg, #130E2E 0%, #1A1040 100%);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-8) 0;
  margin-bottom: var(--space-8);
  position: relative;
  overflow: hidden;
}

.dashboard-topbar::before {
  content: '';
  position: absolute;
  top: -50%;
  inset-inline-end: -10%;
  width: 400px;
  height: 400px;
  background: var(--color-primary);
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.1;
}

.dashboard-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  position: relative;
  z-index: 1;
}

.dashboard-greeting h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: var(--space-1);
}

.dashboard-greeting p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
}

/* ─── Notification Bell ─────────────────────────────────────── */
.notif-bell-wrap {
  position: relative;
}

.notif-bell-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  position: relative;
}

.notif-bell-btn:hover {
  border-color: var(--color-primary);
  color: var(--text-primary);
}

.notif-badge {
  position: absolute;
  top: -4px;
  inset-inline-end: -4px;
  width: 18px; height: 18px;
  background: #EF5350;
  color: white;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + var(--space-2));
  inset-inline-end: 0;
  width: 320px;
  background: rgba(13, 10, 26, 0.98);
  backdrop-filter: blur(30px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  display: none;
}

.notif-bell-wrap:hover .notif-dropdown,
.notif-bell-wrap.open .notif-dropdown { display: block; }

.notif-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.notif-title { font-size: 0.9rem; font-weight: 700; }
.notif-mark-all { font-size: 0.8rem; color: var(--color-primary-light); cursor: pointer; border: none; background: none; }

.notif-list { max-height: 300px; overflow-y: auto; }
.notif-item {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  display: flex;
  gap: var(--space-3);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.notif-item:hover { background: var(--bg-glass); }
.notif-item.unread { background: rgba(108, 63, 197, 0.05); }

.notif-item-icon { font-size: 1.2rem; flex-shrink: 0; }
.notif-item-body { flex: 1; }
.notif-item-title { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.notif-item-time  { font-size: 0.75rem; color: var(--text-muted); }
.notif-unread-dot { width: 6px; height: 6px; background: var(--color-primary); border-radius: 50%; margin-top: 4px; flex-shrink: 0; }

/* ─── Linked Children List (Parent Dashboard) ───────────────── */
.children-selector {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}

.child-chip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.child-chip.active {
  border-color: var(--color-primary);
  background: rgba(108, 63, 197, 0.1);
  color: var(--text-primary);
}
.child-chip-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

/* ─── Alert Cards for Parent ────────────────────────────────── */
.alert-panel {
  background: var(--gradient-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.alert-panel-header {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background var(--transition-fast);
}
.alert-item:hover { background: var(--bg-glass); }
.alert-item:last-child { border-bottom: none; }

.alert-item-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.alert-warning { background: rgba(212, 160, 23, 0.15); }
.alert-danger  { background: rgba(239, 83, 80, 0.15); }
.alert-success { background: rgba(102, 187, 106, 0.15); }
.alert-info    { background: rgba(100, 181, 246, 0.15); }

.alert-item-body { flex: 1; }
.alert-item-title { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.alert-item-desc  { font-size: 0.8rem; color: var(--text-muted); }
.alert-item-time  { font-size: 0.75rem; color: var(--text-muted); flex-shrink: 0; }

/* ─── Exam Results Table ────────────────────────────────────── */
.exam-results-table { width: 100%; border-collapse: collapse; }
.exam-results-table th {
  text-align: start;
  padding: var(--space-3) var(--space-4);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255,255,255,0.02);
}
.exam-results-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.exam-results-table tr:hover td { background: var(--bg-glass); }

.score-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px var(--space-3);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
}
.score-high     { background: rgba(102,187,106,0.15); color: #66BB6A; }
.score-medium   { background: rgba(212,160,23,0.15); color: var(--color-accent); }
.score-low      { background: rgba(239,83,80,0.15); color: #EF5350; }

/* ─── Weekly Report Section ─────────────────────────────────── */
.report-card {
  background: linear-gradient(135deg, rgba(108,63,197,0.1), rgba(212,160,23,0.05));
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.report-icon { font-size: 3rem; }
.report-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin-bottom: var(--space-1); }
.report-desc  { font-size: 0.875rem; color: var(--text-muted); margin: 0; }
.report-actions { margin-inline-start: auto; display: flex; gap: var(--space-3); }

/* ─── Level/Badge Display ────────────────────────────────────── */
.level-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.level-badge {
  width: 60px; height: 60px;
  border-radius: var(--radius-md);
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.level-info { flex: 1; }
.level-name  { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.level-points { font-size: 0.8rem; color: var(--color-accent); margin-top: 2px; }
.level-progress-bar { margin-top: var(--space-2); }
.level-next { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* ─── Badges Grid (Achievements) ────────────────────────────── */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: var(--space-4);
}

.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-align: center;
  transition: all var(--transition-fast);
}

.badge-item.earned {
  border-color: var(--color-accent);
  background: rgba(212, 160, 23, 0.05);
}

.badge-item.locked {
  opacity: 0.4;
  filter: grayscale(1);
}

.badge-icon { font-size: 2rem; }
.badge-name { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }
.badge-points { font-size: 0.7rem; color: var(--color-accent); }

/* ─── Course Progress List ───────────────────────────────────── */
.course-progress-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  transition: all var(--transition-fast);
}
.course-progress-item:hover {
  border-color: var(--border-medium);
}

.course-progress-thumb {
  width: 60px; height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.course-progress-info { flex: 1; min-width: 0; }
.course-progress-name { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); margin-bottom: var(--space-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.course-progress-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.course-progress-pct {
  font-size: 1rem;
  font-weight: 800;
  color: var(--color-accent);
  flex-shrink: 0;
}

/* ─── Calendar / Schedule ────────────────────────────────────── */
.schedule-calendar {
  background: var(--gradient-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.calendar-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calendar-nav-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}
.calendar-nav-btn:hover { border-color: var(--color-primary); color: var(--text-primary); }

.calendar-month-title { font-size: 1rem; font-weight: 700; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: var(--space-3);
  gap: 4px;
}

.calendar-day-label {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  padding: var(--space-2);
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  color: var(--text-secondary);
}
.calendar-day:hover { background: var(--bg-glass); color: var(--text-primary); }
.calendar-day.today { background: var(--color-primary); color: white; font-weight: 700; }
.calendar-day.has-session::after {
  content: '';
  position: absolute;
  bottom: 3px;
  width: 4px; height: 4px;
  background: var(--color-accent);
  border-radius: 50%;
}
.calendar-day.other-month { opacity: 0.3; }

/* ─── Link Child Card ────────────────────────────────────────── */
.link-child-card {
  background: linear-gradient(135deg, rgba(108,63,197,0.1), rgba(108,63,197,0.05));
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  text-align: center;
}

.link-child-icon { font-size: 3rem; margin-bottom: var(--space-3); }
.link-child-title { font-size: 1.1rem; font-weight: 700; margin-bottom: var(--space-2); }
.link-child-desc  { font-size: 0.875rem; color: var(--text-muted); margin-bottom: var(--space-5); }

.invite-code-input {
  display: flex;
  gap: var(--space-3);
  max-width: 360px;
  margin: 0 auto;
}

.invite-code-field {
  flex: 1;
  background: var(--bg-main);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: monospace;
  letter-spacing: 0.1em;
  text-align: center;
  outline: none;
}
.invite-code-field:focus { border-color: var(--color-primary); }
