.hero-section {
  position: relative;
  height: 60vh;
  min-height: 360px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
}

.hero-video {
  position: absolute;
  top: -5%;
  left: -5%;
  width: 110%;
  height: 115%;
  object-fit: cover;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 0 2rem;
  margin-top: 8rem;
}

.hero-title {
  font-size: 3.5rem;
  margin-bottom: 1.2rem;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.8), 0 2px 4px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(0, 0, 0, 0.5);
  font-weight: 900;
  opacity: 0;
  transform: translateY(50px) scale(0.9);
  animation: magicalFadeIn 2s ease-out 0.5s forwards;
  letter-spacing: 1.5px;
  color: #ffffff;
}

.hero-subtitle {
  font-size: 1.4rem;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.8), 0 1px 4px rgba(0, 0, 0, 0.6),
    0 0 15px rgba(0, 0, 0, 0.5);
  line-height: 1.6;
  opacity: 0;
  transform: translateY(30px);
  animation: magicalFadeIn 2s ease-out 1s forwards;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: #ffffff;
}

@keyframes magicalFadeIn {
  0% {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
    filter: blur(10px);
  }
  50% {
    opacity: 0.7;
    transform: translateY(20px) scale(0.95);
    filter: blur(5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* 魔法粒子效果 */
.hero-content::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 1px,
    transparent 1px
  );
  background-size: 100px 100px;
  animation: magicalSparkle 8s linear infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes magicalSparkle {
  0% {
    transform: rotate(0deg) scale(1);
    opacity: 0;
  }
  25% {
    opacity: 0.3;
  }
  75% {
    opacity: 0.3;
  }
  100% {
    transform: rotate(360deg) scale(1.1);
    opacity: 0;
  }
}

@media (max-width: 768px) {
  .hero-section {
    height: 50vh;
    min-height: 300px;
  }

  .hero-title {
    font-size: 2.5rem;
    letter-spacing: 1px;
  }

  .hero-subtitle {
    font-size: 1.4rem;
    letter-spacing: 0.5px;
  }

  .hero-content {
    padding: 0 1rem;
  }

  .hero-content::before {
    background-size: 50px 50px;
    animation-duration: 6s;
  }
}

/* Theme Categories Styles */
.theme-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.theme-card {
  background: white;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  cursor: pointer;
  border: 1px solid var(--border-color);
}

.theme-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.theme-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.theme-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.theme-desc {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.theme-stats {
  color: var(--primary-color);
  font-weight: 500;
  font-size: 0.9rem;
}

/* Activities Styles */
.activities-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.activity-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  cursor: pointer;
}

.activity-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.activity-banner {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: white;
  position: relative;
  overflow: hidden;
}

.activity-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.activity-content {
  padding: 1.5rem;
}

.activity-date {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.activity-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-dark);
}

.activity-desc {
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.activity-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.3s ease;
  width: 100%;
}

.activity-btn:hover {
  background: #1565c0;
}

.no-activities {
  text-align: center;
  color: var(--text-light);
  padding: 3rem;
  font-size: 1.1rem;
  grid-column: 1 / -1;
}

.error {
  text-align: center;
  color: #d32f2f;
  padding: 2rem;
  background: #ffebee;
  border-radius: 8px;
  grid-column: 1 / -1;
}

/* Container with Yellow Background */
.content-section:has(.recommendation-carousel-container) .container {
  background: linear-gradient(135deg, #ffd700 0%, #fff147 100%);
  border-radius: 30px;
  margin-bottom: 4rem;
  padding: 3rem 2rem 4rem 2rem;
  box-shadow: 0 15px 50px rgba(255, 215, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.content-section:has(.recommendation-carousel-container) .container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
      circle at 20% 30%,
      rgba(255, 255, 255, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 70%,
      rgba(255, 255, 255, 0.08) 0%,
      transparent 50%
    );
  pointer-events: none;
}

.content-section:has(.recommendation-carousel-container) h2 {
  margin-bottom: 2rem;
  text-align: center;
  position: relative;
  z-index: 2;
}

/* 新的推薦佈局 - 左右分欄 */
.recommendation-layout {
  display: flex;
  gap: 2rem;
  align-items: stretch;
}

.recommendation-main {
  flex: 2;
  min-height: 500px;
}

.recommendation-sidebar {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Recommendation Showcase Styles - 單一容器顯示 */
.recommendation-carousel-container {
  position: relative;
  margin: 0;
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  min-height: 500px;
  width: 100%;
}

.recommendation-carousel-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.recommendation-showcase {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.recommendation-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 450px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.6s ease;
  transform: translateX(50px);
}

.recommendation-item.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.recommendation-item.prev {
  transform: translateX(-50px);
}

.content-card {
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.content-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.content-card .card-image {
  width: 100%;
  height: 100%;
  position: relative;
}

.content-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content-card .card-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.1) 0%,
    rgba(0, 0, 0, 0.3) 40%,
    rgba(0, 0, 0, 0.8) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
  color: white;
}

.content-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.content-card .content-type {
  background: linear-gradient(135deg, #ffa726, #ff9800);
  color: white;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 3px 12px rgba(255, 167, 38, 0.4);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.content-card .crown-icon {
  background: linear-gradient(135deg, #ffd700, #ffb347);
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(255, 215, 0, 0.4);
  font-size: 1.2rem;
}

.content-card .card-footer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.content-card .card-title {
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
  line-height: 1.2;
}

.content-card .card-author {
  font-size: 1rem;
  opacity: 0.9;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  margin-bottom: 1rem;
}

.content-card .card-stats {
  display: flex;
  align-items: center;
  gap: 2rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.content-card .stat-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  backdrop-filter: blur(5px);
}

.content-card .stat-icon {
  font-size: 1.1rem;
}

/* 點點指示器 */
.recommendation-indicators {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 10;
}

.recommendation-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
}

.recommendation-indicator.active {
  background: white;
  transform: scale(1.3);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.recommendation-indicator:hover {
  background: rgba(255, 255, 255, 0.7);
  transform: scale(1.1);
}

/* 右側書籍卡片樣式 - 重新設計 */
.side-book-card {
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  height: 200px;
  position: relative;
}

.side-book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.side-book-image-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.side-book-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.side-book-card:hover .side-book-image {
  transform: scale(1.05);
}

.side-book-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.1) 0%,
    rgba(0, 0, 0, 0.3) 50%,
    rgba(0, 0, 0, 0.8) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
}

.side-book-badge {
  align-self: flex-start;
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(238, 90, 36, 0.3);
}

.side-book-info {
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.side-book-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.side-book-author {
  font-size: 0.9rem;
  margin-bottom: 0.8rem;
  opacity: 0.9;
}

.side-book-stats {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.side-book-stats .stat-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.side-book-stats .stat-icon {
  font-size: 0.9rem;
}

/* Loading and Error States */
#dynamicRecommendations .loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-light);
  font-size: 1.1rem;
}

#dynamicRecommendations .error {
  text-align: center;
  color: #d32f2f;
  padding: 3rem;
  background: #ffebee;
  border-radius: 12px;
  font-size: 1.1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .theme-categories,
  .activities-container {
    grid-template-columns: 1fr;
  }

  .theme-card {
    padding: 1.5rem;
  }

  .activity-banner {
    height: 140px;
    font-size: 2.5rem;
  }

  /* 手機版佈局 */
  .recommendation-layout {
    flex-direction: column;
    gap: 1.5rem;
  }

  .recommendation-main {
    min-height: 400px;
  }

  .recommendation-sidebar {
    order: -1; /* 在手機版將右側內容移到上方 */
  }

  /* 手機版單一容器樣式 */
  .recommendation-carousel-container {
    margin: 0;
    padding: 0;
    min-height: 400px;
  }

  /* 手機版書籍卡片 */
  .side-book-card {
    height: 150px;
  }

  .side-book-overlay {
    padding: 0.8rem;
  }

  .side-book-badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
  }

  .side-book-title {
    font-size: 1rem;
  }

  .side-book-author {
    font-size: 0.8rem;
    margin-bottom: 0.6rem;
  }

  .side-book-stats .stat-item {
    font-size: 0.7rem;
  }

  .side-book-stats .stat-icon {
    font-size: 0.8rem;
  }

  .recommendation-item {
    height: 320px;
  }

  .content-card .card-content {
    padding: 1.5rem;
  }

  .content-card .card-title {
    font-size: 1.4rem;
  }

  .content-card .card-author {
    font-size: 0.9rem;
  }

  .content-card .card-stats {
    gap: 1rem;
    font-size: 0.85rem;
  }

  .content-card .stat-item {
    padding: 0.4rem 0.8rem;
  }

  .recommendation-indicators {
    bottom: 15px;
    gap: 10px;
  }

  .recommendation-indicator {
    width: 10px;
    height: 10px;
  }
}
