﻿/* ========================================
   PACKS - Sound pack collections
   Pack cards, carousel, pack page
   ======================================== */

/* ========== FEATURED PACKS SECTION (legacy) ========== */
.featured-packs-section {
  /* bleed → shared.css */
  margin-bottom: 32px;
}

.featured-packs-section > div:first-child {
  padding-left: clamp(20px, 5vw, 50px);
  padding-right: clamp(20px, 5vw, 50px);
}

/* ========== FEATURED BROWSE (Browse home) ========== */
.featured-browse-section {
  /* bleed → shared.css */
  margin-bottom: clamp(16px, 2.5vw, 24px);
}

.featured-browse-section > .browse-hero {
  padding-left: 0;
  padding-right: 0;
}

/* Même inset horizontal que les autres carousels (titre déjà décalé avec --browse-title-nudge) */
.featured-packs-carousel {
  margin: 0 !important;
}

/* Featured + Recent packs + Playlists (Browse) : même taille (~160px), typo, espacement resserré */
.featured-packs-carousel .pack-card,
#recentPacksCarousel .pack-card,
#creatorPacksCarousel .pack-card,
#forYouCarousel .pack-card,
#playlistsCarousel .pack-card {
  min-width: 160px !important;
  width: 160px !important;
  max-width: 160px !important;
  /* Moins que le gap:12px global — au repère des loop rows / petites covers */
  gap: 6px;
}

.featured-packs-carousel .pack-cover,
#recentPacksCarousel .pack-cover,
#creatorPacksCarousel .pack-cover,
#forYouCarousel .pack-cover,
#playlistsCarousel .pack-cover {
  border-radius: var(--card-radius);
}

.featured-packs-carousel .pack-cover img,
#recentPacksCarousel .pack-cover img,
#creatorPacksCarousel .pack-cover img,
#forYouCarousel .pack-cover img,
#playlistsCarousel .pack-cover img {
  border-radius: var(--card-radius);
}

.featured-packs-carousel .pack-info h4,
#recentPacksCarousel .pack-info h4,
#creatorPacksCarousel .pack-info h4,
#forYouCarousel .pack-info h4,
#playlistsCarousel .pack-info h4 {
  font-size: var(--font-size-base);
  font-weight: var(--section-title-weight);
  margin-top: 0;
  margin-bottom: 2px;
  line-height: 1.25;
}

.featured-packs-carousel .pack-info p,
#recentPacksCarousel .pack-info p,
#creatorPacksCarousel .pack-info p,
#forYouCarousel .pack-info p,
#playlistsCarousel .pack-info p {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-top: 0;
  margin-bottom: 3px;
  line-height: 1.35;
}

.featured-packs-carousel .pack-info .pack-meta,
#recentPacksCarousel .pack-info .pack-meta,
#creatorPacksCarousel .pack-info .pack-meta,
#forYouCarousel .pack-info .pack-meta,
#playlistsCarousel .pack-info .pack-meta {
  margin-top: 0;
}

/* Section Featured Loops (pleine largeur, avant For You) */
.featured-loops-section {
  /* bleed → shared.css */
  margin-bottom: clamp(36px, 4.5vw, 48px);
}

.featured-loops-section > .browse-hero {
  padding-left: 0;
  padding-right: 0;
}

/* Pas de titre géant : liste sous la rangée featured packs */
.featured-loops-section--list-only > .browse-hero .browse-hero-body {
  margin-top: clamp(14px, 2vw, 22px);
}

.featured-loops-list-wrap {
  width: 100%;
  min-width: 0;
  padding-left: var(--browse-pad-x, clamp(20px, 5vw, 50px));
  padding-right: var(--browse-pad-x, clamp(20px, 5vw, 50px));
  box-sizing: border-box;
}

.featured-loops-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  border-top: 0.5px solid rgba(40, 40, 40, 0.07);
}

.featured-loops-empty {
  color: var(--text-secondary);
  font-size: 13px;
  padding: 16px 10px;
}

/* Cartes loop dans Featured — héritent de Loops.css, rien à surcharger */

/* Charts Browse — même alignement / liste que Featured loops */
.charts-browse-section {
  /* Plus d’air avant Recent — rapproché de For You via .fy-carousel-shell + marge #forYouSection */
  margin-bottom: clamp(34px, 4.2vw, 48px);
  margin-left: calc(-1 * clamp(20px, 5vw, 50px));
  margin-right: calc(-1 * clamp(20px, 5vw, 50px));
  overflow: visible;
}

