/* ========================================
   SHARED - Composants partagés
   Reset, Scrollbar, Dashboard, Content, Badges, pagination, animations, boutons
   ======================================== */

/* ========== RESET & BASE ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Satoshi', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-width: 600px;
  min-height: 600px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ========================================
   SECTION LAYOUT — Commun à toutes les pages
   Calqué sur le style Browse v4 (référence officielle)
   ======================================== */

.page-section {
  margin-bottom: var(--section-gap);
}

.page-section-header {
  display: flex;
  align-items: flex-end;
  gap: var(--section-header-gap);
  margin-bottom: var(--section-header-mb);
}

.page-section-title {
  font-size: var(--section-title-size);
  font-weight: var(--section-title-weight);
  letter-spacing: var(--section-title-tracking);
  line-height: 1;
  text-transform: uppercase;
  color: var(--text-primary);
  font-family: 'Satoshi', -apple-system, 'Helvetica Neue', sans-serif;
}

.page-section-sub {
  font-size: var(--section-sub-size);
  font-weight: 400;
  letter-spacing: var(--section-sub-tracking);
  text-transform: uppercase;
  color: var(--text-primary);
  padding-bottom: 6px;
  line-height: 1;
  flex-shrink: 0;
}

/* Carrousel horizontal — cards packs/playlists */
.cards-row {
  display: flex;
  gap: var(--card-gap);
  overflow-x: auto;
  padding-bottom: 4px;
}

/* Liste de loops avec séparateurs */
.loops-list {
  border-top: 0.5px solid var(--border-subtle);
}

.loop-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 0.5px solid var(--border-subtle);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.loop-item:hover {
  background: var(--hover-overlay);
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
}

/* Miniature loop / pack */
.item-thumb {
  width: var(--card-size);
  height: var(--card-size);
  border-radius: var(--card-radius);
  flex-shrink: 0;
  overflow: hidden;
}

.item-thumb--sm {
  width: 38px;
  height: 38px;
  border-radius: var(--card-thumb-radius);
}

/* Stat BPM / KEY / SCALE */
.item-stats {
  display: flex;
  gap: 14px;
  flex-shrink: 0;
}

.item-stat {
  text-align: center;
  min-width: 28px;
}

.item-stat-value {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-primary);
  display: block;
}

.item-stat-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Bouton icône rond */
.icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--text-faint);
  transition: color 0.15s ease;
}

.icon-btn:hover {
  color: var(--text-primary);
}

.icon-btn.liked {
  color: var(--like-color);
}

/* ========== BROWSE HOME — Titres géants derrière le contenu ========== */
.browse-hero {
  /* Alias : le reste du CSS peut continuer à utiliser --browse-* */
  --browse-pad-x: var(--page-hero-pad-x);
  --browse-title-nudge: var(--page-hero-title-nudge);
  --browse-title-optical-shift: var(--page-hero-title-optical-shift);
  position: relative;
  overflow: visible;
}

.browse-hero-title,
button.browse-hero-title {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  padding-left: calc(var(--browse-pad-x) + var(--browse-title-nudge) - var(--browse-title-optical-shift));
  padding-right: var(--browse-pad-x);
  box-sizing: border-box;
  font-family: 'Satoshi-Regular', 'Satoshi', sans-serif;
  font-weight: 400;
  font-synthesis: none;
  font-size: var(--page-hero-title-font-size);
  line-height: 0.82;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  text-align: left;
  color: var(--page-hero-display-color);
  background: none;
  border: none;
  cursor: default;
  user-select: none;
}

.browse-hero-title:not(button),
p.browse-hero-title {
  pointer-events: none;
}

button.browse-hero-title {
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
}

button.browse-hero-title:hover {
  opacity: 0.88;
}

.browse-hero-body {
  position: relative;
  z-index: 1;
  margin-top: var(--page-hero-body-margin-top);
  background-color: var(--bg-primary);
}

.browse-hero-body .packs-carousel,
.browse-hero-body .playlists-carousel,
.browse-hero-body .featured-loops-list-wrap {
  background-color: var(--bg-primary);
}

.browse-hero-body .packs-carousel .pack-card {
  background-color: var(--bg-primary);
}

