/* ========== LIKE BUTTON ========== */
.loop-card .like-container {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s ease;
  position: relative;
  flex-shrink: 0;
  background: transparent;
}

.loop-card .like-container:hover {
  background: rgba(0, 0, 0, 0.05);
  transform: scale(1.1);
}

/* Dark mode pour like container hover */
[data-theme="dark"] .loop-card .like-container:hover {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .loop-card .like-container .checkmark {
  color: #999;
}

.loop-card .like-container input {
  display: none;
}

.loop-card .like-container .checkmark {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  position: relative;
  color: #666;
}

.loop-card .like-container svg {
  width: 20px;
  height: 20px;
  fill: none;
  transition: fill 0.2s ease, stroke 0.2s ease, color 0.2s ease, all 0.3s ease;
}

.loop-card .like-container svg path {
  fill: none;
  stroke: currentColor;
}

.loop-card .like-container input:checked ~ .checkmark svg {
  animation: heartBeat 0.3s ease;
}

.loop-card .like-container input:checked ~ .checkmark svg path {
  fill: #ef4444;
  stroke: #ef4444;
}

.loop-card .like-container input:checked ~ .checkmark {
  color: #ef4444;
}

/* Spinner pour le like */
.loop-card .like-container .checkmark.loading {
  cursor: wait;
  pointer-events: none;
}

.loop-card .like-container .checkmark.loading svg {
  display: none;
}

.loop-card .like-container .checkmark.loading::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(170, 170, 170, 0.3);
  border-top: 2.5px solid #AAAAAA;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ========== DOWNLOAD BUTTON (.Btn — uniquement dans .loop-card) ========== */
.loop-card .Btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.loop-card .Btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .loop-card .Btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.loop-card .Btn .svgIcon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #555;
}

.loop-card .Btn.downloaded {
  background: transparent;
  cursor: default;
}

.loop-card .Btn.downloaded .svgIcon {
  fill: none;
  stroke: #333;
}

.loop-card .Btn.cloud-download,
.loop-card .Btn.free-gift {
  background: transparent;
  cursor: pointer;
}

.loop-card .Btn.cloud-download .svgIcon,
.loop-card .Btn.free-gift .svgIcon {
  fill: none;
  stroke: #555;
}

.loop-card .Btn.cloud-download:hover .svgIcon,
.loop-card .Btn.free-gift:hover .svgIcon {
  fill: none;
  stroke: #000;
}

.loop-card .Btn.downloading {
  opacity: 1;
  cursor: wait;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.05);
}

.loop-card .Btn.downloading .svgIcon {
  display: none;
}

.loop-card .Btn .spinner {
  display: none;
  will-change: transform, opacity;
}

.loop-card .Btn.downloading .spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin: auto;
}

.loop-card .Btn .spinner svg {
  animation: rotate 1s linear infinite;
  width: 100%;
  height: 100%;
  display: block;
  will-change: transform;
}

.loop-card .Btn .spinner circle {
  stroke: #333;
  stroke-width: 4;
  fill: none;
  stroke-dasharray: 80, 200;
  stroke-dashoffset: 0;
  animation: dash 1.5s ease-in-out infinite;
  stroke-linecap: round;
  will-change: stroke-dasharray, stroke-dashoffset;
}

.loop-card .Btn.cloud-download.downloading .spinner circle,
.loop-card .Btn.free-gift.downloading .spinner circle {
  stroke: #555;
}

[data-theme="dark"] .loop-card .Btn .svgIcon,
[data-theme="dark"] .loop-card .Btn.cloud-download .svgIcon,
[data-theme="dark"] .loop-card .Btn.free-gift .svgIcon {
  stroke: #aaa;
}

[data-theme="dark"] .loop-card .Btn.cloud-download:hover .svgIcon,
[data-theme="dark"] .loop-card .Btn.free-gift:hover .svgIcon {
  stroke: #fff;
}

[data-theme="dark"] .loop-card .Btn.downloaded .svgIcon {
  stroke: #ccc;
}

[data-theme="dark"] .loop-card .Btn .spinner circle {
  stroke: #fff;
}

[data-theme="dark"] .loop-card .Btn.cloud-download.downloading .spinner circle,
[data-theme="dark"] .loop-card .Btn.free-gift.downloading .spinner circle {
  stroke: #aaa;
}

[data-theme="dark"] .loop-card .Btn.downloading {
  background: rgba(255, 255, 255, 0.08);
}


/* ========== MIDI ========== */
.midi-btn {
  background: #956afa !important;
}

.midi-btn:hover {
  background: #7b4fe0 !important;
}

.midi-btn .svgIcon {
  fill: white;
}

.midi-btn.downloaded {
  background: #4CAF50 !important;
}

/* ========== LOADING SPINNER ========== */
.spinner {
  width: 20px;
  height: 20px;
  display: inline-block;
}

.spinner svg {
  width: 100%;
  transform-origin: center;
  animation: rotate4 2s linear infinite;
}

.spinner circle {
  fill: none;
  stroke: #000;
  stroke-width: 2;
  stroke-dasharray: 1, 200;
  stroke-dashoffset: 0;
  stroke-linecap: round;
  animation: dash4 1.5s ease-in-out infinite;
}

@keyframes rotate4 {
  100% { transform: rotate(360deg); }
}

@keyframes dash4 {
  0% {
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 90, 200;
    stroke-dashoffset: -35px;
  }
  100% {
    stroke-dashoffset: -125px;
  }
}