.charts-browse-section > .browse-hero {
  padding-left: 0;
  padding-right: 0;
}

.charts-browse-list-wrap {
  width: 100%;
  min-width: 0;
  padding-left: var(--browse-pad-x, clamp(20px, 5vw, 50px));
  padding-right: var(--browse-pad-x, clamp(20px, 5vw, 50px));
  box-sizing: border-box;
}

.charts-browse-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  border-top: 0.5px solid rgba(40, 40, 40, 0.07);
}

/* Charts loop cards — héritent de Loops.css */

[data-theme="dark"] .charts-browse-list {
  border-top-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .charts-browse-list .loop-card {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  background: transparent !important;
}

[data-theme="dark"] .charts-browse-list .loop-card:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}

/* Ligne loop — liste à séparateurs (maquette browse v4) */
.featured-loop-row {
  --fl-cover: 38px;
  display: grid;
  grid-template-columns: var(--fl-cover) minmax(100px, 260px) minmax(140px, 1fr) auto min-content;
  gap: 10px 14px;
  align-items: center;
  padding: 9px 0;
  margin: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  border-bottom: 0.5px solid rgba(40, 40, 40, 0.07);
  cursor: grab;
  transition: background 0.15s ease;
}

[data-theme="dark"] .featured-loops-list {
  border-top-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .featured-loop-row {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.featured-loop-row:hover {
  background: rgba(40, 40, 40, 0.015);
  box-shadow: none;
}

[data-theme="dark"] .featured-loop-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.featured-loop-row.dragging {
  opacity: 0.6;
  cursor: grabbing;
}

.featured-loop-cover-wrap {
  position: relative;
  width: var(--fl-cover);
  height: var(--fl-cover);
  flex-shrink: 0;
}

.featured-loop-cover {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(145deg, #94a3b8, #64748b);
}

.featured-loop-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.featured-loop-cover-ph {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #cbd5e1, #94a3b8);
}

/* Play overlay : comme loop-card */
.featured-loop-play-ov {
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(28px, 62%);
  height: min(28px, 62%);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: opacity 0.18s ease, transform 0.15s ease, background 0.15s ease;
  opacity: 0;
  pointer-events: none;
}

.featured-loop-play-ov input {
  display: none;
}

.featured-loop-play-ov svg {
  width: 11px;
  height: 11px;
  color: #fff;
  position: absolute;
}

.featured-loop-play-ov .play {
  margin-left: 2px;
}

.featured-loop-play-ov .pause {
  display: none;
}

.featured-loop-play-ov input:checked ~ .play {
  display: none;
}

.featured-loop-play-ov input:checked ~ .pause {
  display: block;
}

.featured-loop-row:hover .featured-loop-play-ov,
.featured-loop-row:focus-within .featured-loop-play-ov,
.featured-loop-play-ov:has(input:checked) {
  opacity: 1;
  pointer-events: auto;
}

.featured-loop-play-ov:hover {
  background: rgba(0, 0, 0, 0.88);
  transform: scale(1.06);
}

.featured-loop-col-info {
  min-width: 0;
}

.featured-loop-title-link {
  font-size: 12px;
  font-weight: 400;
  font-family: 'Satoshi-Regular', 'Satoshi', sans-serif;
  color: var(--text-primary);
  text-decoration: none;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
  padding-bottom: 0.06em;
}

.featured-loop-title-link:hover {
  opacity: 0.85;
}

.featured-loop-wave-slot {
  min-width: 0;
}

.featured-loop-waveform {
  width: 100%;
  height: 40px;
  min-height: 40px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

[data-theme="dark"] .featured-loop-waveform {
  background: rgba(255, 255, 255, 0.06);
}

.featured-loop-waveform > div {
  width: 100% !important;
  height: 40px !important;
}

.featured-loop-stats {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(8px, 2vw, 18px);
  flex-shrink: 0;
}

.featured-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 36px;
}

.featured-stat-val {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.featured-stat-lbl {
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary, #999);
}

.featured-loop-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.featured-loop-like.like-container {
  width: 32px;
  height: 32px;
}

.featured-loop-dl.Btn {
  width: 32px;
  height: 32px;
}

@media (max-width: 720px) {
  .featured-loop-row {
    grid-template-columns: var(--fl-cover) minmax(0, 1fr) min-content;
    grid-template-areas:
      'cover info actions'
      'wave wave wave'
      'stats stats stats';
  }
  .featured-loop-cover-wrap { grid-area: cover; }
  .featured-loop-col-info { grid-area: info; }
  .featured-loop-actions { grid-area: actions; }
  .featured-loop-wave-slot { grid-area: wave; }
  .featured-loop-stats { grid-area: stats; justify-content: space-between; flex-wrap: wrap; }
}

/* ========== PACKS SECTION ========== */
.packs-section {
  margin-bottom: clamp(40px, 5vw, 52px);
  margin-left: calc(-1 * clamp(20px, 5vw, 50px));
  margin-right: calc(-1 * clamp(20px, 5vw, 50px));
  overflow: visible;
}

/* .browse-hero gère le padding des titres ; pas de double padding sur le bloc */
.packs-section > .browse-hero {
  padding-left: 0;
  padding-right: 0;
}

/* Base carousel → shared.css */
.packs-carousel {
  padding: 14px clamp(20px, 5vw, 50px) 24px var(--page-hero-pad-x);
  scroll-padding: var(--page-hero-pad-x);
}

.browse-hero .packs-carousel {
  padding-left: var(--browse-pad-x);
  padding-right: var(--browse-pad-x);
  scroll-padding: var(--browse-pad-x);
}

.browse-hero .packs-carousel::-webkit-scrollbar-track {
  margin: 0 var(--browse-pad-x);
}

.pack-card {
  background: transparent;
  border-radius: 0;
  overflow: visible;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  box-shadow: none;
  will-change: transform;
  display: flex;
  flex-direction: column;
  gap: 12px;
  user-select: none;
}

/* Dark mode pour pack card */
[data-theme="dark"] .pack-card {
  background: transparent;
  border: none;
  box-shadow: none;
}

#recentPacksCarousel.packs-carousel,
#creatorPacksCarousel.packs-carousel,
#forYouCarousel.packs-carousel {
  gap: 12px;
}

.playlists-carousel .pack-card {
  min-width: 280px;
  width: 280px;
}

/* Carousels .packs-carousel (ex. similar packs) ; featured + recent surchargés */
.packs-carousel .pack-card {
  min-width: 280px;
  width: 280px;
}

.pack-card:hover {
  transform: translateY(-4px);
}

.pack-card:hover .pack-cover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .pack-card:hover .pack-cover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* scrolling disable → shared.css */
.packs-carousel.scrolling .pack-card:hover {
  transform: none;
}

.packs-carousel.scrolling .pack-card:hover .pack-cover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .packs-carousel.scrolling .pack-card:hover .pack-cover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.pack-cover {
  width: 100%;
  padding-top: 100%; /* Crée un ratio 1:1 (carré) */
  background: #f0f0f0;
  position: relative;
  overflow: hidden;
  font-size: 48px;
  color: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border-radius: var(--card-radius);
  transition: box-shadow 0.2s ease;
  -webkit-backface-visibility: hidden;
  -moz-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform: translate3d(0, 0, 0);
  -moz-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  isolation: isolate;
}

[data-theme="dark"] .pack-cover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  background: #2a2a2a;
  color: rgba(255, 255, 255, 0.3);
}

/* Pour le carousel, rendre les covers carrés aussi */
.packs-carousel .pack-cover,
.playlists-carousel .pack-cover {
  padding-top: 100%; /* Ratio 1:1 carré dans le carousel aussi */
  height: auto;
}

.pack-cover > *:not(img):not(.pack-preview-btn):not(.like-container) {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
}

.pack-cover img {
  position: absolute;
  top: -1px;
  left: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  object-fit: cover;
  z-index: 1;
  border-radius: var(--card-radius);
  display: block;
}

.pack-info {
  padding: 0;
  background: transparent;
}

[data-theme="dark"] .pack-info {
  background: transparent;
}

/* ========== LIKE BUTTON (PACK CARDS — overlay cover, même logique que .pack-preview-btn) ========== */
.pack-card .pack-cover > .like-container.pack-card-like-overlay {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
  z-index: 11;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  color: #fff;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.pack-card:hover .pack-cover > .like-container.pack-card-like-overlay,
.pack-card:focus-within .pack-cover > .like-container.pack-card-like-overlay,
.pack-card .pack-cover > .like-container.pack-card-like-overlay:has(input:checked) {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.pack-card .pack-cover > .like-container.pack-card-like-overlay:hover {
  background: rgba(0, 0, 0, 0.72);
  transform: scale(1.04);
}

.pack-card .pack-cover > .like-container.pack-card-like-overlay input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
  pointer-events: none;
}

.pack-card .pack-cover > .like-container.pack-card-like-overlay .checkmark {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  position: relative;
}

.pack-card .pack-cover > .like-container.pack-card-like-overlay svg {
  width: 14px;
  height: 14px;
  pointer-events: none;
}

/* Attribut stroke="currentColor" sur le path : sans ça, le trait reste blanc quand liké */
.pack-card .pack-cover > .like-container.pack-card-like-overlay svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: fill 0.2s ease, stroke 0.2s ease;
}

.pack-card .pack-cover > .like-container.pack-card-like-overlay input:checked ~ .checkmark svg {
  animation: heartBeat 0.3s ease;
}

.pack-card .pack-cover > .like-container.pack-card-like-overlay input:checked ~ .checkmark svg path {
  fill: #ef4444 !important;
  stroke: #ef4444 !important;
}

/* Spinner pour le like */
.pack-card .pack-cover > .like-container.pack-card-like-overlay .checkmark.loading {
  cursor: wait;
  pointer-events: none;
}

.pack-card .pack-cover > .like-container.pack-card-like-overlay .checkmark.loading svg {
  display: none;
}

.pack-card .pack-cover > .like-container.pack-card-like-overlay .checkmark.loading::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.3); }
  50% { transform: scale(1.1); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.pack-info h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  margin-top: 0;
  color: var(--text-primary);
  transition: color 0.3s ease;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.pack-info p {
  font-size: 13px;
  color: #888;
  margin-bottom: 6px;
  margin-top: 0;
  transition: color 0.3s ease;
  font-weight: 400;
  line-height: 1.4;
}

/* Dark mode pour pack info */
[data-theme="dark"] .pack-info p {
  color: var(--text-secondary);
}

.pack-meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: #aaa;
  transition: color 0.3s ease;
  margin-top: 2px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Dark mode pour pack meta */
[data-theme="dark"] .pack-meta {
  color: var(--text-tertiary);
}

/* ========== PACK PREVIEW BUTTON ========== */
.pack-preview-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
  opacity: 0;
  transform: scale(0.92);
  z-index: 10;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: none;
}

