/**
 * 手機版課程選擇器樣式
 * 提供底部彈出面板與課程卡片設計
 */

/* 手機版課程選擇 Modal 背景遮罩 */
#mobileCourseModal {
  transition: opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

#mobileCourseModal.active {
  opacity: 1;
  pointer-events: auto;
}

/* 手機版課程選擇面板 */
#mobileCoursePanel {
  max-height: 70vh;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobileCourseModal.active #mobileCoursePanel {
  transform: translateY(0) !important;
}

/* 課程卡片樣式 */
.mobile-course-card {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-radius: 0.75rem;
  border: 2px solid transparent;
  background-color: #f9fafb;
  cursor: pointer;
  transition: all 0.2s ease;
  gap: 0.75rem;
}

.mobile-course-card:hover {
  background-color: #eff6ff;
  border-color: #3b82f6;
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.mobile-course-card.active {
  background-color: #dbeafe;
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.mobile-course-card .course-icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mobile-course-card .course-info {
  flex: 1;
  min-width: 0;
}

.mobile-course-card .course-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.mobile-course-card .course-description {
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.mobile-course-card .course-check {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  color: #2563eb;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.mobile-course-card.active .course-check {
  opacity: 1;
}

/* 暗黑模式樣式 */
html.dark .mobile-course-card {
  background-color: #1f2937;
  border-color: transparent;
}

html.dark .mobile-course-card:hover {
  background-color: #374151;
  border-color: #60a5fa;
}

html.dark .mobile-course-card.active {
  background-color: #1e3a8a;
  border-color: #3b82f6;
}

html.dark .mobile-course-card .course-icon {
  background: #111827;
}

html.dark .mobile-course-card .course-title {
  color: #f9fafb;
}

html.dark .mobile-course-card .course-description {
  color: #d1d5db;
}

html.dark .mobile-course-card.active .course-title {
  color: #ffffff;
}

html.dark .mobile-course-card.active .course-description {
  color: #e5e7eb;
}

html.dark .mobile-course-card .course-check {
  color: #93c5fd;
}

/* 關閉按鈕樣式強化 */
#closeMobileCourse {
  transition: all 0.2s ease;
}

#closeMobileCourse:hover {
  transform: rotate(90deg);
}

/* 滾動條美化 */
#mobileCourseList::-webkit-scrollbar {
  width: 6px;
}

#mobileCourseList::-webkit-scrollbar-track {
  background: transparent;
}

#mobileCourseList::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

html.dark #mobileCourseList::-webkit-scrollbar-thumb {
  background: #4b5563;
}

/* 手機版課程按鈕指示器（當前課程標記） */
#mobileCourseToggle {
  position: relative;
}

#mobileCourseToggle.has-active::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: #3b82f6;
  border-radius: 50%;
  border: 2px solid white;
  animation: pulse-dot 2s infinite;
}

html.dark #mobileCourseToggle.has-active::after {
  border-color: #1f2937;
}

/* 暗黑模式下增強圖示亮度 */
html.dark #mobileCourseToggle i.fa-book,
html.dark #mobileMenuToggle i.fa-bars {
  color: #f3f4f6 !important; /* gray-100 更亮的灰白色 */
}

/* 書本圖示位置調整 */
#mobileCourseToggle i.fa-book {
  position: relative;
  top: -3px;
}

@keyframes pulse-dot {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}
