/* ==========================================================================
   学生排课工作台 - 高颜值 UI 样式 & 移动端/桌面端自适应适配
   ========================================================================== */

/* 1. 基础布局与极简滚动条 */
.custom-scrollbar::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(241, 245, 249, 0.4);
  border-radius: 99px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(203, 213, 225, 0.8);
  border-radius: 99px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 1);
}

/* 侧边栏折叠自适应动画 */
aside.sidebar-collapsed {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0;
  pointer-events: none;
  border-right: none !important;
}

/* 移动端 (手机屏幕 < 768px) 学员侧边栏 Overlay 抽屉效果 */
@media (max-width: 767px) {
  #sidebarStudent:not(.sidebar-collapsed) {
    position: fixed !important;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 40 !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35) !important;
    width: 280px !important;
  }
}

/* 屏幕较小时的日历保底宽与响应式自适应 */
#calendarHeaderDays,
#calendarGridColumns {
  min-width: 560px;
}

/* 2. 时间刻度轴对齐与样式 */
.time-slot-label {
  height: 64px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-top: -8px;
  color: #94a3b8;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 600;
}

/* 3. 7天日历列格高度与放置线 */
.calendar-day-column {
  position: relative;
  height: 832px; /* 13 个小时 * 64px = 832px */
  background-size: 100% 64px;
  background-image: linear-gradient(to bottom, transparent 63px, rgba(226, 232, 240, 0.5) 64px);
  transition: background-color 0.15s ease;
}

/* 半点虚线辅助线 */
.calendar-day-column::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  background-size: 100% 32px;
  background-image: linear-gradient(to bottom, transparent 31px, rgba(241, 245, 249, 0.7) 32px);
}

/* 4. 拖拽高亮放置目标区 (Drag Over Zone) */
.calendar-day-column.drag-over {
  background-color: rgba(254, 243, 199, 0.3) !important;
}

.drag-preview-slot {
  position: absolute;
  left: 3px;
  right: 3px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.25), rgba(245, 158, 11, 0.35));
  border: 2px dashed #f59e0b;
  border-radius: 12px;
  pointer-events: none;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #92400e;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 12px -2px rgba(245, 158, 11, 0.25);
  transition: all 0.05s ease-out;
}

/* 5. 学生可拖拽卡片样式 (Draggable Student Card) */
.student-card {
  cursor: grab;
  user-select: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}
.student-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -3px rgba(245, 158, 11, 0.12), 0 2px 6px -2px rgba(0, 0, 0, 0.04);
  border-color: #fcd34d;
}
.student-card:active {
  cursor: grabbing;
  transform: scale(0.98);
}
.student-card.dragging {
  opacity: 0.35;
  border: 2px dashed #f59e0b;
  box-shadow: none;
}

/* 6. 日历卡片 (Schedule Event Cards) */
.schedule-event-card {
  position: absolute;
  border-radius: 12px;
  padding: 0;
  font-size: 11px;
  line-height: 1.25;
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease, z-index 0.1s ease, min-height 0.15s ease;
  user-select: none;
  z-index: 10;
  overflow: hidden;
  border-left-width: 4px;
}

.schedule-event-card:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.22), 0 4px 10px -2px rgba(0, 0, 0, 0.1);
  z-index: 50 !important;
  min-height: max-content !important;
  overflow: visible !important;
}

/* 颜色主题高级配色 */
.event-amber {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #fde68a;
  border-left-color: #f59e0b;
  color: #78350f;
}
.event-emerald {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: #a7f3d0;
  border-left-color: #10b981;
  color: #064e3b;
}
.event-sky {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-color: #bae6fd;
  border-left-color: #0284c7;
  color: #0c4a6e;
}
.event-purple {
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  border-color: #e9d5ff;
  border-left-color: #9333ea;
  color: #581c87;
}
.event-rose {
  background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
  border-color: #fecdd3;
  border-left-color: #f43f5e;
  color: #881337;
}

/* 时间冲突样式 (Conflict Warning) */
.schedule-event-card.has-conflict {
  border-right: 3px solid #ef4444;
  animation: pulse-conflict 2.5s infinite;
}

@keyframes pulse-conflict {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.08); }
}

/* 7. Modal 弹窗显示动画 */
.modal-box {
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
}

#modalSchedule:not(.hidden) .modal-box,
#modalStudent:not(.hidden) .modal-box,
#modalTeacher:not(.hidden) .modal-box,
#modalImport:not(.hidden) .modal-box {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* 8. 今天日期高亮 */
.today-column-header {
  background: linear-gradient(to bottom, #fffbeb, #fef3c7);
  border-bottom: 3px solid #f59e0b;
}
.today-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  border-radius: 9999px;
  padding: 1px 8px;
  box-shadow: 0 2px 6px -1px rgba(245, 158, 11, 0.4);
}