.pack-card:hover .pack-preview-btn {
  opacity: 1;
  transform: scale(1);
}

.pack-preview-btn:hover {
  background: rgba(0, 0, 0, 0.72);
  transform: scale(1.04);
}

.pack-preview-btn svg {
  width: 13px;
  height: 13px;
  fill: white;
}

/* Même logique que .player-play-btn : discret, pas d’accent violet */
.pack-preview-btn[data-playing="true"] {
  opacity: 1;
  background: rgba(0, 0, 0, 0.72);
}

[data-theme="dark"] .pack-preview-btn[data-playing="true"] {
  background: rgba(0, 0, 0, 0.72);
}

[data-theme="dark"] .pack-preview-btn[data-playing="true"] svg {
  fill: #ffffff;
}

.pack-view {
  animation: fadeIn 0.3s ease;
  padding-bottom: 16px;
}

/* ========== PACK VIEW HEADER (colonne simple) ========== */
.pack-view-header {
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.pack-view-badge {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}

.pack-view-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 6px 0;
  line-height: 1.35;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-bottom: 0.08em;
}

.pack-view-description {
  color: #282828;
  font-size: 13px;
  margin: 0 0 12px 0;
  line-height: 1.5;
  font-weight: 400;
}

[data-theme="dark"] .pack-view-description {
  color: rgba(255, 255, 255, 0.72);
}