/* Pages dans .content : le padding horizontal vient déjà de .content — aligner titres / corps avec Sounds */
#all-loops-content .browse-hero-body,
#all-packs-content .browse-hero-body,
#all-playlists-content .browse-hero-body,
#all-creators-content .browse-hero-body,
#liked-content .browse-hero-body,
#downloaded-content .browse-hero-body {
  padding-left: 0;
  padding-right: 0;
  box-sizing: border-box;
}

#all-loops-content .browse-hero-title,
#all-packs-content .browse-hero-title,
#all-playlists-content .browse-hero-title,
#all-creators-content .browse-hero-title,
#settings .browse-hero-title,
#account .browse-hero-title,
#plugins-content .browse-hero-title,
#liked-content .browse-hero-title,
#downloaded-content .browse-hero-title {
  padding-left: 0;
  padding-right: 0;
}

#all-loops-content .browse-section-header,
#all-packs-content .browse-section-header,
#all-playlists-content .browse-section-header,
#all-creators-content .browse-section-header {
  padding-left: 0;
  padding-right: 0;
}

/* Settings / Account : espace sous le gros titre avant les cartes */
#settings .browse-hero,
#account .browse-hero,
#plugins-content .browse-hero {
  margin-bottom: clamp(24px, 3.5vw, 40px);
}

/* ========== LIKED & DOWNLOADS — même colonne que Sounds (hero + corps) ========== */
.library-block {
  margin-bottom: 0;
}

.library-block--divider {
  margin-top: clamp(28px, 4vw, 40px);
  padding-top: clamp(24px, 3.5vw, 32px);
  border-top: 0.5px solid var(--border-subtle);
}

.library-block__title {
  font-family: 'Satoshi-Regular', 'Satoshi', sans-serif;
  font-size: var(--page-section-sub-font-size, 14px);
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 8px;
  color: var(--text-primary);
  line-height: 1.2;
}

.library-block__meta {
  margin: 0 0 16px;
  font-size: var(--font-size-base, 12px);
  color: var(--text-muted);
}

/* Pas de traits gris quand la section est vide (empty state visible, JS: display ≠ none) */
#downloaded-content .library-block:has(#downloadedLoopsGrid:empty) #downloadedLoopsGrid {
  border-top: none;
}

#liked-content .library-block:not(.library-block--divider):has(#likedLoopsEmpty:not([style*="display: none"])) #likedLoopsGrid {
  border-top: none;
}

#liked-content .browse-hero-body:has(#likedLoopsEmpty:not([style*="display: none"])):has(#likedPacksEmpty:not([style*="display: none"])) .library-block--divider {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.liked-packs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  padding: 0;
}

.library-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 0 8px;
  margin-top: 4px;
}

.library-pagination__info {
  color: var(--text-primary);
  font-weight: 500;
  font-size: var(--font-size-md, 14px);
}

.browse-hero-for-you-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.browse-hero-for-you-head .browse-hero-title {
  flex: 1;
  min-width: 0;
}

/* Browse · en-têtes type maquette (titre géant + sous-label uppercase) */
.browse-section-header {
  display: flex;
  align-items: flex-end;
  gap: var(--page-section-header-gap);
  margin-bottom: var(--page-section-header-margin-bottom);
  padding-left: calc(var(--browse-pad-x) + var(--browse-title-nudge) - var(--browse-title-optical-shift));
  padding-right: var(--browse-pad-x);
  box-sizing: border-box;
}

.browse-section-header .browse-hero-title,
.browse-section-header button.browse-hero-title {
  width: auto;
  flex: 0 1 auto;
  min-width: 0;
  padding-left: 0;
  padding-right: 0;
  margin: 0;
}

.browse-section-sub {
  font-family: 'Satoshi-Regular', 'Satoshi', sans-serif;
  font-weight: 400;
  font-synthesis: none;
  font-size: var(--page-section-sub-font-size);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--page-hero-sub-color);
  padding-bottom: var(--page-section-sub-pad-bottom);
  flex-shrink: 0;
  line-height: 1;
  user-select: none;
}

/* Browse (mode clair) : texte #282828 — éviter conflit auto-dark sans data-theme */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .content.browse-active #loops-content {
    --text-primary: #282828;
    --text-secondary: rgba(40, 40, 40, 0.32);
    --text-tertiary: rgba(40, 40, 40, 0.27);
  }
}
[data-theme="light"] .content.browse-active #loops-content {
  --text-primary: #282828;
  --text-secondary: rgba(40, 40, 40, 0.32);
  --text-tertiary: rgba(40, 40, 40, 0.27);
}

