html {
  scroll-behavior: smooth;
}

.app-container {
  padding-top: 70px;
}

/* 衛教資料頁面樣式 */
.education-material {
  min-height: 100vh;
  background: #f5f5f5;
  padding: 40px 0;
}

.education-material-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.education-material-content {
  max-width: 1000px;
  margin: 0 auto;
}

/* 標題區域 */
.section-title {
  text-align: center;
  margin-bottom: 30px;
}

.section-title img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.section-subtitle {
  text-align: center;
  font-size: 16px;
  line-height: 1.6;
  color: #666;
  margin-bottom: 40px;
}

.section-subtitle a {
  color: #007bff;
  text-decoration: none;
}

.section-subtitle a:hover {
  text-decoration: underline;
}

.section-divider {
  width: 80%;
  height: 2px;
  background: linear-gradient(to right, transparent, #ddd, transparent);
  margin: 60px auto;
}

/* 響應式顯示控制 */
.pc-view {
  display: block !important;
}

.mobile-view {
  display: none !important;
}

/* 統一材料卡片佈局 */
.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}
.materials-grid.video-grid {
  grid-template-columns: 1fr;
}

/* 基礎材料卡片樣式 */
.material-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.material-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* 卡片標題 */
.material-card-header {
  background: #6c757d;
  color: white;
  padding: 15px 20px;
  text-align: center;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.material-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: bold;
  line-height: 1.3;
  text-align: center;
}

/* 卡片內容區域 */
.material-card-content {
  padding: 20px;
}

/* 數位和紙本素材的圖片區域 */
.material-image-container {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f8f9fa;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.material-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 按鈕區域 */
.material-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.material-btn {
  width: 80px;
  height: 40px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
  transition: transform 0.2s ease;
  border-radius: 4px;
  flex-shrink: 0;
}

.material-btn:hover {
  transform: scale(1.05);
}

.btn-preview {
  background-image: url("/images/friendlyclinic/dm_popout/btn-preview.png");
}

.btn-download {
  background-image: url("/images/friendlyclinic/dm_popout/btn-download.png");
}

.btn-line {
  background-image: url("/images/friendlyclinic/dm_popout/btn-line.png");
}

/* 影音素材特殊樣式 */
.video-material-card .material-card-content {
  padding: 0;
}

/* 單一影片樣式 */
.single-video-container {
  position: relative;
  width: 50%;
  margin-inline: auto;
  margin-block: 1rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.single-video-thumbnail {
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  transition: transform 0.2s ease;
}

.single-video-container:hover .video-play-button {
  transform: translate(-50%, -50%) scale(1.1);
}

.single-video-title {
  padding: 15px 20px;
  text-align: center;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.single-video-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: bold;
  color: #333;
  line-height: 1.3;
  text-align: center;
}

/* 系列影片樣式 */
.video-series-container {
  padding: 20px;
}

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

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

.video-item-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  margin-bottom: 8px;
}

.video-item-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-item-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  transition: transform 0.2s ease;
  width: 40px;
  height: 28px;
}

.video-item-thumbnail:hover .video-item-play-button {
  transform: translate(-50%, -50%) scale(1.1);
}

.video-item-title {
  font-size: 12px;
  color: #333;
  line-height: 1.3;
  margin: 0;
  font-weight: 500;
}

/* 響應式設計 */
@media (max-width: 1024px) {
  .materials-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .video-series-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .pc-view {
    display: none !important;
  }

  .mobile-view {
    display: block !important;
  }

  .education-material {
    padding: 20px 0;
  }

  .education-material-container {
    padding: 0 15px;
  }

  .materials-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .material-card-header {
    padding: 12px 15px;
    min-height: 50px;
  }

  .material-card-title {
    font-size: 15px;
  }

  .material-card-content {
    padding: 15px;
  }

  .material-actions {
    gap: 8px;
  }

  .material-btn {
    width: 75px;
    height: 38px;
  }

  .section-subtitle {
    font-size: 14px;
    padding: 0 10px;
  }

  .video-series-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .single-video-container {
    width: calc(100% - 40px);
    margin-block: 20px;
  }

  .video-item-play-button {
    width: 35px;
    height: 24px;
  }
}

@media (max-width: 480px) {
  .education-material-container {
    padding: 0 10px;
  }

  .material-btn {
    width: 70px;
    height: 35px;
  }

  .section-subtitle {
    font-size: 13px;
  }

  .video-series-container {
    padding: 15px;
  }
}

/* 載入狀態移除 */
.material-card {
  opacity: 1;
  transform: none;
}
