/* CourseOS · More Screen
   Menu items, Grade Risk view, attendance tracker,
   grade weight bars, semester management. */

/* Header */
.more-header {
  padding: var(--space-md) var(--space-md) var(--space-sm);
}

.more-title {
  font-size: var(--font-xl);
  font-weight: 700;
  color: var(--text-primary);
}

.more-subtitle {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Menu items */
.more-menu {
  margin: 0 var(--space-md);
}

.more-menu-item {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: var(--border-width) solid var(--border-color);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-xs);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.more-menu-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

.more-menu-icon.red { background: #FEF0F0; }
.more-menu-icon.purple { background: #F3EEFF; }
.more-menu-icon.orange { background: #FFF0D4; }
.more-menu-icon.blue { background: #DBEAFE; }
.more-menu-icon.teal { background: #E8F8F5; }
.more-menu-icon.gray { background: var(--gray-100); }

.more-menu-info {
  flex: 1;
  min-width: 0;
}

.more-menu-label {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.more-menu-detail {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  margin-top: 1px;
}

.more-menu-arrow {
  color: var(--text-muted);
  font-size: var(--font-sm);
  flex-shrink: 0;
}

/* Grade Risk Panel */
.grade-risk-panel {
  display: none;
}

.grade-risk-panel.open {
  display: block;
}

.grade-risk-back {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--color-red);
  cursor: pointer;
  border: none;
  background: none;
}

/* Course risk card */
.risk-card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: var(--border-width) solid var(--border-color);
  margin: 0 var(--space-md) var(--space-sm);
  overflow: hidden;
}

.risk-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-bottom: var(--border-width) solid var(--gray-100);
}

.risk-card-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.risk-card-name {
  font-size: var(--font-sm);
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.risk-card-status {
  font-size: 8px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.risk-card-status.ok {
  background: #E8F8F5;
  color: #1A8A6A;
}

.risk-card-status.warning {
  background: #FFF0D4;
  color: #7A4800;
}

.risk-card-status.danger {
  background: #FEF0F0;
  color: #C0392B;
}

.risk-card-body {
  padding: var(--space-sm) var(--space-md);
}

/* Attendance tracker */
.attendance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.attendance-label {
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--text-secondary);
}

.attendance-controls {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.attendance-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: var(--border-width) solid var(--border-color);
  background: var(--bg-secondary);
  font-size: var(--font-base);
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.attendance-count {
  font-size: var(--font-base);
  font-weight: 700;
  color: var(--text-primary);
  min-width: 20px;
  text-align: center;
}

.attendance-limit {
  font-size: var(--font-xs);
  color: var(--text-muted);
}

/* Grade weight bars */
.grade-weights-section {
  margin-top: var(--space-xs);
  padding-top: var(--space-xs);
  border-top: var(--border-width) solid var(--gray-100);
}

.grade-weight-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: 6px;
}

.grade-weight-label {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  min-width: 80px;
}

.grade-weight-bar-bg {
  flex: 1;
  height: 8px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.grade-weight-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: var(--transition-fast);
}

.grade-weight-pct {
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--text-primary);
  min-width: 28px;
  text-align: right;
}

/* Late policy */
.late-policy-row {
  margin-top: var(--space-xs);
  padding-top: var(--space-xs);
  border-top: var(--border-width) solid var(--gray-100);
}

.late-policy-label {
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.late-policy-text {
  font-size: var(--font-xs);
  color: var(--text-primary);
  line-height: 1.4;
}

/* Section divider */
.more-section-label {
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: var(--space-sm) var(--space-md) var(--space-xs);
}

/* Theme indicator */
.theme-indicator {
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--text-muted);
}

/* Version footer */
.more-progress-link {
  text-align: center;
  padding: var(--space-sm) var(--space-md);
}

.more-progress-btn {
  display: inline-block;
  padding: 10px 20px;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--color-blue);
  background: #DBEAFE;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition-fast);
}

.more-progress-btn:active {
  transform: scale(0.97);
}

.more-footer {
  text-align: center;
  padding: var(--space-md);
  font-size: var(--font-xs);
  color: var(--text-muted);
}

/* ── Email Hub ───────────────────────────────────────── */

.email-forward-note {
  margin: 0 var(--space-md) var(--space-md);
  padding: 10px 14px;
  background: #EFF6FF;
  border-radius: var(--radius-md);
  font-size: 11px;
  color: #1E40AF;
  line-height: 1.4;
}

.email-prof-card {
  margin: 0 var(--space-md) var(--space-sm);
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: var(--border-width) solid var(--border-color);
  overflow: hidden;
  transition: var(--transition-fast);
}

.email-prof-card.selected {
  box-shadow: var(--shadow-md);
}

.email-prof-header {
  display: flex;
  align-items: center;
  padding: 12px var(--space-md);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.email-prof-header:active {
  background: var(--gray-100);
}

.email-prof-info {
  flex: 1;
  min-width: 0;
}

.email-prof-name {
  font-size: var(--font-sm);
  font-weight: 700;
  color: var(--text-primary);
}

.email-prof-course {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  margin-top: 1px;
}

.email-prof-email {
  font-size: 10px;
  color: var(--text-muted);
  padding: 0 var(--space-md) 8px;
  font-family: monospace;
}

.email-prof-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.email-icon-btn {
  width: 36px;
  height: 36px;
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: var(--transition-fast);
}

.email-icon-btn:active {
  background: var(--gray-100);
  transform: scale(0.95);
}

/* Template buttons */
.email-templates {
  padding: 0 var(--space-md) 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  animation: warningSlideIn 0.2s ease-out;
}

.email-templates-label {
  width: 100%;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 4px;
  padding-top: 4px;
  border-top: var(--border-width) solid var(--gray-100);
}

.email-template-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-full);
  background: var(--bg-primary);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: var(--transition-fast);
}

.email-template-btn:active {
  background: var(--gray-100);
  transform: scale(0.96);
}

.email-template-icon {
  font-size: 14px;
}

.email-template-label {
  white-space: nowrap;
}

/* Quick links at bottom */
.email-quick-links {
  display: flex;
  gap: 8px;
  padding: var(--space-md);
}

.email-quick-link {
  flex: 1;
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: var(--transition-fast);
}

.email-quick-link:active {
  background: var(--gray-100);
}

/* ── TTS Settings ─────────────────────────────────── */

.tts-settings {
  padding: 0 var(--space-md);
}

.tts-setting-row {
  margin-bottom: var(--space-md);
}

.tts-setting-label {
  font-size: var(--font-sm);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

/* Engine toggle */
.tts-engine-toggle {
  display: flex;
  gap: 0;
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.tts-engine-btn {
  flex: 1;
  padding: 10px 12px;
  border: none;
  background: var(--bg-primary);
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition-fast);
}

.tts-engine-btn + .tts-engine-btn {
  border-left: var(--border-width) solid var(--border-color);
}

.tts-engine-btn.active {
  background: var(--color-red);
  color: #fff;
}

/* Voice selector */
.tts-voice-select {
  width: 100%;
  padding: 10px 12px;
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  outline: none;
}

/* Speed buttons */
.tts-speed-btns {
  display: flex;
  gap: 6px;
}

.tts-speed-btn {
  flex: 1;
  padding: 10px 0;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  font-size: var(--font-sm);
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: var(--transition-fast);
}

.tts-speed-btn.active {
  border-color: var(--color-red);
  color: var(--color-red);
  background: #FEF0F0;
}

.tts-speed-btn:active {
  transform: scale(0.95);
}

/* Screen reader hint */
.tts-setting-hint {
  padding: 12px;
  background: #F3EEFF;
  border-radius: var(--radius-md);
  font-size: var(--font-xs);
  color: #5B21B6;
  line-height: 1.5;
  margin-bottom: var(--space-md);
}

/* Test button */
.tts-test-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--color-red);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  margin-top: var(--space-sm);
  transition: var(--transition-fast);
}

.tts-test-btn:active {
  opacity: 0.8;
  transform: scale(0.98);
}

/* Back button shared style */
.more-back-btn {
  display: inline-block;
  margin-top: 4px;
  padding: 6px 0;
  border: none;
  background: none;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--color-red);
  cursor: pointer;
  font-family: inherit;
}