.pack-view-meta {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Values sans labels — juste les valeurs + séparateurs */
.pack-meta-label {
  display: none;
}

.pack-meta-item {
  display: flex;
  align-items: center;
}

.pack-meta-sep {
  margin: 0 6px;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1;
  user-select: none;
}

/* ========== PACK COVER WRAPPER + HOVER ACTIONS ========== */
.pack-cover-wrapper {
  position: relative;
  width: 100%;
}

.pack-cover-hover-actions {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  align-items: center;
  z-index: 20;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.pack-view-left:hover .pack-cover-hover-actions,
.pack-cover-wrapper:hover .pack-cover-hover-actions {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Bouton always-visible quand le pack preview joue */
.pack-cover-hover-actions:has(#packPagePreviewBtn[data-playing="true"]) {
  opacity: 1;
  pointer-events: auto;
}

.pack-hover-btn {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  border-radius: 50% !important;
  background: rgba(0, 0, 0, 0.55) !important;
  border: none !important;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease !important;
  flex-shrink: 0;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.pack-hover-btn:hover {
  background: rgba(0, 0, 0, 0.72) !important;
  transform: scale(1.05) !important;
}

.pack-hover-btn svg {
  width: 13px !important;
  height: 13px !important;
  fill: white !important;
}

/* Like button dans hover overlay */
.pack-cover-hover-actions .pack-like-btn input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.pack-cover-hover-actions .pack-like-btn {
  color: #fff;
}

.pack-cover-hover-actions .pack-like-btn .checkmark {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.pack-cover-hover-actions .pack-like-btn .checkmark svg {
  width: 14px;
  height: 14px;
}

.pack-cover-hover-actions .pack-like-btn .checkmark svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.pack-cover-hover-actions .pack-like-btn input:checked ~ .checkmark svg {
  animation: heartBeat 0.3s ease;
}

.pack-cover-hover-actions .pack-like-btn input:checked ~ .checkmark svg path {
  fill: #ef4444 !important;
  stroke: #ef4444 !important;
}

.pack-cover-hover-actions .pack-like-btn .checkmark.loading svg {
  display: none;
}

.pack-cover-hover-actions .pack-like-btn .checkmark.loading::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Preview actif : aligné sur le play du bottom header */
#packPagePreviewBtn[data-playing="true"].pack-hover-btn {
  background: #1a1a1a !important;
  border: none !important;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25) !important;
}

[data-theme="dark"] #packPagePreviewBtn[data-playing="true"].pack-hover-btn {
  background: #ffffff !important;
}

[data-theme="dark"] #packPagePreviewBtn[data-playing="true"].pack-hover-btn svg {
  fill: #1a1a1a !important;
}

/* ========== PACK VIEW BODY (cover | loops) ========== */
.pack-view-body {
  display: flex;
  gap: 24px;
  align-items: flex-start; /* cover sets the height via aspect-ratio */
}

.pack-view-left {
  flex: 0 0 38%;
  max-width: 38%;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.pack-view-left .pack-cover-large {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  min-width: unset;
  max-width: unset;
  margin-bottom: 0;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
}

.pack-view-left .pack-cover-large img {
  border-radius: var(--radius-lg);
}

.pack-view-right {
  flex: 1;
  min-width: 0;
  align-self: stretch; /* matches the cover height exactly */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

[data-theme="dark"] .pack-view-right {
  border-color: var(--border-color);
}

.pack-view-right::-webkit-scrollbar {
  width: 0;
}

/* Filter bar inside right panel */
.pack-view-right .pack-loop-filter-bar {
  flex-shrink: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 0 !important;
  background: transparent;
  padding: 6px 12px;
}

[data-theme="dark"] .pack-view-right .pack-loop-filter-bar {
  border-bottom-color: var(--border-color);
}

/* Loop list scrollable area */
.pack-view-right .loops-stack {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  margin-bottom: 0 !important;
  gap: 0 !important;
}

.pack-view-right .loops-stack::-webkit-scrollbar {
  width: 0;
}

/* ========== SIMILAR PACKS SECTION ========== */
.pack-similar-section {
  margin-top: 28px;
  margin-left: calc(-1 * clamp(20px, 5vw, 50px));
  margin-right: calc(-1 * clamp(20px, 5vw, 50px));
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.pack-similar-title {
  padding-left: clamp(20px, 5vw, 50px);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  margin: 0 0 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  color: var(--text-tertiary);
}

/* Loop cards dans la vue pack — flex layout pour éviter les conflits de grid */
#packLoopsGrid {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.15) transparent;
}

#packLoopsGrid .loop-card {
  display: flex !important;
  align-items: center;
  padding: 0 10px;
  gap: 8px;
  flex: 1;
  min-height: 48px;
  max-height: 80px;
  max-width: 100%;
  box-sizing: border-box;
  height: auto !important;
  border-radius: 0;
  background: transparent;
  border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] #packLoopsGrid .loop-card {
  border-bottom-color: var(--border-color);
  background: transparent;
}

#packLoopsGrid .loop-card:last-child {
  border-bottom: none;
}

