/* Dashboard Styles - Teacher & Parent */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', sans-serif;
  background: #f5f7fa;
  color: #333;
}

/* Login */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.login-box {
  background: white;
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  min-width: 300px;
}

.login-box h2 { margin-bottom: 8px; font-size: 24px; }
.login-box p { color: #888; margin-bottom: 20px; }

.login-box input {
  width: 100%;
  padding: 14px;
  font-size: 24px;
  text-align: center;
  border: 2px solid #ddd;
  border-radius: 12px;
  margin-bottom: 16px;
  letter-spacing: 12px;
}

.login-box button {
  width: 100%;
  padding: 14px;
  font-size: 18px;
  font-weight: 700;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
}

.error { color: #E74C3C; margin-top: 12px; font-weight: 600; }

/* Dashboard Layout */
.dashboard { padding: 20px; max-width: 1200px; margin: 0 auto; }

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.dash-header h1 { font-size: 28px; color: #333; }

.back-link {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  border: 2px solid #667eea;
}

/* Tabs */
.dash-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 0;
}

.tab {
  padding: 10px 24px;
  font-size: 16px;
  font-weight: 600;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  color: #888;
  transition: all 0.2s;
}

.tab.active { color: #667eea; border-bottom-color: #667eea; }
.tab:hover { color: #333; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Child Cards */
.child-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 20px; }

.child-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.child-card h3 { font-size: 20px; margin-bottom: 16px; }

.child-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.star-badge {
  background: #FFF3CD;
  color: #F57F17;
  padding: 6px 14px;
  border-radius: 12px;
  font-weight: 700;
}

/* Progress Items */
.progress-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }

.progress-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #f9f9f9;
}

.progress-item.good { background: #e8f5e9; }
.progress-item.ok { background: #fff8e1; }
.progress-item.needs-work { background: #fce4ec; }

.topic-icon { font-size: 24px; }
.progress-title { flex: 1; font-weight: 600; }
.progress-score { font-weight: 700; min-width: 45px; text-align: right; }
.progress-stars { min-width: 60px; text-align: right; }

/* Week Chart */
.week-chart { margin-top: 16px; }
.week-chart h4 { margin-bottom: 12px; color: #888; }

.chart-bars {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  height: 140px;
}

.bar-group { display: flex; flex-direction: column; align-items: center; flex: 1; }

.bar {
  width: 100%;
  max-width: 40px;
  background: #667eea;
  border-radius: 6px 6px 0 0;
  min-height: 4px;
  position: relative;
}

.bar-value {
  position: absolute;
  top: -20px;
  font-size: 11px;
  font-weight: 700;
  color: #333;
  white-space: nowrap;
}

.bar-lessons { font-size: 11px; color: #888; margin-top: 4px; }
.bar-label { font-size: 12px; color: #888; margin-top: 2px; }

/* Mastery Grid */
.mastery-grid { display: flex; flex-direction: column; gap: 12px; }

.mastery-item {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px;
  background: #f9f9f9;
  border-radius: 12px;
}

.mastery-icon { font-size: 32px; }

.mastery-info { flex: 1; }
.mastery-name { font-weight: 700; font-size: 16px; }
.mastery-level { font-size: 14px; font-weight: 600; }

.mastery-bar {
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  margin: 6px 0;
  overflow: hidden;
}

.mastery-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s;
}

.mastery-stats { font-size: 13px; color: #888; }

/* Session Controls */
.session-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.session-row select, .session-row button {
  padding: 10px 16px;
  font-size: 16px;
  border-radius: 8px;
  border: 2px solid #ddd;
}

.session-row button {
  background: #5CB85C;
  color: white;
  border-color: #5CB85C;
  font-weight: 700;
  cursor: pointer;
}

.active-session {
  background: white;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  margin-bottom: 24px;
}

.session-timer {
  font-size: 48px;
  font-weight: 700;
  color: #667eea;
  text-align: center;
  margin: 16px 0;
}

.active-session textarea {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 2px solid #ddd;
  border-radius: 10px;
  margin: 12px 0;
  resize: vertical;
}

.btn-end {
  padding: 12px 24px;
  background: #E74C3C;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.session-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.session-table th, .session-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.session-table th {
  background: #f5f7fa;
  font-weight: 700;
  color: #555;
}

/* Parent Dashboard - Overview */
.overview-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.overview-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.overview-avatar { font-size: 64px; margin-bottom: 8px; }
.overview-name { font-size: 24px; font-weight: 700; margin-bottom: 16px; }

.overview-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.stat {
  background: #f5f7fa;
  padding: 12px;
  border-radius: 10px;
}

.stat-value { font-size: 22px; font-weight: 700; color: #333; }
.stat-label { font-size: 13px; color: #888; margin-top: 4px; }

/* Alerts */
.alerts-box {
  background: #FFF3CD;
  border: 2px solid #F5A623;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
}

.alerts-box h3 { color: #856404; margin-bottom: 12px; }

.alert-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.alert-item:last-child { border-bottom: none; }

/* Comparison Table */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.comparison-table th, .comparison-table td {
  padding: 14px;
  text-align: center;
  border-bottom: 1px solid #eee;
}

.comparison-table th { background: #f5f7fa; font-weight: 700; }
.comparison-table td:first-child { text-align: left; font-weight: 600; }

.level-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 8px;
  color: white;
  font-size: 13px;
  font-weight: 700;
}

.not-started { color: #ccc; }

/* Badges */
.badges-grid { display: flex; flex-wrap: wrap; gap: 12px; }

.badge {
  text-align: center;
  padding: 16px;
  background: #f5f7fa;
  border-radius: 12px;
  min-width: 100px;
}

.badge-icon { font-size: 36px; }
.badge-name { font-size: 14px; font-weight: 700; margin-top: 4px; }
.badge-date { font-size: 12px; color: #888; }

/* Teacher Notes */
.note-item {
  background: white;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.note-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.note-date { color: #888; font-size: 14px; }

.mood-badge {
  background: #e3f2fd;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: #1565c0;
}

.note-text { color: #555; line-height: 1.5; }

/* Section */
.section { margin-bottom: 30px; }
.section h2 { font-size: 22px; margin-bottom: 16px; color: #333; }

.empty { color: #999; font-style: italic; padding: 12px; }

/* Responsive */
@media (max-width: 600px) {
  .dashboard { padding: 12px; }
  .child-cards { grid-template-columns: 1fr; }
  .overview-row { grid-template-columns: 1fr; }
  .dash-header { flex-direction: column; gap: 12px; }
  .chart-bars { height: 100px; }
}
