/* ============================================
   KS3 - Design System
   Matches Mr Hope's Classroom design language
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&family=Roboto:wght@400;500&display=swap');

:root {
  /* Typography - Match main app */
  --font-display: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  
  /* Colors - Match main app */
  --white: #ffffff;
  --grey-50: #f8f9fa;
  --grey-100: #f1f3f4;
  --grey-200: #e8eaed;
  --grey-300: #dadce0;
  --grey-600: #5f6368;
  --grey-900: #202124;
  
  --green: #34a853;
  --green-hover: #2e7d32;
  --green-light: #e6f4ea;
  --orange: #E67E22;
  --orange-hover: #D35400;
  --orange-light: #FDF2E9;
  --blue: #1a73e8;
  --blue-light: #e8f0fe;
  --purple: #9c27b0;
  --purple-light: #f3e5f5;
  --teal: #00796b;
  --teal-light: #e0f2f1;
  --red: #d93025;
  --red-light: #fce8e6;

  /* Theme - Orange for KS3 */
  --primary: var(--orange);
  --primary-hover: var(--orange-hover);
  --primary-light: var(--orange-light);
  --text-primary: var(--grey-900);
  --text-secondary: var(--grey-600);
  --bg-page: #fdfdfd;
  --bg-card: var(--white);
  --bg-light: var(--grey-50);
  --border-color: var(--grey-200);

  /* Semantic */
  --success: var(--green);
  --success-light: var(--green-light);
  --error: var(--red);
  --error-light: var(--red-light);

  /* Effects - Match main app */
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-modal: 0 30px 100px rgba(0, 0, 0, 0.1);
  
  /* Radii - Match main app */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 100px;

  /* Subject Gradients */
  --gradient-materials: linear-gradient(135deg, #64b5f6 0%, #1a73e8 100%);
  --gradient-manufacturing: linear-gradient(135deg, #ffb74d 0%, #E67E22 100%);
  --gradient-design: linear-gradient(135deg, #ce93d8 0%, #9c27b0 100%);
  --gradient-systems: linear-gradient(135deg, #81c995 0%, #34a853 100%);
  --gradient-cad: linear-gradient(135deg, #80cbc4 0%, #00796b 100%);
}

/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ===== Navigation - Match main app header ===== */
.navbar {
  position: sticky;
  top: 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
}

.nav-left, .nav-right { display: flex; align-items: center; gap: 12px; }

.nav-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  color: var(--text-primary);
}

.nav-back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 18px;
  transition: background 0.2s;
}
.nav-back:hover { background: var(--bg-light); }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.icon-btn:hover { background: var(--bg-light); }
.icon-btn svg { width: 20px; height: 20px; }

/* Session Badge - Match main app */
.session-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: var(--radius-xl);
  font-size: 14px;
}
.session-name { font-weight: 500; }
.session-room { font-weight: 700; color: var(--primary); }

.room-code-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
}

.logout-btn {
  background: none;
  border: 1px solid var(--grey-300);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  transition: all 0.2s;
}
.logout-btn:hover { background: var(--error-light); color: var(--error); border-color: var(--error); }
.logout-btn svg { width: 16px; height: 16px; }

/* ===== Main Container ===== */
.main-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px;
  min-height: calc(100vh - 64px);
}

/* ===== Home Page ===== */
.home-header {
  text-align: center;
  margin-bottom: 48px;
}

.home-logo {
  width: 120px;
  height: 84px;
  background: linear-gradient(135deg, #ffb74d 0%, #E67E22 100%);
  border-radius: 14px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.home-logo svg { width: 100%; height: 100%; }

.home-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.home-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
}

/* Loading */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
}
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--grey-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Subject Grid - Match app-card style ===== */
.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 32px;
}

.subject-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.subject-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.subject-icon {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 12px 0;
  border-radius: var(--radius-md);
  transition: transform 0.3s ease;
}
.subject-card:hover .subject-icon { transform: scale(1.02); }
.subject-icon svg { width: 100%; height: 100%; max-width: 120px; }

.subject-icon.materials { background: var(--gradient-materials); }
.subject-icon.manufacturing { background: var(--gradient-manufacturing); }
.subject-icon.design_communication { background: var(--gradient-design); }
.subject-icon.systems { background: var(--gradient-systems); }
.subject-icon.cad_thinking { background: var(--gradient-cad); }