#packLoopsGrid .loop-card:hover {
  background: var(--hover-bg) !important;
  position: relative;
  z-index: 60;
}

/* Tooltips natifs dans le grid cachés — remplacés par le tooltip fixe JS (#packGridFloatTooltip) */
#packLoopsGrid .lc-tooltip-trigger .lc-tooltip,
#packLoopsGrid .loop-meta .meta-item .lc-tooltip {
  display: none !important;
}

/* Cover : image masquée, zone play seule (play est dans la cover) */
#packLoopsGrid .loop-card .pack-cover-small {
  display: flex !important;
  width: 28px !important;
  min-width: 28px !important;
  height: 28px !important;
  max-height: 28px !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: visible !important;
  position: relative !important;
  background: transparent !important;
}

#packLoopsGrid .loop-card .pack-cover-small img,
#packLoopsGrid .loop-card .pack-cover-small .pack-placeholder {
  display: none !important;
}

#packLoopsGrid .loop-card .pack-cover-small .play-container {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  box-shadow: none !important;
  background: transparent !important;
}

#packLoopsGrid .loop-card .pack-cover-small .play-container svg {
  width: 16px !important;
  height: 16px !important;
  fill: #666666 !important;
}

[data-theme="dark"] #packLoopsGrid .loop-card .pack-cover-small .play-container svg {
  fill: #999999 !important;
}

