@import url(https://fonts.googleapis.com/css2?family=Noto+Sans+HK:wght@100..900&display=swap);
@import url(https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap);
@import url(https://fonts.googleapis.com/css2?family=Concert+One&display=swap);
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code {
  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
    monospace;
}

.teacher-page-dashboard {
  min-height: 100vh;
  background-color: #f5f5f5;
  max-width: 1200px;
  margin: 0 auto;
}

.teacher-page-dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 10px 20px;
  background-color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.teacher-page-header-left {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.teacher-page-dashboard-header h1 {
  margin: 0;
  color: #333;
  font-size: 24px;
}

.teacher-page-refresh-info {
  color: #666;
  font-size: 0.9em;
}

.teacher-page-view-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  padding: 10px;
  background-color: white;
  border-radius: 0px 0px 8px 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.teacher-page-view-selector-button {
  padding: 10px 20px;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  color: #495057;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.95em;
}

.teacher-page-view-selector-button:hover {
  background-color: #e9ecef;
  border-color: #ced4da;
}

.teacher-page-view-selector-button.teacher-page-active {
  background-color: #007bff;
  color: white;
  border-color: #0056b3;
}

.teacher-page-view-placeholder {
  background-color: white;
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.teacher-page-view-placeholder h2 {
  color: #2c3e50;
  margin-bottom: 15px;
}

.teacher-page-view-placeholder p {
  color: #666;
  font-size: 1.1em;
}

.teacher-page-header-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.teacher-page-refresh-button {
  padding: 8px 16px;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.teacher-page-refresh-button:hover:not(:disabled) {
  background-color: #218838;
}

.teacher-page-refresh-button:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}

.teacher-page-refresh-button.teacher-page-refreshing {
  background-color: #6c757d;
  cursor: wait;
}

.teacher-page-logout-button {
  padding: 8px 16px;
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.teacher-page-logout-button:hover {
  background-color: #c82333;
}

.teacher-page-dashboard-content {
  max-width: 1200px;
  margin: 0 auto;
}

.teacher-page-dashboard-section {
  background-color: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 40px;
}

.teacher-page-dashboard-section h2 {
  color: #333;
  margin-bottom: 20px;
}

.teacher-page-dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  grid-gap: 20px;
  gap: 20px;
  margin-bottom: 30px;
}

.teacher-page-dashboard-card {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.teacher-page-dashboard-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.teacher-page-dashboard-card h3 {
  color: #2c3e50;
  margin: 0 0 10px 0;
}

.teacher-page-dashboard-card p {
  color: #666;
  margin: 0;
  font-size: 14px;
}

.teacher-page-student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  grid-gap: 20px;
  gap: 20px;
  padding: 20px;
}

.teacher-page-student-card {
  background-color: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.teacher-page-student-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.teacher-page-student-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #eee;
}

.teacher-page-student-card-header h3 {
  margin: 0;
  color: #2c3e50;
  font-size: 1.2em;
}

.teacher-page-student-status {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.9em;
  background-color: #e9ecef;
  color: #495057;
}

.teacher-page-student-card-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.teacher-page-student-card-info p,
.teacher-page-student-card-activity p {
  margin: 5px 0;
  color: #666;
  font-size: 0.9em;
}

.teacher-page-student-detail-modal {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 70% 30%;
  grid-gap: 12px;
  gap: 12px;
}

.teacher-page-student-detail-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  flex: 1 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  z-index: 5; /* Ensure it's below buttons but above other content */
}

.teacher-page-student-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}

.teacher-page-student-detail-grid-top {
  display: flex;
  flex-direction: row;
  gap: 8px;
  height: 100%;
}

.teacher-page-student-detail-grid-bottom {
  padding: 0px 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  max-height: 500px;
  overflow-y: auto;
  position: relative;
}

.teacher-page-scroll-indicator {
  position: -webkit-sticky;
  position: sticky;
  left: 10px;
  bottom: 10px;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  animation: bounce 2s infinite;
  z-index: 10;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.teacher-page-scroll-indicator:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-5px);
  }
  60% {
    transform: translateY(-3px);
  }
}

.teacher-page-transcript-section {
  width: 100%;
}

.teacher-page-transcript-section h3 {
  color: #2c3e50;
  font-size: 1.1rem;
  font-weight: 600;
}

