/* ============================================================
   Audio Preview Module — Homepage Sound Showcase
   ============================================================ */

.audio-preview-section {
  padding: clamp(56px, 8vh, 96px) 0;
}

.audio-showcase {
  max-width: min(1420px, calc(100% - 48px));
  margin: 0 auto;
  min-height: 620px;
  box-sizing: border-box;
  border-radius: 32px;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255, 215, 106, .04), transparent 50%),
    linear-gradient(180deg, rgba(10, 14, 22, .78), rgba(7, 10, 16, .82));
  border: 1px solid rgba(255, 255, 255, .07);
  box-shadow:
    0 36px 100px rgba(0, 0, 0, .42),
    inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(14px) saturate(1.06);
  -webkit-backdrop-filter: blur(14px) saturate(1.06);
  overflow: hidden;
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.16,1,.3,1);
}

.audio-showcase.is-visible {
  opacity: 1;
  transform: none;
}

.audio-showcase__body {
  display: grid;
  grid-template-columns: minmax(300px, 0.35fr) minmax(0, 0.65fr);
  gap: 0;
  min-height: 560px;
}

.audio-showcase__info {
  padding: clamp(44px, 5vw, 72px) clamp(36px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid rgba(255, 255, 255, .05);
}

.audio-showcase__title {
  margin: 0 0 14px;
  font-size: clamp(28px, 3vw, 46px);
  font-weight: 800;
  color: #f4f8ff;
  line-height: 1.15;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}

.audio-showcase__subtitle {
  margin: 0 0 22px;
  font-size: clamp(14px, 1.2vw, 17px);
  color: rgba(255, 215, 106, .85);
  font-weight: 500;
}

.audio-showcase__desc {
  margin: 0 0 36px;
  font-size: clamp(14px, 1.1vw, 16px);
  line-height: 1.8;
  color: rgba(200, 212, 232, .74);
}

.audio-showcase__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffefa7, #ffd76a 50%, #f0b13e);
  color: #1a1000;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: 0 8px 24px rgba(255, 196, 70, .18);
  transition: box-shadow .2s ease, background-color .2s ease, filter .2s ease;
  align-self: flex-start;
}

.audio-showcase__cta:hover {
  box-shadow: 0 14px 36px rgba(255, 196, 70, .26);
  filter: brightness(1.06);
}

/* ---- Player ---- */
.audio-showcase__player {
  padding: clamp(32px, 3.5vw, 52px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 460px;
  box-sizing: border-box;
}

.audio-player__head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
}

.audio-player__now-title {
  font-size: clamp(17px, 1.4vw, 20px);
  font-weight: 700;
  color: #f4f8ff;
}

.audio-player__now-cat {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 215, 106, .12);
  border: 1px solid rgba(255, 215, 106, .25);
  color: #ffd76a;
  font-size: 12px;
  font-weight: 600;
  min-width: 32px;
  text-align: center;
}

/* Wave visualization */
.audio-player__wave {
  position: relative;
  height: 56px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 0 4px;
}

.audio-player__wave::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, .10) 0px,
    rgba(255, 255, 255, .10) 2px,
    transparent 2px,
    transparent 5px
  );
  mask: linear-gradient(180deg, transparent 8%, #000 35%, #000 65%, transparent 92%);
  -webkit-mask: linear-gradient(180deg, transparent 8%, #000 35%, #000 65%, transparent 92%);
}

.audio-player__wave-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(255, 215, 106, .35), rgba(245, 185, 63, .50));
  border-radius: 8px;
  transition: width 80ms linear;
}

/* Controls */
.audio-player__controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.audio-player__play-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 215, 106, .35);
  background: rgba(255, 215, 106, .10);
  color: #ffd76a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color .15s ease, box-shadow .15s ease, filter .15s ease;
  flex-shrink: 0;
}

.audio-player__play-btn:hover {
  background: rgba(255, 215, 106, .20);
  box-shadow: 0 0 22px rgba(255, 196, 70, .24);
  filter: brightness(1.08);
}

.audio-player__play-btn:active {
  filter: brightness(.92);
}

.audio-player__time,
.audio-player__duration {
  font-size: 13px;
  color: rgba(200, 212, 232, .72);
  font-variant-numeric: tabular-nums;
  min-width: 44px;
  width: 44px;
  text-align: center;
  flex-shrink: 0;
}

.audio-player__progress {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.audio-player__progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f5b93f, #ffd76a);
  transition: width 80ms linear;
}

.audio-player__speed {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .04);
  color: rgba(238, 244, 255, .8);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
  flex-shrink: 0;
  min-width: 46px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.audio-player__speed:hover {
  border-color: rgba(255, 215, 106, .35);
  color: #ffd76a;
}