/* ========== EMPTY STATE (Downloads, etc.) ========== */
/* Le JS met display:flex sans direction → row par défaut : empiler proprement */
.empty-state {
  box-sizing: border-box;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  width: 100%;
  max-width: 400px;
  margin: clamp(28px, 6vh, 56px) auto;
  padding: clamp(20px, 3vw, 32px) 16px;
  color: var(--text-primary, inherit);
}

.empty-state svg {
  flex-shrink: 0;
  color: var(--text-muted, #666);
  fill: currentColor;
}

.empty-state h3 {
  margin: 0;
  font-family: 'Satoshi', 'Plus Jakarta Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary, inherit);
  white-space: normal;
}

.empty-state p {
  margin: 0;
  font-size: var(--font-size-base, 13px);
  line-height: 1.5;
  color: var(--text-muted, #666);
  white-space: normal;
  max-width: 34ch;
}

.empty-state .btn {
  margin-top: 4px;
}

#downloaded-content .library-block {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* ========== LICENSE CARD MODAL ========== */

#licenseCardModal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lc-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
}
[data-theme="dark"] .lc-modal-backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
}

.lc-modal-card {
  position: relative;
  z-index: 1;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 28px 32px 32px;
  min-width: 300px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  animation: lcModalIn 0.2s ease;
  color: #fff;
}

[data-theme="light"] .lc-modal-card {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.08);
  color: #111;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15);
}

@keyframes lcModalIn {
  from { transform: translateY(10px) scale(0.97); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.lc-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: #555;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.lc-modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .lc-modal-close { color: #aaa; }
[data-theme="light"] .lc-modal-close:hover { color: #111; background: rgba(0, 0, 0, 0.05); }

.lc-modal-loop-name {
  font-size: 11px;
  font-weight: 600;
  color: #555;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-right: 24px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="light"] .lc-modal-loop-name { color: #aaa; }

.lc-modal-rows {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lc-modal-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.lc-modal-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #444;
  text-transform: uppercase;
}

[data-theme="light"] .lc-modal-label { color: #bbb; }

.lc-modal-value {
  font-size: 14px;
  font-weight: 500;
  color: #e2e2e2;
}

[data-theme="light"] .lc-modal-value { color: #111; }

.lc-modal-num {
  font-family: monospace;
  font-size: 13px;
  letter-spacing: 0.03em;
  color: #888;
}

[data-theme="light"] .lc-modal-num { color: #666; }

#licenseTypesModal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lc-license-types-card {
  max-width: 440px;
  width: 92%;
}

.lc-license-types-heading {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 18px;
  padding-right: 28px;
  color: #e8e8e8;
}

[data-theme="light"] .lc-license-types-heading {
  color: #111;
}

.lc-license-tier-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lc-license-tier-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.lc-license-tier-row.is-current {
  border-color: rgba(124, 120, 255, 0.45);
  background: rgba(124, 120, 255, 0.08);
}

[data-theme="light"] .lc-license-tier-row {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .lc-license-tier-row.is-current {
  border-color: rgba(90, 86, 220, 0.4);
  background: rgba(90, 86, 220, 0.06);
}

.lc-license-tier-letter {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.lc-license-tier-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #bdbdbd;
  text-align: left;
}

[data-theme="light"] .lc-license-tier-desc {
  color: #444;
}

[data-theme="light"] .lc-license-tier-letter {
  background: rgba(0, 0, 0, 0.06);
  color: #111;
}

/* ========== GUEST LOGIN PROMPT ========== */
#guest-login-prompt {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: glp-in .18s cubic-bezier(.16,1,.3,1) both;
}
[data-theme="dark"] #guest-login-prompt {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
@keyframes glp-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
#glp-card {
  background: var(--bg-primary, #282828);
  border: 1px solid var(--border-color, #363636);
  border-radius: 14px;
  padding: 28px 24px 24px;
  width: min(340px, 90vw);
  text-align: center;
  font-family: 'Satoshi', 'Plus Jakarta Sans', system-ui, sans-serif;
  animation: glp-card-in .22s cubic-bezier(.16,1,.3,1) both;
  box-shadow: 0 32px 80px rgba(0,0,0,.45);
}
@keyframes glp-card-in {
  from { transform: scale(.96) translateY(6px); opacity: 0; }
  to   { transform: scale(1) translateY(0);     opacity: 1; }
}
#glp-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-secondary, #2F2F2F);
  border: 1px solid var(--border-color, #363636);
  color: var(--text-secondary, #B8B8B8);
  margin-bottom: 16px;
}
#glp-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #fff);
  letter-spacing: -.01em;
}
#glp-subtitle {
  margin: 0 0 22px;
  font-size: 12px;
  color: var(--text-secondary, #B8B8B8);
  line-height: 1.6;
}
#glp-actions {
  display: flex;
  gap: 8px;
}
.glp-btn {
  flex: 1;
  padding: 9px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity .15s;
  letter-spacing: .01em;
}
.glp-btn:hover { opacity: .8; }
#glp-btn-login {
  background: transparent;
  border: 1px solid var(--border-color-dark, #3A3A3A);
  color: var(--text-primary, #fff);
}
#glp-btn-register {
  background: var(--text-primary, #fff);
  border: 1px solid transparent;
  color: var(--bg-primary, #282828);
}
#glp-dismiss {
  display: block;
  margin: 14px auto 0;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 11px;
  color: var(--text-secondary, #B8B8B8);
  cursor: pointer;
  opacity: .6;
  transition: opacity .15s;
}
#glp-dismiss:hover { opacity: 1; }