.teacher-page-overall-summary-section {
  background-color: #fff;
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.teacher-page-overall-summary-section > div {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 8px;
}

.teacher-page-overall-summary-content {
  color: #4a5568;
  line-height: 1.5;
}

.teacher-page-transcript-sessions {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.teacher-page-transcript-session {
  background-color: #fff;
  border-radius: 6px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.teacher-page-session-header {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.teacher-page-transcript-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.teacher-page-message-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.teacher-page-chat-message {
  padding: 12px;
  border-radius: 6px;
  max-width: 85%;
}

.teacher-page-chat-message.human-message {
  background-color: #e3f2fd;
  align-self: flex-end;
}

.teacher-page-chat-message.ai-message {
  background-color: #f5f5f5;
  align-self: flex-start;
}

.teacher-page-message-header {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
  color: #2c3e50;
}

.teacher-page-message-content {
  color: #4a5568;
  line-height: 1;
  white-space: pre-wrap;
}

.teacher-page-message-timestamp {
  font-size: 0.8rem;
  color: #718096;
  margin-top: 4px;
}

.teacher-page-session-summary {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

.teacher-page-session-summary h4 {
  color: #2c3e50;
  font-size: 1rem;
  margin-bottom: 8px;
}

.teacher-page-session-summary p {
  color: #4a5568;
  line-height: 1.5;
}

.teacher-page-detail-section {
  background-color: white;
  border-radius: 6px;
  padding: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 1px solid #e9ecef;
  font-size: 0.9rem;
  flex: 1 1;
}

.teacher-page-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 12px;
  gap: 12px;
  margin-top: 12px;
}

.teacher-page-info-item {
  display: flex;
  flex-direction: column;
  padding: 8px;
  background-color: #f8f9fa;
  border-radius: 6px;
}

.teacher-page-info-item:nth-child(4),
.teacher-page-info-item:nth-child(5) {
  grid-column: span 1;
}

.teacher-page-label {
  font-size: 0.85rem;
  color: #718096;
  font-weight: 500;
}

.teacher-page-value {
  font-size: 0.95rem;
  color: #2d3748;
  font-weight: 500;
}

.teacher-page-progress-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.teacher-page-student-detail-calendar {
  padding: 12px;
}

.teacher-page-progress-item {
  padding: 10px;
  background-color: #f8f9fa;
  border-radius: 6px;
  display: flex;
  flex-direction: row;
  gap: 4px;
  transition: all 0.2s ease;
  border: 1px solid #e9ecef;
}

.teacher-page-skill {
  font-weight: 600;
  color: #2c3e50;
  font-size: 0.9em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.teacher-page-level {
  color: #495057;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85em;
}

.teacher-page-times {
  color: #6c757d;
  font-size: 0.8em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.teacher-page-student-detail-calendar .mini-calendar {
  flex: 1 1;
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

.teacher-page-student-detail-calendar .mini-calendar-header {
  background-color: #007bff;
  border-radius: 4px 4px 0 0;
}

.teacher-page-student-detail-calendar .mini-calendar-grid {
  flex: 1 1;
  padding: 6px;
  display: flex;
  flex-direction: column;
}

.teacher-page-student-detail-calendar .mini-calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-gap: 1px;
  gap: 1px;
  margin-bottom: 2px;
}

.teacher-page-student-detail-calendar .mini-calendar-days {
  flex: 1 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-gap: 1px;
  gap: 1px;
}

.teacher-page-student-detail-calendar .mini-calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  padding: 1px;
  font-size: 0.8em;
}

.teacher-page-filter-section {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 0px 10px 20px 10px;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.teacher-page-filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 200px;
}

.teacher-page-filter-group label {
  font-weight: 500;
  color: #2c3e50;
  font-size: 14px;
}

.teacher-page-filter-group select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background-color: white;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.teacher-page-filter-group select:hover {
  border-color: #007bff;
}

.teacher-page-filter-group select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.teacher-page-filter-group select option {
  padding: 8px;
}

.teacher-page-question-review-container {
  padding: 0px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.teacher-page-textbook-selector {
  margin-bottom: 20px;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.teacher-page-textbook-selector label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #2c3e50;
}

.teacher-page-textbook-selector select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background-color: white;
}

.teacher-page-questions-list {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.teacher-page-question-type-section {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.teacher-page-question-type-title {
  color: #2c3e50;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #dee2e6;
  font-size: 1.5em;
}

.teacher-page-question-card {
  background-color: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.teacher-page-question-card:last-child {
  margin-bottom: 0;
}

.teacher-page-question-card:hover {
  transform: translateY(-2px);
}

.teacher-page-question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.teacher-page-question-number {
  font-weight: 500;
  color: #2c3e50;
}

.teacher-page-question-difficulty {
  background-color: #e9ecef;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.9em;
  color: #495057;
}

.teacher-page-question-instruction {
  background-color: #f8f9fa;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 15px;
  border-left: 4px solid #007bff;
}

.teacher-page-question-instruction strong {
  color: #2c3e50;
  margin-right: 8px;
}

.teacher-page-question-content {
  font-size: 14px;
  line-height: 1.6;
}

.teacher-page-question-content p {
  margin: 10px 0;
}

.teacher-page-answer-section {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eee;
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 6px;
}

.teacher-page-answer-section p {
  margin: 8px 0;
  display: flex;
  align-items: baseline;
}

.teacher-page-answer-section strong {
  color: #2c3e50;
  min-width: 120px;
  margin-right: 10px;
}

.teacher-page-error-message {
  color: #dc3545;
  padding: 10px;
  margin: 10px 0;
  background-color: #f8d7da;
  border-radius: 4px;
  border: 1px solid #f5c6cb;
}

.teacher-page-loading-state {
  text-align: center;
  padding: 40px;
  font-size: 16px;
  color: #666;
}

.teacher-page-chatHistory {
  width: 100%;
  height: 100%;
  overflow-y: auto;
}

.teacher-page-chat-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 20px;
}

.teacher-page-chat-message {
  max-width: 80%;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.teacher-page-chat-message.human-message {
  background-color: #e3f2fd;
  margin-left: auto;
  border-bottom-right-radius: 2px;
}

.teacher-page-chat-message.ai-message {
  background-color: #f5f5f5;
  margin-right: auto;
  border-bottom-left-radius: 2px;
}

.teacher-page-message-header {
  font-weight: bold;
  margin-bottom: 8px;
  color: #2c3e50;
  font-size: 0.9em;
}

.teacher-page-message-content {
  color: #333;
  line-height: 1;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.teacher-page-message-timestamp {
  font-size: 0.8em;
  color: #666;
  margin-top: 8px;
  text-align: right;
}

.teacher-page-transcript-session {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.teacher-page-transcript-session:last-child {
  border-bottom: none;
}

.teacher-page-transcript-session h3 {
  color: #2c3e50;
  font-size: 1.1em;
  padding-bottom: 10px;
  border-bottom: 2px solid #eee;
}

.teacher-page-session-summary {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  margin-top: 15px;
  border: 1px solid #e9ecef;
}

.teacher-page-session-summary h4 {
  color: #2c3e50;
  margin-bottom: 10px;
  font-size: 1.1em;
}

.teacher-page-session-summary p {
  color: #666;
  line-height: 1.6;
  white-space: pre-wrap;
  margin: 0;
}

.teacher-page-overall-summary-section {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
  border: 1px solid #e9ecef;
}

.teacher-page-overall-summary-section h3 {
  color: #2c3e50;
  margin-bottom: 15px;
  font-size: 1.1em;
}

.teacher-page-overall-summary-content {
  color: #666;
  line-height: 1.6;
  white-space: pre-wrap;
  margin: 0;
}

.teacher-page-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  -webkit-overflow-scrolling: touch;
  overflow: hidden; /* Prevent background scrolling */
  touch-action: manipulation; /* 优化触摸事件处理 */
  pointer-events: auto; /* 确保可以接收点击事件 */
}

.teacher-page-modal-content {
  background-color: white;
  border-radius: 12px;
  width: 95%;
  max-width: 1400px;
  height: 90vh;
  display: flex;
  flex-direction: column;
  position: relative;
  -webkit-overflow-scrolling: touch;
  touch-action: manipulation;
  overflow: hidden; /* Prevent modal content from causing overflow */
  user-select: text; /* 允许文本选择 */
  -webkit-user-select: text;
  z-index: 1001; /* 确保内容在遮罩层之上 */
}

.teacher-page-modal-header {
  padding: 12px 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: white;
  z-index: 1;
}

.teacher-page-modal-header h2 {
  margin: 0;
  color: #2c3e50;
  font-size: 1.2em;
}

.teacher-page-close-button {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 15px;
  min-height: 48px;
  min-width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1100; /* 更高的z-index */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.teacher-page-close-button:hover {
  color: #333;
}

.teacher-page-modal-body {
  flex: 1 1;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  gap: 12px;
  max-height: 70vh;
}

.teacher-page-no-transcript-message {
  text-align: center;
  color: #666;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 4px;
  margin: 20px;
  font-size: 16px;
}

/* Student Detail Modal Styles */
.teacher-page-student-detail-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  grid-gap: 16px;
  gap: 16px;
  height: 100%;
}

.teacher-page-info-item {
  display: flex;
  align-items: center;
  padding: 8px;
  background-color: #f8f9fa;
  border-radius: 8px;
  transition: all 0.2s ease;
  border: 1px solid #e9ecef;
}

.teacher-page-info-item:hover {
  background-color: #e9ecef;
  transform: translateX(4px);
}

.teacher-page-label {
  font-weight: 600;
  color: #495057;
  width: 100%;
  text-align: left;
  font-size: 1.1em;
}

.teacher-page-value {
  color: #2c3e50;
  flex: 1 1;
  font-size: 0.9rem;
}

.teacher-page-progress-item {
  background-color: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: row;
  gap: 12px;
  transition: all 0.2s ease;
  border: 1px solid #e9ecef;
}

.teacher-page-progress-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.teacher-page-skill {
  font-weight: 600;
  color: #2c3e50;
  font-size: 1.2em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.teacher-page-skill::before {
  content: "•";
  color: #28a745;
  font-size: 1.4em;
}

.teacher-page-level {
  color: #495057;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1em;
}

.teacher-page-times {
  color: #6c757d;
  font-size: 1em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.teacher-page-times::before {
  content: "•";
  color: #ffc107;
  font-size: 1.2em;
}

.teacher-page-modal-actions {
  margin-top: 20px;
}

.teacher-page-view-transcript-button {
  padding: 10px 24px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.teacher-page-view-transcript-button:hover {
  background-color: #0056b3;
  transform: translateY(-1px);
}

.teacher-page-view-transcript-button:active {
  transform: translateY(0);
}

/* Responsive adjustments for student detail modal */
@media (max-width: 1200px) {
  .teacher-page-student-detail-modal {
    grid-template-columns: 1fr;
    height: auto;
  }

  .teacher-page-student-detail-calendar {
    height: 300px;
  }
}

@media (max-width: 768px) {
  .teacher-page-student-detail-grid {
    grid-template-columns: 1fr;
  }

  .teacher-page-info-grid,
  .teacher-page-progress-grid {
    grid-template-columns: 1fr;
  }

  .teacher-page-info-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .teacher-page-label {
    min-width: auto;
  }
}

.teacher-page-modal-tabs {
  display: flex;
  gap: 2px;
  padding: 0 20px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
}

.teacher-page-tab-button {
  padding: 12px 24px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #495057;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 48px; /* Larger minimum height */
  min-width: 100px; /* Ensure minimum width */
  position: relative;
  z-index: 10; /* Ensure it's above other elements */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.teacher-page-tab-button:hover {
  color: #007bff;
}

.teacher-page-tab-button.active {
  color: #007bff;
  border-bottom-color: #007bff;
}

.teacher-page-student-profile {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.teacher-page-profile-section {
  display: flex;
  flex-direction: row;
  gap: 0px 20px;
  background-color: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding-top: 0px;
}

.teacher-page-profile-section h3 {
  color: #2c3e50;
  font-size: 1.2rem;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #eee;
}

.teacher-page-profile-subject-chart-section {
  width: 70%;
}

.teacher-page-line-chart-container {
  /* width: 100%; */
  /* height: 400px; */
  background-color: #f8f9fa;
  border-radius: 6px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

@media screen and (max-width: 1194px) {
  .teacher-page-line-chart-container {
    isolation: isolate; 
    pointer-events: none !important; 
  }
}

.teacher-page-profile-weakness-section {
  width: 30%;
}

.teacher-page-profile-weakness-section-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: #f8f9fa;
  padding: 16px;
  border-radius: 6px;
  overflow-y: auto;
  max-height: 300px;
}

.teacher-page-weakness-category {
  background-color: white;
  border-radius: 6px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.teacher-page-weakness-category h4 {
  color: #2c3e50;
  font-size: 0.95rem;
  margin: 0 0 8px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.teacher-page-weakness-category ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.teacher-page-weakness-category li {
  color: #4a5568;
  font-size: 0.9rem;
  padding: 6px 10px;
  background-color: #f8f9fa;
  border-radius: 4px;
  border-left: 3px solid #e53e3e;
  transition: all 0.2s ease;
}

.teacher-page-weakness-category li:hover {
  background-color: #fff5f5;
  transform: translateX(4px);
}

.teacher-page-no-weakness {
  color: #718096;
  font-size: 0.9rem;
  text-align: center;
  padding: 20px;
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.teacher-page-profile-radar-section {
  background-color: white;
  padding: 0px 20px;
}

.teacher-page-profile-radar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 20px;
  gap: 20px;
}

.teacher-page-profile-radar-item {
  background-color: #f8f9fa;
  padding: 0px 8px;
  padding-bottom: 0px;
}

.teacher-page-vocab-mistakes-container {
  height: 200px;
  overflow-y: auto;
  padding: 12px;
  background-color: #f8f9fa;
  border-radius: 6px;
}

.teacher-page-vocab-mistakes-chapter {
  margin-bottom: 12px;
  padding: 8px;
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.teacher-page-profile-radar-item > div:first-child {
  font-weight: 500;
  color: #2c3e50;
  margin-top: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.teacher-page-radar-chart {
  height: 200px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.teacher-page-vocab-mistakes-chapter:last-child {
  margin-bottom: 0;
}

.teacher-page-vocab-mistakes-chapter h5 {
  color: #2c3e50;
  font-size: 0.9rem;
  margin: 0 0 8px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid #e2e8f0;
}

.teacher-page-vocab-mistakes-chapter ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.teacher-page-vocab-mistakes-chapter li {
  color: #4a5568;
  font-size: 0.85rem;
  padding: 2px 6px;
  background-color: #f8f9fa;
  border-radius: 4px;
  border-left: 2px solid #e53e3e;
  transition: all 0.2s ease;
}

.teacher-page-vocab-mistakes-chapter li:hover {
  background-color: #fff5f5;
  transform: translateX(2px);
}

.teacher-page-no-vocab-mistakes {
  color: #718096;
  font-size: 0.9rem;
  text-align: center;
  padding: 20px;
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.teacher-page-textbook-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.teacher-page-textbook-section {
  background-color: #f8f9fa;
  border-radius: 6px;
  padding: 16px;
}

.teacher-page-textbook-section h4 {
  color: #495057;
  font-size: 1rem;
  margin-bottom: 12px;
}

.teacher-page-level-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.teacher-page-level-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.teacher-page-level-label {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.teacher-page-level-value {
  font-size: 24px;
  color: #2c3e50;
  font-weight: 600;
}

.teacher-page-profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #eee;
}

.teacher-page-subject-select {
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #2c3e50;
  margin-right: 10px;
}

.teacher-page-subject-select:hover {
  border-color: #007bff;
}

.teacher-page-subject-select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.teacher-page-subject-select option {
  padding: 8px;
  background-color: white;
  color: #2c3e50;
}

.teacher-page-textbook-select {
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #2c3e50;
}

.teacher-page-textbook-select:hover {
  border-color: #007bff;
}

.teacher-page-textbook-select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.teacher-page-textbook-select option {
  padding: 8px;
  background-color: white;
  color: #2c3e50;
}

.teacher-page-vocab-mistakes-chapter {
  margin-top: 12px;
  padding: 12px;
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.teacher-page-vocab-mistakes-chapter h5 {
  color: #2c3e50;
  font-size: 0.95rem;
  margin: 0 0 8px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.teacher-page-vocab-mistakes-chapter ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.teacher-page-vocab-mistakes-chapter li {
  color: #4a5568;
  font-size: 0.9rem;
  padding: 4px 8px;
  background-color: #f8f9fa;
  border-radius: 4px;
  border-left: 3px solid #e53e3e;
  transition: all 0.2s ease;
}

.teacher-page-vocab-mistakes-chapter li:hover {
  background-color: #fff5f5;
  transform: translateX(4px);
}

.teacher-page-profile-radar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
  color: #2c3e50;
  margin-top: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.teacher-page-profile-radar-header .teacher-page-textbook-select {
  width: auto;
  min-width: 150px;
  margin-left: 12px;
}

/* Exercise History Styles */
.teacher-page-exercise-history-section {
  background-color: white;
  padding: 0px 20px;
  margin-top: 20px;
  height: 100%;
}

.teacher-page-exercise-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
  color: #2c3e50;
  margin-top: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.teacher-page-history-select {
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #2c3e50;
}

.teacher-page-history-select:hover {
  border-color: #007bff;
}

.teacher-page-history-select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.teacher-page-exercise-history-container {
  max-height: 100%;
  overflow-y: auto;
  padding: 12px;
  background-color: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 20px;
  height: 80%;
}

.teacher-page-exercise-history-date {
  margin-bottom: 16px;
  padding: 12px;
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.teacher-page-exercise-history-date:last-child {
  margin-bottom: 0;
}

.teacher-page-exercise-history-date-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.teacher-page-exercise-history-date-header.has-report {
  cursor: pointer;
}

.teacher-page-exercise-history-date-header:not(.has-report) {
  cursor: default;
}

.teacher-page-exercise-history-date-header.has-report:hover {
  background-color: #f8f9fa;
  border-radius: 4px;
  padding-left: 8px;
}

.teacher-page-exercise-history-date h5 {
  color: #2c3e50;
  font-size: 0.95rem;
  margin: 0;
}

.teacher-page-exercise-history-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.teacher-page-exercise-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background-color: #f8f9fa;
  border-radius: 4px;
  transition: all 0.2s ease;
  position: relative;
}

.teacher-page-exercise-history-item:hover {
  background-color: #e9ecef;
  transform: translateX(4px);
}

.teacher-page-exercise-name {
  font-size: 0.9rem;
  color: #4a5568;
  flex: 1 1;
}

.teacher-page-exercise-score {
  font-size: 0.9rem;
  color: #2c3e50;
  font-weight: 600;
  padding: 2px 8px;
  background-color: #e9ecef;
  border-radius: 4px;
  min-width: 60px;
  text-align: center;
  margin-right: 8px;
}

.teacher-page-report-loading-indicator {
  font-size: 0.8rem;
  color: #6c757d;
  margin-left: 8px;
  animation: pulse 1.5s infinite;
}

.teacher-page-report-pdf-icon {
  color: #00a651;
  color: var(--main-green, #00a651);
  font-size: 1.1rem;
  margin-left: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes pulse {
  0% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.5;
  }
}

.teacher-page-no-exercise-history {
  color: #718096;
  font-size: 0.9rem;
  text-align: center;
  padding: 20px;
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.teacher-page-loading-exercise-history {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px;
  color: #718096;
  font-size: 0.9rem;
  text-align: center;
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  animation: pulse 1.5s infinite;
}

.teacher-page-debug-info {
  margin-top: 10px;
  font-size: 0.8rem;
  color: #a0aec0;
  font-style: italic;
}

.teacher-page-no-exercise-item {
  padding: 10px;
  color: #718096;
  font-size: 0.9rem;
  text-align: center;
  background-color: #f8f9fa;
  border-radius: 4px;
  font-style: italic;
}
.teacher-page-exercise-history-tab {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Grouping Toolbar Styles */
.teacher-page-grouping-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin: 0px 20px 20px 20px;
  position: -webkit-sticky;
  position: sticky;
  top: 10px;
  z-index: 1000;
  transition: all 0.3s ease;
}

/* Add shadow effect when toolbar is sticky */
.teacher-page-grouping-toolbar.sticky {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  border-radius: 0;
  margin: 0;
  top: 0;
  padding-left: 40px;
  padding-right: 40px;
}

.teacher-page-toolbar-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.teacher-page-group-button,
.teacher-page-filter-button,
.teacher-page-manage-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.teacher-page-manage-button {
  background-color: #007bff;
}
.teacher-page-manage-button:hover,
.teacher-page-group-button:hover,
.teacher-page-filter-button:hover {
  background-color: #0056b3;
  transform: translateY(-1px);
}

.teacher-page-grouping-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.teacher-page-selected-count {
  color: #495057;
  font-weight: 500;
  font-size: 0.9rem;
}

.teacher-page-assign-button {
  padding: 8px 16px;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.teacher-page-assign-button:hover:not(:disabled) {
  background-color: #218838;
}

.teacher-page-assign-button:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}

.teacher-page-cancel-button {
  padding: 8px 16px;
  background-color: #6c757d;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.teacher-page-cancel-button:hover {
  background-color: #545b62;
}

.teacher-page-sort-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.teacher-page-sort-select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  background-color: white;
  cursor: pointer;
}

.teacher-page-sort-order-button {
  padding: 8px 12px;
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.teacher-page-sort-order-button:hover {
  background-color: #e9ecef;
  border-color: #adb5bd;
}

.teacher-page-active-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.teacher-page-filter-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 12px;
  color: white;
  font-size: 0.8rem;
  font-weight: 500;
}

.teacher-page-clear-filters-small {
  padding: 4px 8px;
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
}

/* Student Card Grouping Mode */
.teacher-page-student-card.grouping-mode {
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.teacher-page-student-card.grouping-mode:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.teacher-page-student-card.selected {
  border: 2px solid #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.teacher-page-selection-checkbox {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 10;
}

.teacher-page-selection-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Student Tags */
.teacher-page-student-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.teacher-page-student-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  color: white;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.teacher-page-student-tag:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

.teacher-page-remove-tag {
  font-size: 0.7rem;
  margin-left: 4px;
  opacity: 0.7;
}

.teacher-page-remove-tag:hover {
  opacity: 1;
}

/* Create Group Modal */
.teacher-page-create-group-modal {
  background-color: white;
  border-radius: 12px;
  width: 90vw;
  max-width: 50dvw;
  height: 70vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.teacher-page-create-group-content {
  padding: 20px;
  flex: 1 1;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.teacher-page-group-name-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.teacher-page-group-name-input {
  flex: 1 1;
}

.teacher-page-preview-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}


.teacher-page-preview-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  color: white;
  font-size: 0.8rem;
  font-weight: 500;
  min-height: 24px;
  min-width: 80px;
  justify-content: center;
}

.teacher-page-selection-panels {
  display: flex;
  gap: 5%;
  flex: 1 1;
  height: 250px;
  width: 100%;
}

.teacher-page-left-panel {
  flex: 0 0 47.5%;
  display: flex;
  flex-direction: column;
  width: 47.5%;
}

.teacher-page-right-panel {
  flex: 0 0 47.5%;
  display: flex;
  flex-direction: column;
  width: 47.5%;
}

.teacher-page-selected-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.teacher-page-emoji-selector-direct {
  flex: 1 1;
  display: flex;
  justify-content: center;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 8px;
  background-color: #f8f9fa;
  overflow: hidden;
}

.teacher-page-form-group {
  margin: 0px 20px 20px 20px
}

.teacher-page-form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #2c3e50;
}

.teacher-page-form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
}

.teacher-page-form-group input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.teacher-page-emoji-selector {
  position: relative;
}

.teacher-page-emoji-selector-direct {
  margin-top: 8px;
  display: flex;
  justify-content: center;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 8px;
  background-color: #f8f9fa;
}

.teacher-page-emoji-button {
  width: 60px;
  height: 60px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background-color: white;
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.teacher-page-emoji-button:hover {
  border-color: #007bff;
  transform: scale(1.05);
}

.teacher-page-emoji-picker {
  position: absolute;
  top: 70px;
  left: 0;
  z-index: 1001;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
  width: 400px;
  height: 400px;
}

/* Color Picker */
.teacher-page-color-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 8px;
  gap: 8px;
  margin-top: 8px;
  padding: 16px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  height: 180px;
  overflow-y: auto;
}


.teacher-page-color-option {
  width: 45px;
  height: 45px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 3px solid transparent;
}

.teacher-page-color-option:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.teacher-page-color-option.selected {
  border-color: #2c3e50;
  transform: scale(1.1);
}

.teacher-page-create-button {
  padding: 10px 20px;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.teacher-page-create-button:hover:not(:disabled) {
  background-color: #218838;
  transform: translateY(-1px);
}

.teacher-page-create-button:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}

/* Grouping Modal */
.teacher-page-grouping-modal {
  background-color: white;
  border-radius: 12px;
  width: 600px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  margin: auto;
  position: relative;
}

.teacher-page-grouping-content {
  padding: 20px;
}

.teacher-page-available-groups h4 {
  color: #2c3e50;
  margin-bottom: 16px;
  font-size: 1.1rem;
}

.teacher-page-groups-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.teacher-page-group-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.teacher-page-group-option:hover {
  border-color: #007bff;
  background-color: #f8f9fa;
}

.teacher-page-group-option.selected {
  border-color: #007bff;
  background-color: #e3f2fd;
}

.teacher-page-group-emoji {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: white;
}

.teacher-page-group-name {
  font-weight: 500;
  color: #2c3e50;
  flex: 1 1;
}

.teacher-page-no-groups {
  text-align: center;
  color: #6c757d;
  padding: 40px 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  font-style: italic;
}

.teacher-page-create-new-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background-color: #17a2b8;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.teacher-page-create-new-button:hover {
  background-color: #138496;
  transform: translateY(-1px);
}

/* Filter Panel */
.teacher-page-filter-panel {
  background-color: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin: 20px;
  border: 1px solid #e9ecef;
}

.teacher-page-filter-section {
  margin-bottom: 20px;
}

.teacher-page-filter-section:last-child {
  margin-bottom: 0;
}

.teacher-page-filter-section h4 {
  color: #2c3e50;
  margin-bottom: 12px;
  font-size: 1rem;
}

.teacher-page-filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.teacher-page-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background-color: #f8f9fa;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid #e9ecef;
}

.teacher-page-filter-option:hover {
  background-color: #e9ecef;
}

.teacher-page-filter-option input[type="checkbox"] {
  margin: 0;
}

.teacher-page-group-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 10px;
  color: white;
  font-size: 0.8rem;
  font-weight: 500;
}

.teacher-page-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
}

.teacher-page-clear-filters-button {
  padding: 8px 16px;
  background-color: #6c757d;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.teacher-page-clear-filters-button:hover {
  background-color: #545b62;
}

.teacher-page-apply-filters-button {
  padding: 8px 16px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.teacher-page-apply-filters-button:hover {
  background-color: #0056b3;
}

/* Modal Actions */
.teacher-page-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
}

/* Responsive Design */
@media (max-width: 768px) {
  .teacher-page-grouping-toolbar {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
    padding: 15px;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1000;
  }
  
  .teacher-page-grouping-toolbar.sticky {
    border-radius: 0;
    margin: 0;
    padding: 15px;
  }
  
  .teacher-page-toolbar-left {
    flex-wrap: wrap;
  }
  
  .teacher-page-grouping-actions {
    flex-wrap: wrap;
  }
  
  .teacher-page-create-group-modal,
  .teacher-page-grouping-modal {
    width: 95%;
    margin: 0 auto;
  }
  
  .teacher-page-filter-options {
    flex-direction: column;
  }
}

/* Manage Groups Modal */
.teacher-page-manage-group-modal {
  background-color: white;
  border-radius: 12px;
  width: 600px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  margin: auto;
  position: relative;
}

.teacher-page-manage-group-content {
  padding: 20px;
}

.teacher-page-manage-groups-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.teacher-page-manage-group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  background-color: #f8f9fa;
  transition: all 0.2s ease;
}

.teacher-page-manage-group-item:hover {
  background-color: #e9ecef;
  border-color: #dee2e6;
}

.teacher-page-group-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1;
}

.teacher-page-group-emoji {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: white;
}

.teacher-page-group-name {
  font-weight: 500;
  color: #2c3e50;
  font-size: 1rem;
}

.teacher-page-group-meta {
  color: #6c757d;
  font-size: 0.85rem;
  margin-left: auto;
  margin-right: 16px;
}

.teacher-page-group-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.teacher-page-edit-group-button {
  padding: 6px 12px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 60px;
}

.teacher-page-edit-group-button:hover {
  background-color: #0056b3;
  transform: translateY(-1px);
}

.teacher-page-delete-group-button {
  padding: 6px 12px;
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 60px;
}

.teacher-page-delete-group-button:hover:not(:disabled) {
  background-color: #c82333;
  transform: translateY(-1px);
}

.teacher-page-delete-group-button:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
  transform: none;
}

/* Confirm Delete Modal */
.teacher-page-confirm-delete-modal {
  background-color: white;
  border-radius: 12px;
  width: 450px;
  max-width: 90vw;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  margin: auto;
  position: relative;
  overflow: hidden;
}

.teacher-page-confirm-delete-modal .teacher-page-modal-header {
  background-color: white;
  border-radius: 12px 12px 0 0;
}

.teacher-page-confirm-delete-content {
  padding: 20px;
  border-radius: 0 0 12px 12px;
}

.teacher-page-confirm-delete-content p {
  margin: 0 0 12px 0;
  color: #2c3e50;
  font-size: 1rem;
  line-height: 1.5;
}

.teacher-page-warning-text {
  color: #e74c3c !important;
  font-size: 0.9rem !important;
  margin-bottom: 24px !important;
}

.teacher-page-confirm-delete-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
}

.teacher-page-confirm-delete-button {
  padding: 10px 20px;
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.teacher-page-confirm-delete-button:hover {
  background-color: #c82333;
  transform: translateY(-1px);
}

/* Emoji Grid Styles */
.teacher-page-emoji-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 8px;
  gap: 8px;
  padding: 16px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  height: 180px;
  overflow-y: auto;
}

@media (min-width: 1440px) {
  .teacher-page-emoji-option {
    width: 60px;
    height: 60px;
  }
}

.teacher-page-emoji-option {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  background-color: white;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.teacher-page-emoji-option:hover {
  border-color: #007bff;
  background-color: #f8f9fa;
  transform: scale(1.05);
}

.teacher-page-emoji-option.selected {
  border-color: #007bff;
  background-color: #e3f2fd;
  transform: scale(1.05);
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

/* Tag Students Modal Styles */
.teacher-page-tag-students-modal {
  background-color: white;
  border-radius: 12px;
  width: 700px;
  max-width: 90vw;
  max-height: 80vh;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  margin: auto;
  position: relative;
  overflow: hidden;
}

.teacher-page-tag-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: white;
  font-size: 0.9rem;
  margin-right: 10px;
}

.teacher-page-tag-students-content {
  padding: 20px;
  max-height: 500px;
  overflow-y: auto;
}

.teacher-page-tag-students-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.teacher-page-tag-student-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  background-color: #f8f9fa;
  transition: all 0.2s ease;
  cursor: pointer;
}

.teacher-page-tag-student-item:hover {
  background-color: #e3f2fd;
  transform: translateY(-2px);
  border-color: #b3d7ff;
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.15);
}

.teacher-page-tag-student-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.teacher-page-tag-student-id-name {
  font-weight: 500;
  color: #2c3e50;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.teacher-page-tag-student-status {
  display: inline-block;
  width: 12px;
  height: 12px;
}

.teacher-page-tag-student-activity {
  color: #6c757d;
  font-size: 0.85rem;
  margin-left: 20px;
  font-style: italic;
}

.teacher-page-tag-student-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.teacher-page-tag-student-grade {
  background-color: #e9ecef;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #495057;
}

.teacher-page-tag-student-school {
  font-size: 0.8rem;
  color: #6c757d;
}

.teacher-page-no-students-message {
  text-align: center;
  color: #6c757d;
  padding: 40px 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  font-style: italic;
}

/* Fix for touch interactions on iPad and other touch devices */
.teacher-page-modal-content {
  -webkit-overflow-scrolling: touch;
  touch-action: manipulation;
}

/* Improved button sizes for touch targets */
.teacher-page-tab-button, 
.teacher-page-close-button {
  min-height: 44px;
  min-width: 44px;
  padding: 10px;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  touch-action: manipulation;
  cursor: pointer;
}

/* Ensure close button is more tappable */
.teacher-page-close-button {
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100; /* Ensure it's above other elements */
}

/* Fix for modal body scrolling */
.teacher-page-modal-body {
  -webkit-overflow-scrolling: touch;
  overflow-y: auto;
  max-height: 70vh;
}

/* Specific fixes for student detail modal */
.teacher-page-student-detail-modal {
  overflow: hidden; /* Prevent double scrollbars */
}

.teacher-page-student-detail-grid-bottom {
  -webkit-overflow-scrolling: touch;
  overflow-y: auto;
  -webkit-user-select: text; /* Enable text selection */
  user-select: text;
}

/* Fix for iPad mini and smaller devices */
@media (max-width: 768px) {
  .teacher-page-tab-button {
    padding: 12px 15px;
  }
  
  .teacher-page-close-button {
    padding: 15px;
  }
}

/* Active state for buttons to provide visual feedback on touch */
.teacher-page-tab-button:active,
.teacher-page-close-button:active {
  opacity: 0.7;
  background-color: rgba(0,0,0,0.05);
}

/* 确保iPad上模态框内容不被截断 */
@media (max-width: 1024px) {
  .teacher-page-modal-content {
    width: 98%;
    max-height: 85vh;
  }
  
  .teacher-page-student-detail-modal {
    grid-template-columns: 1fr;
    overflow: auto;
  }
  
  .teacher-page-modal-body {
    flex-direction: column;
  }
  
  .teacher-page-student-detail-calendar {
    height: 250px;
  }
  
  .teacher-page-tab-button {
    min-width: 80px;
    padding: 12px 15px;
  }
}

/* Active state for buttons to provide visual feedback on touch */
.teacher-page-tab-button:active,
.teacher-page-close-button:active {
  opacity: 0.7;
  background-color: rgba(0,0,0,0.05);
}

/* 修复模态框内部滚动区域 */
.teacher-page-student-detail-content,
.teacher-page-student-detail-grid-bottom,
.teacher-page-profile-weakness-section-content,
.teacher-page-vocab-mistakes-container,
.teacher-page-exercise-history-container {
  -webkit-overflow-scrolling: touch;
  overflow-y: auto;
  touch-action: pan-y; /* 允许垂直滚动 */
  pointer-events: auto;
  position: relative;
  z-index: 5;
}

/* 优化iPad上的加载状态显示 */
.teacher-page-loading-weakness,
.teacher-page-loading-vocab {
  color: #718096;
  font-size: 0.9rem;
  text-align: center;
  padding: 20px;
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}


/* Mini Calendar styles */
.mini-calendar {
  background-color: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: visible;
  position: relative;
}

.mini-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background-color: var(--main-green);
  color: white;
  border-radius: 12px 12px 0 0;
}

.mini-calendar-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.mini-calendar-nav-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  padding: 5px;
  border-radius: 50%;
}

.mini-calendar-nav-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.mini-calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.mini-calendar-weekday {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #6c757d;
  padding: 8px 0;
}

.mini-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 8px;
  grid-gap: 4px;
  gap: 4px;
  min-height: 240px;
  grid-template-rows: repeat(6, minmax(36px, auto));
}

.mini-calendar-day {
  position: relative;
  height: 36px;
  width: 36px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s ease;
  box-sizing: border-box;
}

.mini-calendar-day:hover:not(.empty) {
  background-color: #f0f0f0;
  transform: none;
}

.mini-calendar-day.empty {
  cursor: default;
}

.mini-calendar-day.today {
  background-color: var(--main-green);
  color: white;
  font-weight: 600;
}

.mini-calendar-day.has-events:not(.today) {
  font-weight: 600;
  color: #333;
}

/* Renamed from .selected to .calendar-day-active to avoid conflicts */
.mini-calendar-day.calendar-day-active:not(.today) {
  background-color: #e6f7ff;
  border: 2px solid var(--main-green);
  transform: none;
}

.mini-calendar-day-indicators {
  position: absolute;
  bottom: 2px;
  display: flex;
  gap: 3px;
  justify-content: center;
}

.mini-calendar-day-indicator {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

.mini-calendar-day-indicator.homework {
  background-color: var(--subject-english-color);
}

.mini-calendar-day-indicator.exam {
  background-color: var(--dark-red);
}

.mini-calendar-day-indicator.dictation {
  background-color: var(--bright-blue);
}

.mini-calendar-day.today .mini-calendar-day-indicator {
  background-color: white;
}

/* Calendar details container */
.mini-calendar-details-container {
  position: relative;
  width: 100%;
  flex-shrink: 0;
  min-height: 20px;
}

/* Calendar details section */
.mini-calendar-details {
  padding: 16px;
  border-top: 1px solid #e9ecef;
  max-height: 300px;
  overflow-y: auto;
  position: absolute;
  width: 100%;
  flex-shrink: 0;
  background-color: white;
  z-index: 1;
  animation: slideDown 0.3s ease-out forwards;
  transform-origin: top center;
  box-sizing: border-box;
}

.mini-calendar-details-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 16px 0;
  color: #333;
  text-align: center;
}

.mini-calendar-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: #555;
  border-bottom: 1px solid #eee;
  padding-bottom: 6px;
}

.mini-calendar-no-items {
  text-align: center;
  color: #888;
  font-style: italic;
  padding: 16px 0;
}

/* Events styles */
.mini-calendar-events {
  margin-bottom: 20px;
}

.mini-calendar-events-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mini-calendar-event-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background-color: #f8f9fa;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.mini-calendar-event-item:hover {
  background-color: #f0f0f0;
  transform: translateY(-2px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

/* Subject-specific styling */
.mini-calendar-event-item.subject-chinese {
  border-left: 3px solid var(--subject-chinese-color);
}

.mini-calendar-event-item.subject-english {
  border-left: 3px solid var(--subject-english-color);
}

.mini-calendar-event-item.subject-math {
  border-left: 3px solid var(--subject-math-color);
}

.mini-calendar-event-item.subject-general_studies {
  border-left: 3px solid var(--subject-general_studies-color);
}

/* Type-specific styling (fallback) */
.mini-calendar-event-item.homework:not([class*="subject-"]) {
  border-left: 3px solid var(--subject-english-color);
}

.mini-calendar-event-item.exam:not([class*="subject-"]) {
  border-left: 3px solid var(--dark-red);
}

.mini-calendar-event-item.dictation:not([class*="subject-"]) {
  border-left: 3px solid var(--bright-blue);
}

.schedule-item-icon {
  font-size: 1.2rem;
}

.schedule-item-icon.homework {
  color: var(--subject-english-color);
}

.schedule-item-icon.exam {
  color: var(--dark-red);
}

.schedule-item-icon.dictation {
  color: var(--bright-blue);
}

.mini-calendar-event-details {
  display: flex;
  flex-direction: column;
  flex: 1 1;
}

.mini-calendar-event-title {
  font-weight: 500;
  color: #333;
}

.mini-calendar-event-subject {
  font-size: 0.8rem;
  color: #6c757d;
}

.mini-calendar-event-chapter {
  font-size: 0.8rem;
  color: #6c757d;
}

/* Timetable styles */
.mini-calendar-timetable-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini-calendar-timetable-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  background-color: #f8f9fa;
  transition: background-color 0.2s;
  position: relative;
  overflow: hidden;
}

.mini-calendar-timetable-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: #ccc;
}

.mini-calendar-timetable-item:hover {
  background-color: #f0f0f0;
}

.mini-calendar-timetable-time {
  font-weight: 600;
  font-size: 0.85rem;
  color: #555;
  min-width: 60px;
}

.mini-calendar-timetable-subject {
  flex: 1 1;
  font-size: 0.9rem;
  color: #333;
  margin-left: 12px;
}

.calender-recommendation-badge {
  position: absolute;
  top: -20px; /* Move slightly outside vertically */
  right: -20px; /* Move slightly outside horizontally */
  z-index: 2;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: bold;
  color: white;
  text-transform: uppercase;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.calender-recommendation-badge.incomplete {
  background-color: var(--dark-red);
}

.calender-recommendation-badge.completed {
  background-color: var(--subject-chinese-color);
}

.calender-recommendation-content {
  position: relative; /* Needed for internal absolute positioning */
  display: flex;
  /* flex-direction: column; */
  gap: 8px;
  padding: 8px;
}

.calender-recommendation-header {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.calender-recommendation-item {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background-color: var(--yellow-white);
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-align: left;
  align-items: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  margin-bottom: 15px;
}

/* Subject-specific timetable styling */
.mini-calendar-timetable-item.subject-chinese::before {
  background-color: var(--subject-chinese-color);
}

.mini-calendar-timetable-item.subject-english::before {
  background-color: var(--subject-english-color);
}

.mini-calendar-timetable-item.subject-math::before {
  background-color: var(--subject-math-color);
}

.mini-calendar-timetable-item.subject-general_studies::before {
  background-color: var(--subject-general_studies-color);
}

.mini-calendar-timetable-item.subject-music::before {
  background-color: #5d9cec;
}

.mini-calendar-timetable-item.subject-physical_education::before {
  background-color: #fc6e51;
}

.mini-calendar-timetable-item.subject-visual_art::before {
  background-color: #ffce54;
}

.mini-calendar-timetable-item.subject-computer::before {
  background-color: #4fc1e9;
}

.mini-calendar-timetable-item.subject-mandarin::before {
  background-color: #ed5565;
}

.mini-calendar-timetable-item.subject-religion::before {
  background-color: #ac92ec;
}

.mini-calendar-timetable-item.subject-reading::before {
  background-color: #a0d468;
}

/* Animation for details popup */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .mini-calendar {
    max-width: 100%;
  }

  .mini-calendar-day {
    font-size: 0.8rem;
    height: 32px;
    width: 32px;
  }

  .mini-calendar-details {
    max-height: 250px;
  }

  .mini-calendar-days {
    min-height: 200px;
    grid-template-rows: repeat(6, minmax(32px, auto));
  }

  .mini-calendar-legend {
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 16px;
    gap: 4px;
  }

  .mini-calendar-report-button {
    font-size: 0.8rem;
    padding: 6px 12px;
  }
}

/* Calendar grid container */
.mini-calendar-grid {
  flex: 0 0 auto;
  height: auto;
  overflow: hidden;
}

/* Legend for event types */
.mini-calendar-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 10px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.mini-calendar-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #666;
  padding: 4px 8px;
  border-radius: 12px;
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s;
}

.mini-calendar-legend-item:hover {
  transform: translateY(-1px);
}

.mini-calendar-legend-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.mini-calendar-legend-indicator.homework {
  background-color: var(--subject-english-color);
}

.mini-calendar-legend-indicator.exam {
  background-color: var(--dark-red);
}

.mini-calendar-legend-indicator.dictation {
  background-color: var(--bright-blue);
}

/* Report button styles */
.mini-calendar-report-button-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.mini-calendar-report-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #00a651;
  background-color: var(--main-green, #00a651);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  width: auto;
  min-width: 140px;
}

.mini-calendar-report-button:hover {
  background-color: #006633;
  background-color: var(--dark-green, #006633);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.mini-calendar-report-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mini-calendar-report-button:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 166, 81, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mini-calendar-report-button:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.8;
}

.report-icon {
  font-size: 1rem;
  color: white;
}

.report-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.report-loading::after {
  content: "...";
  position: absolute;
  animation: ellipsis 1.5s infinite;
  width: 1.5em;
  text-align: left;
  overflow: hidden;
}

@keyframes ellipsis {
  0% {
    width: 0;
  }
  50% {
    width: 1.5em;
  }
  100% {
    width: 0;
  }
}

.waiting-text-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  text-align: center;
}

.waiting-text {
  color: #71c19a;
}

.two-domain-chart-container {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  gap: 20px;
}

.chart-wrapper {
  flex: 1 1;
  min-width: 0;
  height: 100%;
}

.statistic-analysis-container {
  height: 100%;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  overflow: hidden;
}

.statistic-analysis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  color: white;
  position: relative;
}

.statistic-analysis-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  flex: 1 1;
}

.refresh-data-button {
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: 15px;
  margin-right: 15px;
}

.refresh-data-button:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

.refresh-data-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.stats-summary {
  display: flex;
  gap: 20px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-label {
  font-size: 12px;
  opacity: 0.9;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
}

.scatter-chart-container {
  position: relative;
  width: 100%;
  height: 500px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  overflow: hidden;
  --dot-size: clamp(15px, max(3vw, 3vh), 30px);
}

/* Custom styles for larger scatter points */
.scatter-chart-container .recharts-scatter-dot {
  r: var(--dot-size) !important;
  transition: r 0.2s ease, opacity 0.2s ease;
}

.scatter-chart-container .recharts-scatter-dot:hover {
  r: calc(var(--dot-size) * 1.3) !important;
  opacity: 0.8;
}

/* Quadrant Labels */
.quadrant-labels {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 10;
}

.quadrant-label {
  position: absolute;
  font-weight: 700;
  font-size: 14px;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.85);
  padding: 8px 12px;
  border-radius: 6px;
  border: 2px solid currentColor;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.quadrant-label.top-left {
  transform: translateX(-50%) translateY(-50%);
}

.quadrant-label.top-right {
  transform: translateX(50%) translateY(-50%);
}

.quadrant-label.bottom-left {
  transform: translateX(-50%) translateY(50%);
}

.quadrant-label.bottom-right {
  transform: translateX(50%) translateY(50%);
}

/* Tooltip Styles */
.statistic-analysis-tooltip {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-width: 280px;
  font-size: 13px;
  z-index: 1000;
}

.tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e0e0e0;
}

.tooltip-header strong {
  color: #333;
  font-size: 14px;
}

.tooltip-id {
  color: #666;
  font-size: 12px;
}

.tooltip-content {
  margin-bottom: 8px;
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.tooltip-row span:first-child {
  color: #666;
  font-weight: 500;
}

.tooltip-row span:last-child {
  color: #333;
  font-weight: 600;
}

.tooltip-skills {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid #f0f0f0;
}

.tooltip-skills > div:first-child {
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 2px 8px;
  gap: 2px 8px;
  font-size: 11px;
}

.skills-grid span {
  color: #666;
}

.tooltip-footer {
  text-align: center;
  color: #999;
  font-size: 11px;
  font-style: italic;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #f0f0f0;
}

/* Quadrant Distribution */
.quadrant-distribution {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.quadrant-distribution h3 {
  margin: 0 0 15px 0;
  font-size: 18px;
  color: #333;
}

.distribution-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  grid-gap: 15px;
  gap: 15px;
}

.distribution-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

.distribution-color {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  /* Note: backgroundColor is set dynamically via inline style in TSX */
}

.distribution-info {
  flex: 1 1;
}

.distribution-label {
  font-weight: 600;
  font-size: 14px;
  color: #333;
  margin-bottom: 2px;
}

.distribution-count {
  font-size: 13px;
  color: #666;
}

/* Loading and Error States */
.statistic-analysis-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.statistic-analysis-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.error-message {
  color: #dc3545;
  font-size: 16px;
  margin-bottom: 15px;
}

.retry-button {
  padding: 10px 20px;
  background-color: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s;
}

.retry-button:hover {
  background-color: #5a6fd8;
}

/* Responsive Design */
@media (max-width: 768px) {
  .statistic-analysis-container {
    padding: 15px;
  }
  
  .statistic-analysis-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .stats-summary {
    flex-direction: column;
    gap: 10px;
  }
  
  .scatter-chart-container {
    height: 400px;
  }
  
  .quadrant-label {
    font-size: 12px;
    padding: 6px 8px;
  }
  
  .distribution-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .scatter-chart-container {
    height: 350px;
  }
  
  .quadrant-label {
    font-size: 10px;
    padding: 4px 6px;
  }
  
  .statistic-analysis-tooltip {
    max-width: 220px;
    font-size: 12px;
  }
}

/* Group Filter Styles */
.group-filter-container {
  background-color: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.group-filter-container h3 {
  margin: 0 0 15px 0;
  color: #2c3e50;
  font-size: 16px;
  font-weight: 600;
}

.group-filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.group-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background-color: #f8f9fa;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid #e9ecef;
  min-width: 120px;
}

.group-filter-option:hover {
  background-color: #e9ecef;
  border-color: #dee2e6;
}

.group-filter-option input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.group-filter-option span {
  font-size: 14px;
  color: #495057;
  font-weight: 500;
  flex: 1 1;
}

.group-filter-option input[type="checkbox"]:checked + span {
  color: #007bff;
  font-weight: 600;
}

/* New SA- prefixed classes for inline style replacements */

/* Header Controls */
.SA-header-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.SA-filter-button-container {
  position: relative;
  display: inline-block;
}

.SA-dropdown-container {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 1000;
  min-width: 200px;
  padding: 10px;
  height: auto;
}

.SA-dropdown-title {
  margin-bottom: 10px;
  font-weight: bold;
}

.SA-logic-selector {
  margin-bottom: 10px;
  padding: 8px;
  background-color: #f8f9fa;
  border-radius: 4px;
}

.SA-logic-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.SA-logic-label {
  font-size: 12px;
  color: #000000;
  font-weight: bold;
}

.SA-logic-text {
  font-size: 11px;
  color: #000000;
}

.SA-logic-text.SA-active {
  font-weight: bold;
}

.SA-toggle-switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 16px;
  cursor: pointer;
}

.SA-toggle-input {
  display: none;
}

.SA-toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transition: 0.3s;
  border-radius: 16px;
}

.SA-toggle-slider.SA-on {
  background-color: #007bff;
}

.SA-toggle-slider.SA-off {
  background-color: #ccc;
}

.SA-toggle-knob {
  position: absolute;
  content: '';
  height: 12px;
  width: 12px;
  bottom: 2px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.SA-toggle-knob.SA-on {
  left: 18px;
}

.SA-toggle-knob.SA-off {
  left: 2px;
}

.SA-filter-option {
  display: block;
  margin-bottom: 5px;
}

.SA-filter-checkbox {
  margin-right: 8px;
}

.SA-group-tag {
  color: white;
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 12px;
  margin-left: 8px;
}

/* SVG Scatter Plot Elements */
.SA-scatter-group {
  cursor: pointer;
}

.SA-connection-line {
  pointer-events: none;
}

.SA-student-name-text {
  font-size: 12px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.9);
  pointer-events: auto;
  cursor: pointer;
}

.SA-reference-line {
  z-index: 100;
}

.SA-reference-line-yellow {
  z-index: 99;
}

/* Reference Lines Toggle Controls - positioned in chart area */
.SA-reference-lines-toggle {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  min-width: 180px;
}

.SA-toggle-container {
  display: flex;
  flex-direction: column;
}

.SA-toggle-row {
  display: flex;
  flex-direction: row;
  gap: 16px;
  justify-content: space-between;
}

.SA-toggle-dot-group {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 75px;
}

.SA-toggle-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid;
  padding: 0;
  margin: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Red toggle dot styles */
.SA-toggle-dot.SA-red-on {
  background-color: #ff0000;
  border-color: #ff0000;
  box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.2);
}

.SA-toggle-dot.SA-red-off {
  background-color: transparent;
  border-color: #ff0000;
}

/* Yellow toggle dot styles */
.SA-toggle-dot.SA-yellow-on {
  background-color: #ffc107;
  border-color: #ffc107;
  box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.2);
}

.SA-toggle-dot.SA-yellow-off {
  background-color: transparent;
  border-color: #ffc107;
}

/* Hover effects */
.SA-toggle-dot:hover {
  transform: scale(1.1);
}

.SA-toggle-dot:active {
  transform: scale(0.95);
}

.SA-toggle-text {
  -webkit-user-select: none;
          user-select: none;
  font-weight: 500;
  font-size: 13px;
  color: #495057;
}

/* Student name labels on scatter plot */
.scatter-chart-container text,
.scatter-chart-container .recharts-text,
.scatter-chart-container .recharts-label-list text,
.scatter-chart-container tspan {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
  fill: #000000 !important;
  color: #000000 !important;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.9) !important;
}

/* Reference lines styling */
.scatter-chart-container .recharts-reference-line {
  z-index: 100 !important;
}

.scatter-chart-container .recharts-reference-line line {
  stroke-width: 1 !important;
}

/* Yellow reference lines - fixed thresholds */
.scatter-chart-container .SA-reference-line-yellow line {
  stroke-width: 2 !important;
  opacity: 0.8;
}

/* Group filter button and dropdown */
.group-filter-button {
  /* Use refresh-data-button styles */
}

.group-filter-dropdown {
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.group-filter-dropdown .group-filter-option {
  transition: background-color 0.15s ease;
}

.group-filter-dropdown .group-filter-option:hover {
  background-color: #f8f9fa;
}

@media (max-width: 768px) {
  .group-filter-options {
    flex-direction: column;
  }
  
  .group-filter-option {
    min-width: auto;
    width: 100%;
  }
  
  .group-filter-dropdown {
    right: auto !important;
    left: 0 !important;
    min-width: 250px;
  }
  
  .SA-reference-lines-toggle {
    bottom: 15px;
    right: 15px;
    padding: 8px 10px;
  }
  
  .SA-toggle-dot {
    width: 14px;
    height: 14px;
  }
  
  .SA-toggle-row {
    gap: 12px;
  }
  
  .SA-toggle-text {
    font-size: 11px;
  }
} 
.version-number{
    /* place at the right bottom of the page */
    position: fixed;
    bottom: 0;
    left: 0;
    padding: 5px;
    font-size: 0.7rem;
    color: #838383;

}
/* 
 * Proper font-face declarations for custom font naming and fallbacks
 * These declarations allow you to use the imported Google Fonts with custom names
 */
@font-face {
  font-family: "NotoSansHK-Chinese";
  /* Use the actual font family name from Google Fonts */
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: local("Noto Sans HK"), local("NotoSansHK");
  /* Chinese character ranges */
  unicode-range: U+3000-30FF, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FF00-FFEF;
}

@font-face {
  font-family: "Concert-One";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: local("Concert One"), local("ConcertOne");
  /* Latin character ranges */
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: local("Nunito"), local("Nunito-Regular");
}

@font-face {
  font-family: "System-Sans";
  src: local("-apple-system"), local("BlinkMacSystemFont"), local("Segoe UI"),
    local("Roboto"), local("Oxygen"), local("Ubuntu"), local("Cantarell"),
    local("Helvetica Neue"), local("sans-serif");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD; /* Latin character ranges */
}

body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}
html {
  margin: 0;
  padding: 0;
  height: 100dvh;
  width: 100dvw;
}
#root {
  height: 100%;
  margin: 0;
  padding: 0;
}
:root {
  --mint-green: #1fdb98;
  --bright-blue: #21b0e2;
  --light-blue: #1fdbd8;
  --bright-green: #49e377;
  --light-green: #39560d;
  --fade-blue: #6ddad9;
  --light-grey: #f8f9fc;
  --ice-white: #f5f4fa;
  --dark-grey: #888888;
  --brighter-green: #39e30a;
  --teal-green: #71c19a;
  --light-red: #f16b78;
  --dark-red: #e24e4e;
  --dark-purple: #7d507d;
  --dark-blue: #2268e2;
  --dark-blue-active: #164a8f;
  --dark-purple: #ce71e7;
  --dark-green-selected-hover: #22624c;
  --dark-green-active: #32896a;
  --dark-green-hover: #d5f4e7;
  --dark-orange: #efa628;

  --main-blue: #d7ecf9;
  --main-green: #048a81;
  --secondary-green: #9ddfca;
  --secondary-blue: #b0cfdc;
  --chat-blue: #85bad7;
  --main-grey: #aaaaaa;
  --yellow-white: #fffbf0;

  --exercise-reading-color: #defff4;
  --exercise-writing-color: #fffbf0;
  --exercise-speaking-color: #cdfaf8;
  --exercise-grammar-color: #efe2fe;
  --exercise-dictation-color: #e8f9d9;
  --exercise-assessment-color: #f7d8db;
  --exercise-vocab-color: #bdf3d3;

  --subject-chinese-color: #2fb68b;
  --subject-chinese-color-light: #5eddb5;
  --subject-chinese-color-background: rgba(94, 221, 181, 0.45);

  --subject-english-color: #eba378;
  --subject-english-color-light: #f0bfa1;
  --subject-english-color-background: rgba(240, 191, 161, 0.45);

  --subject-math-color: #b274f0;
  --subject-math-color-light: #d4b0f7;
  --subject-math-color-background: rgba(212, 176, 247, 0.45);

  --subject-general_studies-color: #e2dd44;
  --subject-general_studies-color-light: #efeb77;
  --subject-general_studies-color-background: rgba(239, 235, 119, 0.45);

  --story-color: #c549d5;
  --story-color-light: #e3a9f0;
  --story-color-background: rgba(227, 169, 240, 0.45);

  --toastify-color-progress-light: #71c19a !important;

  --rs-btn-primary-bg: var(--dark-green-active) !important;
  --rs-btn-link-text: var(--dark-green-active) !important;
  --rs-bg-active: var(--dark-green-active) !important;
  --rs-state-hover-bg: var(--dark-green-hover) !important;
  --rs-calendar-cell-selected-hover-bg: var(
    --dark-green-selected-hover
  ) !important;
  --rs-input-focus-border: var(--dark-green-active) !important;
}

body {
  background-color: #d7ecf9;
  background-color: var(--main-blue);
  /* Improved font stack with proper fallbacks */
  font-family: "Nunito", "Noto Sans HK", sans-serif;
  scrollbar-color: #048a81 transparent;
  scrollbar-color: var(--main-green) transparent;
}

button {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  background-color: #007bff;
  color: #000000;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
  /* Improved font stack with proper fallbacks */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Helvetica Neue", "Nunito", "Noto Sans HK", sans-serif;
}

.App {
  text-align: center;
}

.App-logo {
  height: 40vmin;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .App-logo {
    animation: App-logo-spin infinite 20s linear;
  }
}

.App-header {
  background-color: #282c34;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: calc(10px + 2vmin);
  color: white;
  /* Improved font stack with proper fallbacks */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Helvetica Neue", "Nunito", "Noto Sans HK", sans-serif;
}

.App-link {
  color: #61dafb;
}

@keyframes App-logo-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.head {
  display: flex;
  justify-content: space-between;
  align-items: left;
  width: 100%;
  /* Improved font stack with proper fallbacks */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Helvetica Neue", "Nunito", "Noto Sans HK", sans-serif;
}

button {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  background-color: #007bff;
  color: #000000;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
  /* Improved font stack with proper fallbacks */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Helvetica Neue", "Nunito", "Noto Sans HK", sans-serif;
}

/* iPad-specific styles */
html.ipad-device {
  /* Prevent unwanted zooming and scaling */
  touch-action: manipulation;
}

html.ipad-device body {
  /* Ensure proper width */
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%; /* Prevent text size adjustment */
}

/* Fix chart touch interaction issues on iPad */
html.ipad-device .radar-chart,
html.ipad-device .schedule-table,
html.ipad-device .ag-chart-wrapper,
html.ipad-device .recharts-wrapper {
  pointer-events: none !important;
}

/* Fix for any potential scrolling issues on iPad */
html.ipad-device .student-app-layout {
  display: grid;
  grid-template-columns: 1fr 350px;
  grid-gap: 30px;
  gap: 30px;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

/* Ensure proper touch behavior on iPad */
html.ipad-device button,
html.ipad-device [role="button"],
html.ipad-device input,
html.ipad-device select {
  font-size: 16px; /* Prevent zoom on focus */
  touch-action: manipulation;
}

/* Fix for any potential scrolling issues on iPad */
@supports (-webkit-touch-callout: none) {
  /* iOS specific styles */
  body {
    -webkit-overflow-scrolling: touch;
  }

  .student-app-layout {
    width: 100%;
    max-width: 100vw;
  }
}