/* Info : titre + créateur, prend tout l'espace restant */
#packLoopsGrid .loop-card .loop-info {
  flex: 1 !important;
  min-width: 0;
  overflow: hidden;
  gap: 2px;
  padding: 0;
  grid-area: unset;
}

#packLoopsGrid .loop-card .loop-info h3 {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  padding-bottom: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#packLoopsGrid .loop-card .loop-info h3 .loop-title-pack,
#packLoopsGrid .loop-card .loop-info h3 .loop-title-text {
  font-weight: 500;
}

#packLoopsGrid .loop-card .loop-info p {
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-tertiary);
}

/* Waveform : largeur réduite pour laisser place aux meta */
#packLoopsGrid .loop-card .loop-waveform {
  width: 120px !important;
  min-width: 0 !important;
  max-width: 120px !important;
  height: 32px !important;
  flex-shrink: 1;
  overflow: hidden;
  grid-area: unset;
}

#packLoopsGrid .loop-card .loop-waveform > div,
#packLoopsGrid .loop-card .loop-waveform svg {
  width: 120px !important;
  height: 32px !important;
  max-width: 120px !important;
}

/* Meta : BPM · KEY · ACCESS · CREDITS tous visibles */
#packLoopsGrid .loop-card .loop-meta {
  display: flex !important;
  width: 172px !important;
  min-width: 172px !important;
  flex-shrink: 0;
  gap: 4px;
  justify-content: space-between;
  padding: 0;
  grid-area: unset;
}

#packLoopsGrid .loop-card .loop-meta .meta-item {
  width: 38px;
  min-width: 38px;
  flex-shrink: 0;
}

#packLoopsGrid .loop-card .loop-meta .meta-value {
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

#packLoopsGrid .loop-card .loop-meta .meta-label {
  font-size: 7.5px;
  letter-spacing: 0.2px;
  color: var(--text-tertiary);
}


/* Actions */
#packLoopsGrid .loop-card .loop-actions {
  width: auto;
  min-width: 0;
  flex-shrink: 0;
  gap: 2px;
  justify-content: flex-end;
  grid-area: unset;
  overflow: visible;
}

#packLoopsGrid .loop-card .loop-actions svg {
  width: 13px !important;
  height: 13px !important;
}

