.page-container {
  padding: 32px 40px;
  max-width: 1400px;
}

.breadcrumb {
  margin-bottom: 24px;
}

.breadcrumb a {
  color: #667eea;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: #8b9cf7;
}

.student-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.student-profile {
  display: flex;
  align-items: center;
  gap: 20px;
}

.student-avatar {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 28px;
}

.student-info h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.student-info p {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
}

.section-title {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 20px;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  gap: 16px;
}

.loader {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-state p {
  color: var(--text-secondary);
}

.empty-state {
  text-align: center;
  padding: 80px 0;
}

.empty-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
}

.empty-state h3 {
  color: var(--text-primary);
  font-size: 18px;
  margin: 0 0 8px;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
}

.history-table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--border-color);
}

.history-table {
  width: 100%;
  border-collapse: collapse;
}

.history-table thead {
  background: var(--bg-hover);
}

.history-table th {
  padding: 14px 20px;
  text-align: left;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.history-table td {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 14px;
}

.history-table tbody tr {
  transition: background 0.2s;
}

.history-table tbody tr:hover {
  background: var(--bg-hover);
}

.quiz-name {
  font-weight: 600;
}

.score-badge {
  background: rgba(102, 126, 234, 0.15);
  color: #667eea;
  padding: 4px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
}

.percent-bar {
  width: 80px;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}

.percent-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.percent-fill.good {
  background: linear-gradient(90deg, #4ade80, #22c55e);
}

.percent-fill.avg {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.percent-fill.poor {
  background: linear-gradient(90deg, #f87171, #ef4444);
}

.percent-text {
  color: var(--text-secondary);
  font-size: 13px;
}

.view-btn {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  transition: color 0.2s;
}

.view-btn:hover {
  color: #8b9cf7;
}

@media (max-width: 768px) {
  .page-container {
    padding: 24px 16px;
  }
}

.content-wrapper {
  max-width: 1100px;
  margin: 0; /* force left alignment */
}

.student-level-control {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.level-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.level-pills {
  display: flex;
  background: rgba(0, 0, 0, 0.04);
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
}

.level-pill {
  border: none;
  background: transparent;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.level-pill:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.02);
}

.level-pill.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.level-pill.active[data-level="beginner"] { color: #64748b; }
.level-pill.active[data-level="intermediate"] { color: #3b82f6; }
.level-pill.active[data-level="advanced"] { color: #a855f7; }
.level-pill.active[data-level="expert"] { color: #f59e0b; }

@media (max-width: 640px) {
  .student-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }
  .student-level-control {
    align-items: flex-start;
    width: 100%;
  }
  .level-pills {
    width: 100%;
    overflow-x: auto;
  }
}

/* Toast Notification */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  color: #fff;
}

.toast-success {
  background: linear-gradient(135deg, #10b981, #059669);
}

.toast-error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.toast .material-symbols-rounded {
  font-size: 20px;
}