/* Éliminer l'outline orange du navigateur sur tous les boutons et inputs */
button:focus,
input:focus,
select:focus,
textarea:focus,
[role="button"]:focus {
  outline: none;
}

/* ========== CUSTOM SCROLLBAR ========== */
/* Scrollbar complètement transparente et invisible */
::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* Désactiver la scrollbar horizontale globalement */
body, html {
  overflow-x: hidden;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: transparent;
}

/* Permettre le scroll sans scrollbar visible */
* {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE et Edge */
}

/* ========== DASHBOARD LAYOUT ========== */
#dashboard {
  display: flex;
  height: 100vh;
  overflow: hidden;
  overflow-x: hidden;
}

/* Side panel styles imported from sidepanel.css */

/* ========== CONTENT AREA ========== */
.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-primary);
  padding: 32px clamp(20px, 5vw, 50px) 32px clamp(10px, 2.5vw, 28px); /* right > left intentionnel (compense sidepanel) */
  padding-bottom: 32px;
  min-height: 0;
  width: 0; /* Force flex to calculate width correctly */
  transition: padding-bottom 0.2s ease, background-color 0.3s ease;
}

/* ✅ Browse : réserve sous le scroll (main) pour le loop-bottom-header */
.content.browse-active,
.content:has(#loops-content.active),
.content:has(#loops-content[style*="display: flex"]) {
  padding-bottom: var(--browse-content-pad-bottom) !important;
}

/* Audio hors browse : sinon la règle suivante à plus haute spécificité gère Browse */
body.audio-playing .content {
  padding-bottom: 180px !important;
}

/* Browse + audio : body.audio-playing .content (180px) battait .content.browse-active — forcer la réserve Browse */
body.audio-playing .content.browse-active,
body.audio-playing .content:has(#loops-content.active),
body.audio-playing .content:has(#loops-content[style*="display: flex"]) {
  padding-bottom: var(--browse-content-pad-bottom) !important;
}

/* player.css : 140px sur #loops-content en plus de .content → doublon ; un seul coussin sur .content */
body.audio-playing .content.browse-active #loops-content,
body.audio-playing .content:has(#loops-content.active) #loops-content,
body.audio-playing .content:has(#loops-content[style*="display: flex"]) #loops-content {
  padding-bottom: 0 !important;
}

/* ========== BUTTONS ========== */
.btn {
  padding: 10px 20px;
  border: 2px solid #000;
  background: transparent;
  color: #000;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Satoshi', 'Plus Jakarta Sans', sans-serif;
  outline: none;
}

.btn:hover {
  background: #000;
  color: #FFF;
}

.btn:focus {
  outline: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========== TOAST NOTIFICATIONS ========== */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #000;
  color: white;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 9999;
  animation: slideIn 0.3s ease;
}

.toast.success {
  background: #4CAF50;
}

.toast.error {
  background: #ff4444;
}

.toast.info {
  background: #3d3d3d;
  color: #fff;
}


/* ========== SECTION TITLE BUTTON ========== */
.section-title-btn {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: 'Satoshi', 'Plus Jakarta Sans', sans-serif;
  position: relative;
  transition: all 0.3s ease;
}

.section-title-btn span {
  font-size: 18px;
  font-weight: 600;
  color: #000;
  transition: color 0.3s ease;
  display: inline-block;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
}

/* Dark mode pour section title */
[data-theme="dark"] .section-title-btn span {
  color: var(--text-primary);
}

.section-title-btn:hover span {
  color: #666;
  border-bottom-color: #000;
}

/* Dark mode pour section title hover */
[data-theme="dark"] .section-title-btn:hover span {
  color: var(--text-secondary);
  border-bottom-color: var(--text-primary);
}

/* ========== BADGES ========== */
.loop-badge {
  position: absolute;
  top: 8px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  z-index: 10;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.loop-badge.free {
  left: 80px;
  background: rgba(76, 175, 80, 0.15);
  color: #2E7D32;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.loop-badge.premium {
  left: 80px;
  background: rgba(149, 106, 250, 0.15);
  color: #6B46C1;
  border: 1px solid rgba(149, 106, 250, 0.3);
}

.loop-badge.liked {
  right: 8px;
  background: rgba(255, 83, 83, 0.15);
  color: #D32F2F;
  border: 1px solid rgba(255, 83, 83, 0.3);
}

.loop-badge.hot,
.loop-badge.popular,
.loop-badge.recent,
.loop-badge.random {
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  animation: slide-in-top 0.3s ease;
}

.pack-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.pack-badge.free {
  background: #00C896;
}

.pack-badge.premium {
  background: #FF6B35;
}

.license-badge {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.license-badge.royalty-free {
  background: rgba(76, 175, 80, 0.15);
  color: #2e7d32;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.license-badge.premium {
  background: rgba(255, 193, 7, 0.15);
  color: #f57c00;
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.license-badge.collab {
  background: rgba(156, 39, 176, 0.15);
  color: #7b1fa2;
  border: 1px solid rgba(156, 39, 176, 0.3);
}

/* ========== LOOP NAV BUTTONS ========== */
.loop-play-btn {
  background: #000;
  color: #FFF;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  flex-shrink: 0;
  outline: none;
}

.loop-play-btn:hover {
  background: #333;
}

.loop-play-btn:focus {
  outline: none;
}

.loop-play-btn svg {
  width: 20px;
  height: 20px;
}

.loop-nav-btn {
  padding: 10px 16px;
  border: 2px solid #000;
  background: #FFF;
  color: #000;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Satoshi', 'Plus Jakarta Sans', sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
  outline: none;
}

.loop-nav-btn:hover {
  background: #000;
  color: #FFF;
  transform: translateY(-2px);
}

.loop-nav-btn:focus {
  outline: none;
}

.loop-nav-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ========== PAGINATION ========== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
  margin: 24px 0 10px;
  flex-wrap: wrap;
}

.pagination-btn {
  padding: 0 6px;
  min-width: 2.125rem;
  height: 2.125rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Satoshi', 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--fg-hint);
  transition: color 0.15s ease, background 0.15s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.pagination-btn:first-of-type,
.pagination-btn:last-of-type {
  min-width: 2.375rem;
  font-size: 13px;
  font-weight: 400;
  color: var(--fg-rest);
}

.pagination-btn:hover:not(:disabled):not(.active) {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.pagination-btn:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

.pagination-btn:focus:not(:focus-visible) {
  outline: none;
}

.pagination-btn.active {
  background: transparent;
  color: var(--text-primary);
  font-weight: 700;
}

.pagination-btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.pagination-ellipsis {
  padding: 0 6px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--fg-whisper);
  user-select: none;
}

.pagination-info {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-top: 10px;
  transition: color 0.2s ease;
  width: 100%;
}

/* État loading — désactiver les clics pendant le fetch */
.pagination-loading {
  pointer-events: none;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

#paginationContainer {
  margin-bottom: 0;
  padding-bottom: 80px;
}

/* ========== CARD BASE (playlist-card) ========== */
.playlist-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease, border-color 0.3s ease;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .playlist-card {
  background: var(--bg-secondary);
  border-color: var(--border-color-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.playlist-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* ========== CAROUSEL HORIZONTAL BASE ========== */
.packs-carousel,
.playlists-carousel,
.creators-carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-behavior: auto;
}

.packs-carousel::-webkit-scrollbar,
.playlists-carousel::-webkit-scrollbar,
.creators-carousel::-webkit-scrollbar {
  height: 6px;
}

.packs-carousel::-webkit-scrollbar-track,
.playlists-carousel::-webkit-scrollbar-track,
.creators-carousel::-webkit-scrollbar-track {
  background: transparent;
  margin: 0 clamp(20px, 5vw, 50px);
}

.packs-carousel::-webkit-scrollbar-thumb,
.playlists-carousel::-webkit-scrollbar-thumb,
.creators-carousel::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}

/* Désactiver transitions + hover pendant le scroll */
.packs-carousel.scrolling *,
.playlists-carousel.scrolling *,
.creators-carousel.scrolling * {
  transition: none !important;
  pointer-events: none;
}

/* ========== PAGE VIEW BASE ========== */
.playlist-view,
.playlists-view,
.creator-view,
.all-packs-view {
  animation: fadeIn 0.3s ease;
  padding-bottom: 100px;
}

/* ========== SECTION BLEED (marges négatives pour déborder du padding .content) ========== */
.playlists-section,
.creators-section,
.browse-creators-section,
.featured-loops-section,
.featured-packs-section,
.featured-browse-section,
.for-you-section {
  margin-left: calc(-1 * clamp(20px, 5vw, 50px));
  margin-right: calc(-1 * clamp(20px, 5vw, 50px));
  overflow: visible;
}

/* ========== ANIMATIONS ========== */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.2); }
  50% { transform: scale(1.1); }
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes dash {
  0% {
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 80, 200;
    stroke-dashoffset: -35;
  }
  100% {
    stroke-dasharray: 80, 200;
    stroke-dashoffset: -124;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slide-in-top {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Amélioration GPU rendering */
@media (prefers-reduced-motion: no-preference) {
  .Btn .spinner svg,
  .loop-card .Btn .spinner svg {
    transform: translateZ(0);
    backface-visibility: hidden;
  }
}


/* ========== LC TOOLTIP — shared popup for loop card elements ========== */

.lc-tooltip-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lc-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 11px;
  font-family: 'Satoshi', 'Plus Jakarta Sans', sans-serif;
  font-weight: 500;
  letter-spacing: 0.2px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10), 0 1px 3px rgba(0, 0, 0, 0.07);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  z-index: 200;
}

[data-theme="dark"] .lc-tooltip {
  background: rgba(35, 35, 40, 0.95);
  color: #f0f0f0;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Show on hover — both button wrappers and meta-item direct children */
.lc-tooltip-trigger:hover .lc-tooltip,
.loop-card .loop-meta .meta-item:hover .lc-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Suppress while a download is in progress */
.loop-card .Btn.downloading + .lc-tooltip {
  opacity: 0 !important;
  pointer-events: none;
}

/* ========== CONFIRM MODAL (template layout) ========== */
.sconf-modal {
  width: min(380px, 92vw);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-primary);
  border: 0.5px solid var(--border-soft);
  box-shadow: 0 24px 60px rgba(0,0,0,.12);
}
[data-theme="dark"] .sconf-modal {
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}

.sconf-top {
  padding: 28px 28px 0;
}

.sconf-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  flex-shrink: 0;
}
.sconf-icon svg { width: 18px; height: 18px; }
.sconf-icon--neutral { background: var(--bg-tertiary); color: var(--text-primary); }
.sconf-icon--warn    { background: #FFFBEB; color: #BA7517; }
.sconf-icon--danger  { background: #FEF2F2; color: #E24B4A; }
[data-theme="dark"] .sconf-icon--neutral { background: #323232; }
[data-theme="dark"] .sconf-icon--warn    { background: #241E10; }
[data-theme="dark"] .sconf-icon--danger  { background: #2A1A1A; }

.sconf-eyebrow {
  font-family: 'Satoshi-Regular', 'Satoshi', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-tertiary);
  margin-bottom: 7px;
}

.sconf-title {
  font-family: 'Satoshi-Regular', 'Satoshi', sans-serif;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.3px;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.sconf-body {
  font-family: 'Satoshi-Regular', 'Satoshi', sans-serif;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-tertiary);
  margin-bottom: 24px;
}

.sconf-divider {
  height: 0.5px;
  background: var(--border-soft);
  margin: 0 28px;
}

.sconf-actions {
  padding: 18px 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sconf-btn-primary {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 13px;
  font-family: 'Satoshi-Regular', 'Satoshi', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: var(--text-primary);
  color: var(--bg-primary);
  transition: opacity .15s;
}
.sconf-btn-primary:hover { opacity: .8; }
.sconf-btn-primary--danger { background: #E24B4A !important; color: #fff !important; }

.sconf-btn-secondary {
  width: 100%;
  border-radius: 8px;
  padding: 12px;
  font-family: 'Satoshi-Regular', 'Satoshi', sans-serif;
  font-size: 13px;
  cursor: pointer;
  background: transparent;
  color: var(--text-primary);
  border: 0.5px solid var(--border-soft);
  transition: opacity .15s;
}
[data-theme="dark"] .sconf-btn-secondary { border-color: rgba(255,255,255,.12); }
.sconf-btn-secondary:hover { opacity: .7; }