/* List */
.audio-player__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 320px;
  min-height: 320px;
  max-height: 320px;
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  flex-shrink: 0;
}

.audio-player__list::-webkit-scrollbar {
  width: 5px;
}

.audio-player__list::-webkit-scrollbar-track {
  background: transparent;
}

.audio-player__list::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 106, .3);
  border-radius: 999px;
}

.audio-player__item {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 56px;
  min-height: 56px;
  max-height: 56px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  box-sizing: border-box;
  flex-shrink: 0;
  outline: none;
  transition:
    background-color .18s ease,
    color .18s ease,
    border-color .18s ease,
    box-shadow .18s ease,
    opacity .18s ease;
}

.audio-player__item:hover {
  background: rgba(255, 255, 255, .05);
  border-color: rgba(255, 215, 106, .18);
  box-shadow: inset 0 0 0 1px rgba(255, 215, 106, .08);
}

.audio-player__item.is-active {
  background: rgba(255, 215, 106, .08);
  border-color: rgba(255, 215, 106, .28);
  box-shadow: inset 0 0 0 1px rgba(255, 215, 106, .12);
}

.audio-player__item.is-active .audio-player__item-name {
  color: #ffd76a;
}

.audio-player__item.is-active .audio-player__item-num {
  color: #ffd76a;
}

.audio-player__item-num {
  font-size: 13px;
  color: rgba(200, 212, 232, .5);
  font-weight: 600;
  min-width: 22px;
}

.audio-player__item-name {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  color: rgba(238, 244, 255, .88);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-player__item-cat {
  font-size: 12px;
  color: rgba(200, 212, 232, .5);
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .03);
  min-width: 28px;
  text-align: center;
  flex-shrink: 0;
}

/* Mini bars — always reserve fixed width, opacity-only toggle */
.audio-player__item-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  width: 24px;
  min-width: 24px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .18s ease;
}

.audio-player__item.is-active .audio-player__item-bars {
  opacity: 1;
}

.audio-player__item-bars i {
  display: block;
  width: 3px;
  height: 8px;
  background: #ffd76a;
  border-radius: 1px;
  flex-shrink: 0;
}

[data-audio-module].is-playing .audio-player__item.is-active .audio-player__item-bars i {
  animation: audioBar .6s ease-in-out infinite alternate;
  transform-origin: center bottom;
}

[data-audio-module].is-playing .audio-player__item.is-active .audio-player__item-bars i:nth-child(1) { animation-delay: 0s; }
[data-audio-module].is-playing .audio-player__item.is-active .audio-player__item-bars i:nth-child(2) { animation-delay: .15s; }
[data-audio-module].is-playing .audio-player__item.is-active .audio-player__item-bars i:nth-child(3) { animation-delay: .3s; }
[data-audio-module].is-playing .audio-player__item.is-active .audio-player__item-bars i:nth-child(4) { animation-delay: .45s; }

@keyframes audioBar {
  0% { transform: scaleY(0.45); }
  100% { transform: scaleY(1); }
}

/* ---- Categories bar ---- */
.audio-showcase__cats {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px clamp(36px, 4vw, 56px);
  min-height: 62px;
  box-sizing: border-box;
  border-top: 1px solid rgba(255, 255, 255, .05);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.audio-showcase__cats::-webkit-scrollbar {
  height: 0;
}

.audio-showcase__cats a {
  flex-shrink: 0;
  padding: 9px 18px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(200, 212, 232, .72);
  text-decoration: none;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .06);
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.audio-showcase__cats a:hover {
  background: rgba(255, 215, 106, .10);
  color: #ffd76a;
  border-color: rgba(255, 215, 106, .25);
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .audio-showcase__body {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .audio-showcase__info {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
    padding: 36px 28px;
  }

  .audio-showcase__player {
    padding: 28px;
  }

  .audio-player__list {
    height: 240px;
    min-height: 240px;
    max-height: 240px;
  }
}

@media (max-width: 560px) {
  .audio-showcase {
    border-radius: 20px;
    max-width: calc(100% - 24px);
  }

  .audio-showcase__info {
    padding: 28px 20px;
  }

  .audio-showcase__player {
    padding: 20px;
  }

  .audio-showcase__cats {
    padding: 16px 20px;
    gap: 7px;
  }

  .audio-showcase__cats a {
    padding: 7px 14px;
    font-size: 12px;
  }

  .audio-player__list {
    height: 200px;
    min-height: 200px;
    max-height: 200px;
  }

  .audio-player__wave {
    height: 42px;
  }

  .audio-player__play-btn {
    width: 44px;
    height: 44px;
  }
}