.subject-info { padding: 24px; }

.subject-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--grey-100);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.subject-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.subject-description {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.subject-btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 24px;
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-full);
  color: var(--primary);
  transition: all 0.2s;
}
.subject-card:hover .subject-btn {
  background: var(--primary);
  color: white;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px;
  color: var(--text-secondary);
}

/* ===== Learning Path Page ===== */
.subject-path-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 48px;
}

.subject-path-icon {
  width: 100px;
  height: 70px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  padding: 10px;
}
.subject-path-icon svg { width: 100%; height: 100%; }

.subject-path-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 400;
}

/* Learning Path */
.path-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* Connecting Line */
.path-container::before {
  content: '';
  position: absolute;
  top: 40px;
  bottom: 40px;
  left: 50%;
  width: 4px;
  background: var(--grey-200);
  transform: translateX(-50%);
  border-radius: 2px;
  z-index: 0;
}

.level-node {
  position: relative;
  width: 100%;
  z-index: 1;
  padding: 16px 0;
}

.level-link {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  padding: 8px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}
.level-link:hover { background: rgba(0,0,0,0.02); }

/* Alternate alignment */
.level-node:nth-child(odd) .level-link { 
  flex-direction: row;
  margin-right: 15%;
}
.level-node:nth-child(even) .level-link { 
  flex-direction: row-reverse;
  margin-left: 15%;
}

.level-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: white;
  border: 4px solid var(--grey-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: var(--grey-600);
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

.level-node.active .level-circle {
  border-color: var(--primary);
  color: var(--primary);
}

.level-node.completed .level-circle {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.level-node.locked { opacity: 0.5; }
.level-node.locked .level-link { pointer-events: none; }

.level-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  color: var(--text-primary);
  background: white;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}
.level-node.active .level-name { border-color: var(--primary); }
.level-link:hover .level-name { box-shadow: var(--shadow-hover); }

/* ===== Learning Interface ===== */
.learn-container {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.learn-progress {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.learn-progress-dots { display: flex; gap: 8px; }
.progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--grey-200);
  transition: all 0.2s ease;
}
.progress-dot.completed { background: var(--success); }
.progress-dot.current { background: var(--primary); transform: scale(1.2); }

.learn-step-count {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Atom Card */
.atom-card {
  width: 100%;
  background: white;
  border-radius: var(--radius-2xl);
  padding: 48px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  margin-bottom: 32px;
  border: 1px solid var(--border-color);
}

.atom-id {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--grey-100);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.atom-text {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 24px;
}

.atom-example {
  background: var(--bg-light);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary);
  text-align: left;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.atom-example strong { color: var(--primary); }

.atom-audio { margin-top: 24px; }
.audio-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-light);
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}
.audio-btn:hover { background: var(--primary-light); color: var(--primary); }
.audio-btn svg { width: 16px; height: 16px; }

/* Got It Button - Match btn-submit style */
.got-it-btn {
  width: 100%;
  padding: 16px 24px;
  border-radius: var(--radius-lg);
  background: var(--primary);
  color: white;
  border: none;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(230, 126, 34, 0.2);
  transition: all 0.2s;
}
.got-it-btn:hover { opacity: 0.95; transform: translateY(-1px); }
.got-it-btn:active { transform: translateY(1px); }
.got-it-btn svg { width: 20px; height: 20px; }

/* Navigation */
.learn-nav {
  width: 100%;
  display: flex;
  gap: 16px;
  margin-top: 24px;
}