#packLoopsGrid .loop-card .Btn {
  width: 24px !important;
  height: 24px !important;
  flex-shrink: 0;
}

#packLoopsGrid .loop-card .like-container {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

#packLoopsGrid .loop-card .like-container .checkmark {
  width: 24px;
  height: 24px;
}

#packLoopsGrid .loop-card .like-container svg {
  width: 13px;
  height: 13px;
}

#packLoopsGrid .loop-card .loop-more-btn {
  width: 20px;
  height: 24px;
  flex-shrink: 0;
}

/* Tags cachés dans la vue pack (trop verbeux) */
#packLoopsGrid .loop-card .loop-tags {
  display: none;
}

/* ========== PACK LOOPS NAV (flèches dans filter bar) ========== */
.pack-loops-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.pack-loops-nav-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  flex-shrink: 0;
}

.pack-loops-nav-btn svg {
  width: 14px;
  height: 14px;
  stroke: var(--text-secondary, #666);
}

.pack-loops-nav-btn:hover:not(:disabled) {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.22);
}

.pack-loops-nav-btn:disabled {
  opacity: 0.28;
  cursor: default;
}

[data-theme="dark"] .pack-loops-nav-btn {
  border-color: rgba(255,255,255,0.14);
}

[data-theme="dark"] .pack-loops-nav-btn svg {
  stroke: rgba(255,255,255,0.55);
}

[data-theme="dark"] .pack-loops-nav-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.26);
}

.pack-loops-nav-count {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--text-tertiary, #999);
  min-width: 32px;
  text-align: center;
  font-family: 'Satoshi', 'Plus Jakarta Sans', sans-serif;
  white-space: nowrap;
}

[data-theme="dark"] .pack-loops-nav-count {
  color: rgba(255,255,255,0.35);
}

/* ========== PACK LOOPS SCROLL WRAP ========== */
.pack-loops-scroll-wrap {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  height: 0; /* force le flex à contraindre la hauteur */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 100%;
}

/* #packLoopsGrid scrollable — hauteur contrainte par le parent flex (= hauteur cover) */
.pack-view-right .pack-loops-scroll-wrap #packLoopsGrid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

[data-theme="dark"] #packLoopsGrid {
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}

#packLoopsGrid::-webkit-scrollbar {
  width: 4px;
}

#packLoopsGrid::-webkit-scrollbar-track {
  background: transparent;
}

#packLoopsGrid::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 2px;
}

[data-theme="dark"] #packLoopsGrid::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
}

/* Gradient fade bas */
.pack-loops-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72px;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--bg-primary, #fff));
  transition: opacity 0.25s ease;
  border-radius: 0 0 8px 8px;
}

[data-theme="dark"] .pack-loops-fade {
  background: linear-gradient(to bottom, transparent, var(--bg-primary, #111));
}

.pack-loops-fade.hidden {
  opacity: 0;
}

/* ========== PACK HEADER (PAGE PACK) ========== */
.pack-header {
  display: flex;
  gap: 32px;
  margin-bottom: 32px;
  align-items: flex-start;
}

.pack-cover-large {
  width: 240px;
  height: 240px;
  min-width: 240px;
  border-radius: 8px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: rgba(0, 0, 0, 0.3);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease;
  position: relative;
  -webkit-backface-visibility: hidden;
  -moz-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform: translate3d(0, 0, 0);
  -moz-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  isolation: isolate;
}

[data-theme="dark"] .pack-cover-large {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  background: #2a2a2a;
  color: rgba(255, 255, 255, 0.3);
}

.pack-cover-large img {
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  object-fit: cover;
  position: absolute;
  top: -1px;
  left: -1px;
  z-index: 1;
  border-radius: 16px;
  display: block;
}

/* Emoji placeholder aussi doit être en arrière-plan */
.pack-cover-large > *:not(.pack-cover-actions) {
  z-index: 1;
}

/* Actions overlay sur l'image du pack */
.pack-cover-actions {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex !important;
  gap: 8px;
  z-index: 100;
  transition: all 0.2s ease;
}

.pack-info-details {
  flex: 1;
  min-width: 0;
  padding-top: 8px;
}


/* Boutons sur l'image du pack (like et preview) */
.pack-cover-actions .pack-like-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7) !important;
  border: none;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.pack-cover-actions .pack-like-btn:hover {
  background: rgba(0, 0, 0, 0.9) !important;
  transform: scale(1.1);
}

.pack-share-btn.copied {
  background: rgba(16, 185, 129, 0.85) !important;
  animation: pulseShare 0.3s ease;
}

@keyframes pulseShare {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Responsive - mobile */
@media (max-width: 900px) {
  .pack-view-body {
    flex-direction: column;
    height: auto;
    max-height: none;
    align-items: stretch;
  }

  .pack-view-left {
    display: none;
  }

  .pack-view-right {
    width: 100%;
    min-width: 0;
    align-self: auto;
    min-height: 240px;
  }

  .pack-loops-scroll-wrap {
    height: auto !important;
    min-height: 180px;
    max-height: 380px;
  }

  #packLoopsGrid .loop-card {
    min-height: 42px;
    max-height: 70px;
  }

  #packLoopsGrid .loop-card .loop-waveform {
    width: 60px !important;
    min-width: 0 !important;
    max-width: 60px !important;
  }

  #packLoopsGrid .loop-card .loop-waveform > div,
  #packLoopsGrid .loop-card .loop-waveform svg {
    width: 60px !important;
  }
}

