/**
 * ailhj-category-scroll.css - 分类弹幕滚动组件样式
 * 多行分类标签从右向左循环滚动
 */

/* ========== 组件容器 ========== */
.widget_ailhj_widget_category_scroll {
  margin-bottom: 40px;
}

.ailhj-category-scroll-wrapper {
  width: 100%;
}

/* ========== 头部区域（复用 post-slider 样式） ========== */
.ailhj-scroll-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 20px;
}

.ailhj-scroll-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.ailhj-scroll-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--main-color);
  margin: 0;
  white-space: nowrap;
}

/* 标签样式 */
.ailhj-scroll-tags {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.ailhj-scroll-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  border-radius: 20px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ailhj-scroll-tag:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(238, 90, 36, 0.3);
  color: #fff;
}

.ailhj-scroll-tags .ailhj-tags-list {
  position: relative;
  height: 18px;
  line-height: 18px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}

.ailhj-scroll-tags .ailhj-tag-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(18px);
  transition: all 0.3s ease;
}

.ailhj-scroll-tags .ailhj-tag-item.active {
  opacity: 1;
  transform: translateY(0);
}

.ailhj-scroll-tags .ailhj-tag-arrow {
  width: 12px;
  height: 12px;
  fill: currentColor;
  opacity: 0.8;
  flex-shrink: 0;
}

/* 右侧区域 */
.ailhj-scroll-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* 滚动通知 */
.ailhj-scroll-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--muted-bg-color);
  border-radius: 20px;
  font-size: 13px;
  color: var(--muted-color);
  min-width: 350px;
  overflow: hidden;
}

.ailhj-scroll-notice .ailhj-notice-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.ailhj-scroll-notice .ailhj-notice-icon svg {
  font-size: 14px;
  color: var(--ailhj-red);
  width: 16px;
  height: 16px;
  fill: var(--ailhj-red);
}

.ailhj-scroll-notice .ailhj-notice-list {
  position: relative;
  height: 20px;
  line-height: 20px;
  overflow: hidden;
  flex: 1;
}

.ailhj-scroll-notice .ailhj-notice-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.ailhj-scroll-notice .ailhj-notice-item.active {
  opacity: 1;
  transform: translateY(0);
}

.ailhj-scroll-notice .ailhj-notice-item a,
.ailhj-scroll-notice .ailhj-notice-item span {
  color: var(--muted-color);
  text-decoration: none;
}

.ailhj-scroll-notice .ailhj-notice-item a:hover {
  text-decoration: underline;
}

/* 查看更多按钮 */
.ailhj-scroll-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 16px;
  font-size: 14px;
  color: var(--muted-color);
  text-decoration: none;
  border-radius: 20px;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.ailhj-scroll-more:hover {
  color: var(--ailhj-blue);
  background: var(--ailhj-blue-op05);
}

.ailhj-scroll-more i {
  font-size: 16px;
  transition: transform 0.3s ease;
}

.ailhj-scroll-more:hover i {
  transform: translateX(2px);
}

/* ========== 滚动区域 ========== */
.ailhj-category-scroll {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  padding-bottom: 10px;
}

/* 边缘淡出效果 */
.ailhj-category-scroll::before,
.ailhj-category-scroll::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100px;
  z-index: 2;
  pointer-events: none;
}

.ailhj-category-scroll::before {
  left: 0;
  background: linear-gradient(to right, var(--body-bg-color, #fff) 0%, transparent 100%);
}

.ailhj-category-scroll::after {
  right: 0;
  background: linear-gradient(to left, var(--body-bg-color, #fff) 0%, transparent 100%);
}

/* ========== 滚动行 ========== */
.ailhj-scroll-row {
  position: relative;
  width: 100%;
  height: auto;
  overflow: visible;
  padding: 12px 0;
}

.ailhj-scroll-track {
  display: inline-flex;
  gap: 20px;
  white-space: nowrap;
  animation: scrollLeft var(--scroll-duration, 30s) linear infinite;
  will-change: transform;
  transition: animation-play-state 0.3s ease;
}

/* 滚动组包装器 */
.ailhj-scroll-group {
  display: inline-flex;
  gap: 20px;
  white-space: nowrap;
}

/* 奇数行从右向左,偶数行从左向右 */
.ailhj-scroll-row:nth-child(even) .ailhj-scroll-track {
  animation-direction: reverse;
}

/* 滚动动画 - 使用 CSS 变量控制距离 */
@keyframes scrollLeft {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(var(--scroll-distance, -50%));
  }
}

/* ========== 分类标签 ========== */
.ailhj-scroll-item {
  display: inline-flex;
  align-items: center;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--main-color);
  background: #fff;
  border-radius: 24px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: scale(1);
}

.ailhj-scroll-item:hover {
  color: #fff;
  background: var(--ailhj-blue-grad);
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 8px 10px var(--ailhj-blue-shadow);
  z-index: 1;
}

/* 悬停当前行时暂停该行动画 */
.ailhj-scroll-row:hover .ailhj-scroll-track {
  animation-play-state: paused;
}

/* ========== 响应式优化 ========== */
@media (max-width: 1200px) {
  .ailhj-scroll-header {
    flex-wrap: wrap;
  }
  
  .ailhj-scroll-notice {
    max-width: 250px;
  }
}

@media (max-width: 768px) {
  .ailhj-scroll-header {
    margin-bottom: 16px;
  }
  
  .ailhj-scroll-title {
    font-size: 18px;
  }
  
  .ailhj-scroll-tags,
  .ailhj-scroll-notice {
    display: none;
  }
  
  .ailhj-scroll-more {
    padding: 4px 12px;
    font-size: 13px;
  }
  
  /* 移动端边缘淡出效果缩小 */
  .ailhj-category-scroll::before,
  .ailhj-category-scroll::after {
    width: 60px;
  }
  
  .ailhj-category-scroll {
    padding: 15px 0;
  }
  
  .ailhj-scroll-row {
    padding: 10px 0;
  }
  
  .ailhj-scroll-track {
    gap: 16px;
  }
  
  .ailhj-scroll-group {
    gap: 16px;
  }
  
  .ailhj-scroll-item {
    padding: 8px 18px;
    font-size: 13px;
    border-radius: 20px;
  }
}

@media (max-width: 480px) {
  .ailhj-scroll-title {
    font-size: 16px;
  }
  
  /* 移动端边缘淡出效果进一步缩小 */
  .ailhj-category-scroll::before,
  .ailhj-category-scroll::after {
    width: 40px;
  }
  
  .ailhj-category-scroll {
    padding: 10px 0;
  }
  
  .ailhj-scroll-row {
    padding: 8px 0;
  }
  
  .ailhj-scroll-track {
    gap: 12px;
  }
  
  .ailhj-scroll-group {
    gap: 12px;
  }
  
  .ailhj-scroll-item {
    padding: 6px 16px;
    font-size: 12px;
    border-radius: 18px;
  }
}