.nav-btn {
  flex: 1;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.nav-btn.primary { background: var(--primary); color: white; }
.nav-btn.primary:hover { background: var(--primary-hover); }
.nav-btn.secondary { background: var(--grey-100); color: var(--text-secondary); }
.nav-btn.secondary:hover { background: var(--grey-200); }
.nav-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Quiz */
.quiz-container {
  text-align: left;
  width: 100%;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.question-text {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 20px;
}

.options-grid { display: grid; gap: 12px; }

.option-btn {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: white;
  text-align: left;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.option-btn:hover:not(:disabled) { 
  border-color: var(--primary); 
  background: var(--primary-light);
}
.option-btn.correct {
  border-color: var(--success);
  background: var(--success-light);
  color: var(--success);
  font-weight: 500;
}
.option-btn.incorrect {
  border-color: var(--error);
  background: var(--error-light);
  color: var(--error);
}

.feedback {
  margin-top: 16px;
  font-weight: 500;
  text-align: center;
  min-height: 24px;
}
.correct-text { color: var(--success); }
.incorrect-text { color: var(--error); }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
.shake { animation: shake 0.3s ease-in-out; }

/* Completion */
.completion-card {
  text-align: center;
  padding: 48px;
  background: white;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}

.completion-icon {
  width: 72px;
  height: 72px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: var(--shadow);
}
.completion-icon svg { width: 36px; height: 36px; }

/* ===== Teacher Dashboard ===== */
.teacher-dashboard-panel {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-bottom: 32px;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 32px;
  box-shadow: var(--shadow);
}

.panel-section { display: flex; flex-direction: column; gap: 16px; }
.panel-section.tools { 
  border-left: 1px solid var(--border-color); 
  padding-left: 32px;
}

.panel-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.mode-switcher { display: flex; gap: 16px; }

.mode-btn {
  flex: 1;
  padding: 20px 16px;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.mode-btn svg { width: 28px; height: 28px; color: var(--text-secondary); }
.mode-btn .mode-desc { font-size: 12px; font-weight: 400; color: var(--text-secondary); }
.mode-btn:hover { border-color: var(--primary); transform: translateY(-2px); }
.mode-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}
.mode-btn.active svg { color: var(--primary); }

.teacher-controls { display: flex; flex-wrap: wrap; gap: 10px; }

.btn-teacher {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: white;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}
.btn-teacher svg { width: 16px; height: 16px; color: var(--text-secondary); }
.btn-teacher:hover { background: var(--bg-light); box-shadow: var(--shadow); }
.btn-teacher.primary { background: var(--primary); color: white; border: none; }
.btn-teacher.primary:hover { background: var(--primary-hover); }
.btn-teacher.danger { color: var(--error); }
.btn-teacher.danger:hover { background: var(--error-light); border-color: var(--error); }
.btn-teacher.outline { background: transparent; }

/* Deployment Status */
.deployment-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  font-weight: 500;
  font-size: 14px;
}
.deployment-status.success { background: var(--success-light); color: var(--success); }
.deployment-status.error { background: var(--error-light); color: var(--error); }
.deployment-status svg { width: 20px; height: 20px; flex-shrink: 0; }

/* Topic Selector */
.topic-selector {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 24px;
}
.topic-selector h3 { 
  font-family: var(--font-display); 
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 20px;
}

.topic-group { margin-bottom: 20px; }
.topic-group-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.topic-buttons { display: flex; flex-wrap: wrap; gap: 10px; }

.topic-deploy-btn {
  padding: 10px 18px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--primary);
  background: white;
  color: var(--primary);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}
.topic-deploy-btn svg { width: 14px; height: 14px; }
.topic-deploy-btn:hover { background: var(--primary); color: white; }

/* Live View */
.live-responses {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-top: 24px;
}
.responses-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  margin-bottom: 20px;
}
.responses-header h2 { 
  font-family: var(--font-display); 
  font-size: 18px;
  font-weight: 500;
}
.responses-list { display: flex; flex-direction: column; gap: 12px; }

.response-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-light);
  border-radius: var(--radius-sm);
}
.student-info { display: flex; align-items: center; gap: 12px; }
.student-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--gradient-manufacturing);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}
.student-avatar svg { width: 20px; height: 20px; }
.student-name { font-weight: 500; }
.student-status { font-size: 13px; color: var(--text-secondary); }
.student-score {
  background: var(--success-light);
  color: var(--success);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 14px;
}
.empty-msg { color: var(--text-secondary); text-align: center; padding: 24px; }

/* ===== Modals - Match main app style ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: 40px;
  box-shadow: var(--shadow-modal);
  padding: 64px;
  width: 90%;
  max-width: 480px;
  text-align: center;
  border: 1px solid #f0f0f0;
  animation: modalFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-content h2 { 
  font-family: var(--font-display); 
  font-size: 36px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.modal-subtitle { 
  color: var(--text-secondary); 
  font-size: 16px;
  margin-bottom: 32px;
}

@keyframes modalFadeIn { 
  from { transform: scale(0.95); opacity: 0; } 
  to { transform: scale(1); opacity: 1; } 
}

.project-code-display {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 6px;
  margin: 24px 0 32px;
}

/* Join Prompt */
.lesson-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  color: var(--primary);
  margin: 16px 0 24px;
}

.modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-primary {
  padding: 14px 28px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(230, 126, 34, 0.2);
}
.btn-primary:hover { opacity: 0.95; transform: translateY(-1px); }

/* Responsive */
@media (max-width: 768px) {
  .subject-grid { grid-template-columns: 1fr; }
  .teacher-dashboard-panel { grid-template-columns: 1fr; }
  .panel-section.tools { 
    border-left: none; 
    border-top: 1px solid var(--border-color); 
    padding-left: 0;
    padding-top: 24px;
  }
  .mode-switcher { flex-direction: column; }
  .main-container { padding: 24px 16px; }
  .modal-content { padding: 40px 24px; border-radius: 24px; }
  
  /* Navbar */
  .navbar { padding: 0 16px; height: 56px; }
  .nav-title { font-size: 16px; }
  .icon-btn { width: 32px; height: 32px; }
  .icon-btn svg { width: 18px; height: 18px; }
  
  /* Home */
  .home-header { margin-bottom: 32px; }
  .home-logo { width: 100px; height: 70px; margin-bottom: 20px; }
  .home-title { font-size: 28px; }
  .home-subtitle { font-size: 14px; }
  
  /* Subject cards */
  .subject-icon { height: 140px; }
  .subject-info { padding: 20px; }
  .subject-name { font-size: 20px; }
  .subject-description { font-size: 14px; margin-bottom: 20px; }
  
  /* Learning path */
  .subject-path-header { margin-bottom: 32px; }
  .subject-path-icon { width: 80px; height: 56px; }
  .subject-path-title { font-size: 24px; }
  .level-circle { width: 48px; height: 48px; font-size: 16px; }
  .level-name { font-size: 14px; padding: 8px 12px; }
  .level-node:nth-child(odd) .level-link { margin-right: 5%; }
  .level-node:nth-child(even) .level-link { margin-left: 5%; }
  
  /* Learning interface */
  .learn-container { padding: 0 8px; }
  .atom-card { padding: 32px 24px; border-radius: var(--radius-xl); }
  .atom-text { font-size: 20px; }
  .atom-example { padding: 14px 16px; font-size: 13px; }
  .got-it-btn { padding: 14px 20px; font-size: 16px; }
  .option-btn { padding: 12px 16px; font-size: 15px; }
  .question-text { font-size: 16px; }
  
  /* Teacher dashboard */
  .teacher-dashboard-panel { padding: 24px; }
  .mode-btn { padding: 16px 12px; }
  .mode-btn svg { width: 24px; height: 24px; }
  .btn-teacher { padding: 8px 12px; font-size: 13px; }
  .topic-selector { padding: 20px; }
  .topic-deploy-btn { padding: 8px 14px; font-size: 13px; }
  
  /* Live view */
  .live-responses { padding: 20px; }
  .responses-header h2 { font-size: 16px; }
  .response-item { padding: 12px 14px; }
  .student-avatar { width: 36px; height: 36px; }
  .student-name { font-size: 14px; }
  
  /* Completion */
  .completion-card { padding: 32px 24px; }
  .completion-icon { width: 60px; height: 60px; }
  .completion-icon svg { width: 30px; height: 30px; }
}

@media (max-width: 480px) {
  .navbar { padding: 0 12px; }
  .nav-title { font-size: 14px; }
  
  .home-title { font-size: 24px; }
  .home-logo { width: 80px; height: 56px; }
  
  .subject-icon { height: 120px; margin: 8px 8px 0; }
  .subject-info { padding: 16px; }
  .subject-name { font-size: 18px; }
  .subject-btn { padding: 8px 20px; font-size: 13px; }
  
  .atom-card { padding: 24px 20px; }
  .atom-text { font-size: 18px; }
  .atom-id { font-size: 10px; padding: 3px 8px; }
  
  .level-circle { width: 44px; height: 44px; font-size: 14px; }
  .level-name { font-size: 13px; }
  
  .teacher-dashboard-panel { padding: 16px; }
  .panel-title { font-size: 13px; }
  .mode-btn { font-size: 14px; }
  .mode-btn .mode-desc { font-size: 11px; }
  
  .modal-content { padding: 32px 20px; }
  .modal-content h2 { font-size: 28px; }
  .project-code-display { font-size: 40px; letter-spacing: 4px; }
}
