/* ============================================================
   Cifras WP — Favorites CSS v3.0
   ============================================================ */

/* ── Botão Favoritar na cifra ─────────────────────────────── */
.cifra-fav-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border: 1.5px solid var(--c-border);
  border-radius: 99px;
  background: var(--c-card);
  color: var(--c-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s var(--c-ease);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.cifra-fav-btn svg { flex-shrink: 0; transition: transform .3s var(--c-bounce), fill .2s; }

/* ── Estado normal: hover ─────────────────────────────────── */
.cifra-fav-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: #fff5f5;
}
.cifra-fav-btn:hover svg { transform: scale(1.15); }

/* ── Estado: favoritado ───────────────────────────────────── */
.cifra-fav-btn.is-fav {
  border-color: #ef4444;
  background: #fef2f2;
  color: #ef4444;
  font-weight: 700;
}
.cifra-fav-btn.is-fav svg {
  fill: #ef4444;
  stroke: #ef4444;
}

/* Label normal e label de hover — controladas pelo JS via data-attr */
.cifra-fav-btn .fav-label-default { display: inline; }
.cifra-fav-btn .fav-label-hover   { display: none; }

/* Quando favoritado e hover: mostra "Desfavoritar" */
.cifra-fav-btn.is-fav:hover {
  border-color: #dc2626;
  background: #fef2f2;
  color: #dc2626;
}
.cifra-fav-btn.is-fav:hover svg {
  fill: none;
  stroke: #dc2626;
  transform: scale(1.1);
}
.cifra-fav-btn.is-fav:hover .fav-label-default { display: none; }
.cifra-fav-btn.is-fav:hover .fav-label-hover   { display: inline; }

/* Animação ao favoritar */
@keyframes fav-pulse {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.4); }
  65%  { transform: scale(.9); }
  100% { transform: scale(1.05); }
}
.cifra-fav-btn.just-faved svg { animation: fav-pulse .4s var(--c-bounce); }

/* Área de ações abaixo do header */
.cifra-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--c-border-lt);
}

/* Toast */
.cifras-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 99999;
  background: var(--c-text);
  color: #fff;
  padding: 10px 20px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
  opacity: 0;
  transition: opacity .2s, transform .25s var(--c-bounce);
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  white-space: nowrap;
}
.cifras-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.cifras-toast.is-error   { background: #ef4444; }
.cifras-toast.is-success { background: #059669; }

/* ════════════════════════════════════════════════════════════
   PÁGINA [cifras_favoritos]
   ════════════════════════════════════════════════════════════ */
.cifras-favs-page {
  max-width: 100%;
  margin: 0;
  padding: 0 0 80px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Header ─────────────────────────────────────────────── */
.cifras-favs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1.5px solid var(--c-border);
}
.cifras-favs-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  color: var(--c-text);
  margin: 0;
}
.cifras-favs-count {
  background: var(--c-primary-lt);
  color: var(--c-primary);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
}

/* ── Barra de busca ─────────────────────────────────────── */
.cifras-favs-search {
  display: flex;
  align-items: center;
  background: var(--c-card);
  border: 1.5px solid var(--c-border);
  border-radius: 99px;
  overflow: hidden;
  width: 100%;
  max-width: 300px;
  transition: border-color .15s, box-shadow .15s;
}
.cifras-favs-search:focus-within {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-lt);
}
.cifras-favs-search input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--c-text);
  outline: none;
  font-family: inherit;
}
.cifras-favs-search button {
  padding: 0 12px;
  border: none;
  background: transparent;
  color: var(--c-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
}

/* ── Container da lista — mesmo estilo do widget ─────────── */
/* ── Grid de cards ──────────────────────────────────────── */
.cifras-favlist {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 900px) {
  .cifras-favlist { grid-template-columns: repeat(2, 1fr); }
}

/* ── Card individual ─────────────────────────────────────── */
.cifras-favlist-item {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  overflow: hidden;
  transition: transform .15s var(--c-ease), box-shadow .15s var(--c-ease);
  position: relative;
  border-left: 4px solid var(--c-primary);
}
.cifras-favlist-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(124,58,237,.1);
}

/* Corpo do card */
.cifras-favlist-card-body {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  flex: 1;
  min-width: 0;
}

/* Avatar menor */
.cifras-favlist-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--c-primary-lt);
  border: 2px solid var(--c-border);
}

/* Info */
.cifras-favlist-link {
  flex: 1;
  min-width: 0;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.cifras-favlist-song {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .15s;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.3;
}
.cifras-favlist-item:hover .cifras-favlist-song { color: var(--c-primary); }

/* Linha inferior: artista + badge tom lado a lado */
.cifras-favlist-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.cifras-favlist-artist {
  font-size: 11px;
  color: var(--c-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}



/* Footer do card — ações */


/* Handle de drag */
.cifras-favlist-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  flex-shrink: 0;
  background: var(--c-border-lt);
  color: var(--c-muted);
  cursor: grab;
  transition: background .15s, color .15s;
  touch-action: none;
}
.cifras-favlist-drag-handle:hover {
  background: var(--c-primary-lt);
  color: var(--c-primary);
}
.cifras-favlist-drag-handle:active { cursor: grabbing; }

/* Estados de drag */
.cifras-favlist-item.is-dragging {
  opacity: .4;
  border-style: dashed;
}
.cifras-favlist-item.drag-over {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 2px var(--c-primary-lt);
}

/* Botão Remover */
.cifras-favlist-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--c-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: background .15s, color .15s;
  margin-right: 6px;
}
.cifras-favlist-remove:hover {
  background: #fef2f2;
  color: #ef4444;
}

/* ── Estado vazio ────────────────────────────────────────── */
.cifras-rp-empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--c-muted);
  grid-column: 1 / -1;
}
.cifras-rp-empty-state svg {
  opacity: .2;
  margin: 0 auto 16px;
  display: block;
}
.cifras-rp-empty-state h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--c-text);
  margin: 0 0 8px;
}
.cifras-rp-empty-state p {
  font-size: 14px;
  max-width: 300px;
  margin: 0 auto;
}

/* ── Loading ─────────────────────────────────────────────── */
.cifras-favs-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 24px;
  color: var(--c-muted);
  gap: 12px;
  grid-column: 1 / -1;
}
.cifras-rp-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: rp-spin .7s linear infinite;
}
@keyframes rp-spin { to { transform: rotate(360deg); } }

/* ── Responsivo ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .cifras-favs-header { flex-direction: column; align-items: flex-start; }
  .cifras-favs-search { max-width: 100%; }
  .cifras-favlist { grid-template-columns: 1fr; }
}
