/* 檔案路徑：public/css/class.css  */

/* 1. 主區塊與標題置中設定 */
.courses-main-section {
  padding: 60px 0 80px;
  background-color: #fbfdfc;
}

.text-center {
  text-align: center;
}

.section-header {
  margin-bottom: 40px;
}

.section-tag {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent, #52b788);
  letter-spacing: 2px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--dark, #1e293b);
  margin-bottom: 12px;
  line-height: 1.3;
}

.section-sub {
  color: #64748b;
  font-size: 1.05rem;
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.7;
}

/* 2. 工具列與企業內訓按鈕 */
.course-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 30px;
}

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

.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-btn {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  border-color: #2d6a4f;
  color: #1b4332;
}

.tab-btn.active {
  background: #1b4332;
  color: #ffffff;
  border-color: #1b4332;
}

.search-box input {
  padding: 8px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 50px;
  font-size: 0.9rem;
  outline: none;
  width: 220px;
  background: #ffffff;
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: #2d6a4f;
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.12);
}

/* 企業客製內訓按鈕 */
.btn-custom-training {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #faedcd;
  color: #7f4f24;
  border: 1px solid #d4a373;
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-custom-training:hover {
  background-color: #d4a373;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(212, 163, 115, 0.3);
}

/* 3. 簡約互動抽屜 (Interactive Course Accordion) */
.course-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 50px;
}

.drawer-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.drawer-item:hover {
  border-color: #cbd5e1;
}

.drawer-item.open {
  border-color: #1b4332;
  box-shadow: 0 4px 20px rgba(27, 67, 50, 0.06);
}

/* 標頭樣式 */
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  cursor: pointer;
  user-select: none;
  background: #ffffff;
  transition: background-color 0.2s;
}

.drawer-header:hover {
  background-color: #f8fafc;
}

.header-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.category-pill {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1b4332;
  background: #eafaf1;
  padding: 3px 10px;
  border-radius: 4px;
  white-space: nowrap;
}

.course-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.4;
}

.header-side {
  display: flex;
  align-items: center;
  gap: 20px;
}

.course-meta-text {
  font-size: 0.88rem;
  color: #64748b;
  white-space: nowrap;
}

/* 展開切換箭頭 */
.expand-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.expand-icon::before {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(45deg);
  transition: transform 0.25s ease;
  margin-top: -3px;
}

.drawer-item.open .expand-icon::before {
  transform: rotate(-135deg);
  margin-top: 3px;
  border-color: #1b4332;
}

/* 抽屜內層 (可折疊面板) */
.drawer-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #fdfefe;
}

.drawer-item.open .drawer-panel {
  grid-template-rows: 1fr;
  border-top: 1px solid #edf2f0;
}

.panel-inner {
  overflow: hidden;
  padding: 0 24px;
  transition: padding 0.3s ease;
}

.drawer-item.open .panel-inner {
  padding: 24px;
}

/* 左右並排容器 */
.panel-content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
  align-items: stretch;
}

.panel-desc-side {
  display: flex;
  flex-direction: column;
}

.panel-desc {
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.7;
  margin: 0;
}

.curriculum-highlights {
  display: flex;
  flex-direction: column;
}

.highlight-box {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 6px;
  padding: 16px;
  height: 100%;
  box-sizing: border-box;
}

.highlight-box strong {
  display: block;
  font-size: 0.88rem;
  color: #1e293b;
  margin-bottom: 8px;
}

.highlight-box p {
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.6;
  margin: 0;
}

/* 抽屜底部行動條 */
.drawer-cta-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-top: 16px;
  border-top: 1px dashed #e2e8f0;
}

.status-indicator {
  font-size: 0.85rem;
  font-weight: 600;
  color: #2d6a4f;
}

.btn-enroll {
  background-color: #1b4332;
  color: #ffffff;
  padding: 9px 20px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.2s;
  display: inline-block;
  text-align: center;
}

.btn-enroll:hover {
  background-color: #2d6a4f;
}

/* 灰白停用狀態按鈕 */
.btn-enroll.disabled {
  background-color: #e2e8f0 !important;
  color: #94a3b8 !important;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

/* 4. 響應式斷點 */
@media (max-width: 900px) {
  .course-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .toolbar-left,
  .toolbar-right {
    width: 100%;
  }
  .search-box {
    flex: 1;
  }
  .search-box input {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .section-title {
    font-size: 1.8rem;
  }

  .drawer-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
  }

  .header-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .header-side {
    width: 100%;
    justify-content: space-between;
    border-top: 1px solid #f1f5f9;
    padding-top: 10px;
    flex-wrap: wrap;
    gap: 8px;
  }

  /* 手機版改為上下排列 */
  .panel-content-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .drawer-cta-row {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    text-align: center;
  }
}