/* 課程表專用樣式 */

/* 課程表容器 */
.schedule-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-bottom: 20px;
}

/* 課程表標題已併入 .schedule-table-unified thead（見 panes.css），勿再用獨立 Grid 表頭 */

/* 課程表主體 */
.schedule-body {
  max-height: 600px;
  overflow-y: auto;
}

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

.schedule-body th,
.schedule-body td {
  border: 1px solid #e9ecef;
  padding: 12px 8px;
  text-align: left;
  vertical-align: top;
}

.schedule-body th {
  background: #f8f9fa;
  font-weight: 600;
  color: #495057;
  position: sticky;
  top: 0;
  z-index: 10;
}

/* 時段列樣式 */
.schedule-body .time-slot {
  font-weight: 600;
  color: #495057;
  font-size: 13px;
  background: #f8f9fa;
  width: 80px;
}

/* 週末樣式 */
.schedule-body .weekend {
  background: #fff8e1;
}

/* 課程項目樣式 */
.class-item {
  padding: 8px;
  margin: 2px 0;
  border-left: 4px solid var(--sw-primary);
  background: #e3f2fd;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.class-item:hover {
  transform: scale(1.02);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.class-item.sen {
  border-left-color: #ff9800;
  background: #fff3cd;
}

/* 學生信息樣式 */
.student-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.student-name {
  color: #333;
  font-size: 13px;
  font-weight: 600;
}

.sen-badge {
  background: #ff9800;
  color: white;
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 3px;
  margin-left: 8px;
}

.class-details {
  color: #666;
  font-size: 11px;
  margin-bottom: 2px;
}

.class-details.location {
  margin-bottom: 2px;
}

.class-details.coach {
  margin-bottom: 2px;
}

.class-details.phone {
  font-size: 10px;
  color: #888;
}

/* 控制面板樣式（淺色見 main.css .sw-light-toolbar） */
.schedule-controls {
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.schedule-controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 15px;
  margin-bottom: 15px;
}

.control-group {
  display: flex;
  flex-direction: column;
}

.control-group label {
  color: var(--sw-text-on-panel);
  font-weight: 600;
  margin-bottom: 5px;
  display: block;
  font-size: 14px;
}

.control-group select {
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 14px;
}

.schedule-options {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.checkbox-group label {
  color: white;
  font-weight: 600;
  font-size: 14px;
  margin: 0;
}

/* 統計卡片樣式 */
.schedule-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.stat-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-card h3 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.stat-card .val {
  font-size: 28px;
  font-weight: 700;
  color: #333;
}

/* 快速操作面板 */
.schedule-actions {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.action-btn {
  flex: 1;
  min-width: 150px;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.action-btn.primary {
  background: #17a2b8;
  color: white;
}

.action-btn.danger {
  background: #dc3545;
  color: white;
}

.action-btn.info {
  background: #6f42c1;
  color: white;
}

/* 空狀態樣式 */
.empty-schedule {
  text-align: center;
  color: #999;
  padding: 40px 20px;
  background: #f8f9fa;
}

.empty-schedule .empty-icon {
  font-size: 48px;
  margin-bottom: 15px;
  opacity: 0.5;
}

.empty-schedule .empty-text {
  font-size: 16px;
  margin-bottom: 10px;
}

.empty-schedule .empty-hint {
  font-size: 14px;
  color: #666;
}

/* 響應式設計 */
@media (max-width: 768px) {
  .schedule-controls-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .schedule-options {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .schedule-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .schedule-actions {
    flex-direction: column;
    gap: 10px;
  }
  
  .action-btn {
    min-width: auto;
  }
  
  .schedule-table-unified {
    min-width: 560px;
  }

  col.schedule-col-time {
    width: 72px !important;
  }
  
  .class-item {
    padding: 6px;
    margin: 1px 0;
    font-size: 11px;
  }
  
  .student-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
}

@media (max-width: 480px) {
  .schedule-stats {
    grid-template-columns: 1fr;
  }
  
  .schedule-table-unified {
    min-width: 480px;
    font-size: 12px;
  }

  col.schedule-col-time {
    width: 64px !important;
  }
  
  .class-item {
    padding: 4px;
    font-size: 10px;
  }
  
  .student-name {
    font-size: 12px;
  }
  
  .class-details {
    font-size: 10px;
  }
}

/* 打印樣式 */
@media print {
  .schedule-controls,
  .schedule-stats,
  .schedule-actions {
    display: none !important;
  }
  
  .schedule-container {
    box-shadow: none;
    border: 1px solid #ddd;
  }
  
  .schedule-body {
    max-height: none;
    overflow: visible;
  }
  
  .class-item {
    break-inside: avoid;
  }
  
  .empty-schedule {
    display: none;
  }
}

/* 動畫效果 */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.schedule-container {
  animation: slideIn 0.5s ease-out;
}

/* 工具提示樣式 */
.tooltip {
  position: absolute;
  background: #333;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tooltip.show {
  opacity: 1;
}

/* 加載動畫 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-radius: 50%;
  border-top-color: var(--sw-primary);
  animation: spin 1s linear infinite;
}

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