@media (max-width: 768px) {
  .pack-view-header {
    flex-direction: column;
    gap: 12px;
  }

  .pack-view-body {
    flex-direction: column;
    height: auto;
    max-height: none;
    gap: 12px;
    align-items: stretch;
  }

  .pack-view-left {
    display: none;
  }

  .pack-view-right {
    width: 100%;
    min-width: 0;
    align-self: auto;
    min-height: 200px;
  }

  .pack-loops-scroll-wrap {
    height: auto !important;
    min-height: 160px;
    max-height: 340px;
  }

  #packLoopsGrid .loop-card {
    min-height: 42px;
    max-height: 60px;
  }

  #packLoopsGrid .loop-card .loop-waveform,
  #packLoopsGrid .loop-card .loop-meta {
    display: none !important;
  }
}

/* Packs filter bar — hérite de .loops-filter-bar dans filters.css */

/* .all-packs-view → shared.css */

.all-packs-view .packs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* All Packs Page Grid - Seulement pour la page "All Packs" */
#all-packs-content .packs-grid,
#allPacksGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  width: 100%;
  padding-bottom: 8px;
}

#allPacksPagination {
  margin-top: 16px;
}

/* Grid générique pour les autres vues (créateurs, etc.) */
.packs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  width: 100%;
}

/* Quick Access specific styles */
#quick-access-packs .packs-grid {
  margin-top: 24px;
}

/* ========== SINGLE / LOOP VIEW ========== */
.single-view {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.single-view-header {
  margin-bottom: 8px;
  padding-bottom: 0;
  border-bottom: none;
}

.single-view-content {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.single-loop-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  min-width: 0;
}

.single-loop-stack .loop-card {
  width: 100%;
  max-width: none;
}

/* Loop principal : pas de divider en bas (la section Suggested reprend la liste) */
#singleLoopGrid .loop-card {
  border-bottom: none;
  padding-bottom: 0;
}

/* Covers visibles (style Sounds, pas le mode compact pack) */
.single-loop-stack .loop-card .pack-cover-small {
  display: flex;
  width: var(--lc-cover, 38px);
  min-width: var(--lc-cover, 38px);
  height: var(--lc-cover, 38px);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  border-radius: 4px;
}

.single-loop-stack .loop-card .pack-cover-small img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.single-loop-stack .loop-card .pack-cover-small .pack-placeholder {
  display: flex;
  width: 100%;
  height: 100%;
}

.single-loop-stack .loop-card .pack-cover-small .play-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  box-shadow: none;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.15s ease;
  transform: none;
  pointer-events: none;
  border-radius: 4px;
}

.single-loop-stack .loop-card .pack-cover-small:hover .play-container,
.single-loop-stack .loop-card .pack-cover-small .play-container:has(input:checked) {
  opacity: 1;
  pointer-events: auto;
}

.single-suggested-section {
  margin-top: 20px;
  padding-top: 0;
  border-top: none;
}

.single-suggested-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 0 0 4px 0;
}

/* Pas de double ligne entre le titre Suggested et la 1re carte */
#singleSuggestedGrid .loop-card:first-child {
  border-top: none;
}