/* ═══════════════════════════════════════════════════════════
   Dashboard — Additional Styles
   ═══════════════════════════════════════════════════════════ */

/* ─── Global form element theming ──────────────────────────
   Ensures inputs/selects/textareas always match the dashboard
   theme regardless of browser OS-level defaults.             */
.classera-layout input,
.classera-layout select,
.classera-layout textarea {
  background-color: var(--surface-color);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.classera-layout select option {
  background-color: var(--surface-color);
  color: var(--text-primary);
}

.classera-layout input::placeholder,
.classera-layout textarea::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

/* ─── Modal overlay ─────────────────────────────────────────
   Modals sit above everything; inner card uses solid bg.     */
.classera-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.classera-modal-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  width: min(600px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  direction: rtl;
}

.dashboard-welcome {
  margin-bottom: var(--space-xl);
}

.welcome-title {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  margin-bottom: var(--space-xs);
  background: linear-gradient(135deg, var(--text-primary), var(--classera-primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-subtitle {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
}

/* ─── Courses List ──────────────────────────────────────── */
.course-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: pointer;
  margin-bottom: var(--space-sm);
}

.course-list-item:hover {
  background: var(--bg-glass-light);
}

.course-list-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.course-list-info {
  flex: 1;
  min-width: 0;
}

.course-list-name {
  font-weight: 600;
  font-size: var(--font-size-sm);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.course-list-teacher {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.course-list-progress {
  width: 100px;
  margin-left: var(--space-md);
}

[dir="rtl"] .course-list-progress {
  margin-left: 0;
  margin-right: var(--space-md);
}

.course-list-grade {
  font-weight: 700;
  font-size: var(--font-size-lg);
  min-width: 40px;
  text-align: center;
}

.course-list-grade.grade-a { color: var(--classera-success); }
.course-list-grade.grade-b { color: var(--classera-info); }
.course-list-grade.grade-c { color: var(--classera-accent-warm); }
.course-list-grade.grade-f { color: var(--classera-danger); }

/* ─── Assignments List ──────────────────────────────────── */
.assignment-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: var(--space-sm);
  transition: all var(--transition-fast);
}

.assignment-item:hover {
  border-color: var(--border-glow);
}

.assignment-item.overdue {
  border-color: rgba(255, 118, 117, 0.3);
  background: rgba(255, 118, 117, 0.05);
}

.assignment-icon {
  font-size: 1.5rem;
}

.assignment-info {
  flex: 1;
}

.assignment-title {
  font-weight: 600;
  font-size: var(--font-size-sm);
  margin-bottom: 2px;
}

.assignment-meta {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  display: flex;
  gap: var(--space-md);
}

.assignment-status {
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

.assignment-status.pending {
  background: rgba(253, 203, 110, 0.15);
  color: var(--classera-accent-warm);
}

.assignment-status.overdue {
  background: rgba(255, 118, 117, 0.15);
  color: var(--classera-danger);
}

.assignment-status.submitted {
  background: rgba(0, 184, 148, 0.15);
  color: var(--classera-success);
}

/* ─── Children Cards (Parent Dashboard) ─────────────────── */
.child-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.child-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--classera-primary), var(--classera-secondary));
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.child-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
  border-color: var(--border-glow);
}

.child-card:hover::before,
.child-card.selected::before {
  opacity: 1;
}

.child-card.selected {
  border-color: var(--classera-primary);
}

.child-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.child-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--classera-primary), var(--classera-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  font-weight: 700;
}

.child-name {
  font-weight: 700;
  font-size: var(--font-size-lg);
}

.child-grade-level {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.child-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.child-stat {
  text-align: center;
}

.child-stat-value {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  line-height: 1;
}

.child-stat-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* ─── Grade Status Colors ───────────────────────────────── */
.grade-excellent { color: var(--classera-success); }
.grade-good { color: var(--classera-info); }
.grade-average { color: var(--classera-accent-warm); }
.grade-poor { color: var(--classera-danger); }

/* ─── Admin KPI Cards ───────────────────────────────────── */
.kpi-value-large {
  font-size: var(--font-size-4xl);
  font-weight: 800;
  background: linear-gradient(135deg, var(--classera-primary-light), var(--classera-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Profile Grid (responsive) ────────────────────────── */
@media (max-width: 860px) {
  #profileGrid {
    grid-template-columns: 1fr !important;
  }
}

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
