@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,600;1,400&family=DM+Sans:wght@400;500;600&display=swap');

/* ── Variáveis ─────────────────────────────────────────────────── */
:root {
  --lc-accent:       #f5c542;
  --lc-accent-dark:  #c9991a;
  --lc-bg-modal:     #111118;
  --lc-border:       rgba(255,255,255,0.08);
  --lc-text:         #e8e4d9;
  --lc-text-muted:   rgba(232,228,217,0.5);
  --lc-radius:       14px;
  --lc-shadow:       0 24px 64px rgba(0,0,0,0.7);

  /* Dimensões do card gerado */
  --card-w: 900px;
  --card-h: 500px;
}

/* ================================================================
   TOOLTIP FLUTUANTE
   ================================================================ */
#lyrics-tooltip {
  position: fixed;
  z-index: 9000;
  display: none;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 0.15s ease;
}

#lyrics-tooltip.visible {
  display: block;
  pointer-events: auto;
}

#generate-image-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  background: var(--lc-accent);
  color: #111;
  border: none;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(245,197,66,0.45);
  transition: transform 0.12s, box-shadow 0.12s;
}

#generate-image-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 28px rgba(245,197,66,0.6);
}

#generate-image-btn:active {
  transform: scale(0.97);
}

/* Setinha abaixo do tooltip */
#lyrics-tooltip::after {
  content: '';
  display: block;
  width: 0;
  height: 0;
  margin: 0 auto;
  border-left:  8px solid transparent;
  border-right: 8px solid transparent;
  border-top:   8px solid var(--lc-accent);
}

#lyrics-card-modal {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

#lyrics-card-modal.open {
  visibility: visible;
  opacity: 1;
}

.lcm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.lcm-container {
  position: relative;
  z-index: 1;
  width: min(560px, 94vw);
  background: var(--lc-bg-modal);
  border: 1px solid var(--lc-border);
  border-radius: var(--lc-radius);
  box-shadow: var(--lc-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}

#lyrics-card-modal.open .lcm-container {
  transform: translateY(0) scale(1);
}

/* Cabeçalho */
.lcm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.lcm-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.lcm-close {
  background: none;
  border: none;
  color: var(--lc-text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  transition: color 0.15s, background 0.15s;
}

.lcm-close:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

/* Preview */
.lcm-preview-wrap {
  padding: 20px 24px;
}

#image-preview {
  width: 100%;
  aspect-ratio: 9/5;
  border-radius: 10px;
  overflow: hidden;
  background: #1a1a24;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}

#image-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
  display: block;
}

/* Estado de loading */
.lcm-loading {
  color: var(--lc-text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
}

.lcm-spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid rgba(255,255,255,0.1);
  border-top-color: var(--lc-accent);
  border-radius: 50%;
  animation: lcm-spin 0.7s linear infinite;
  display: block;
}

@keyframes lcm-spin {
  to { transform: rotate(360deg); }
}

/* Rodapé */
.lcm-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 24px 24px;
}

.lcm-btn-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  background: var(--lc-accent);
  color: #111;
  border: none;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s, opacity 0.15s;
}

.lcm-btn-primary:hover:not(:disabled) {
  background: #f7cf5a;
  transform: scale(1.02);
}

.lcm-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.lcm-btn-ghost {
  padding: 11px 18px;
  background: transparent;
  color: var(--lc-text-muted);
  border: 1px solid var(--lc-border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.lcm-btn-ghost:hover {
  color: var(--lc-text);
  border-color: rgba(255,255,255,0.2);
}

#lyrics-card-source {
  position: fixed;
  top: -9999px;
  left: -9999px;
  width: 1080px;
  height: 1350px;
  overflow: hidden;
  background: #000;
  font-family: 'Inter', sans-serif;
}

.lcs-bg-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: none;
  transform: scale(1.08);
}

.lcs-top-fade {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.25);
}

.lcs-bottom-gradient {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 55%;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0.75) 30%,
    rgba(0,0,0,1) 100%
  );
}

.lcs-main-text {
  position: absolute;
  left: 95px;
  right: 95px;
  bottom: 285px;
  z-index: 2;
  text-align: center;
}

.lcs-lyrics {
  margin: 0;
  color: #fff;
  font-family: 'inter', sans-serif;
  font-size: 32px;
  line-height: 1.22;
  font-weight: 900;
  text-transform: uppercase;
  white-space: pre-line;
}

.lcs-footer {
  position: absolute;
  left: 42px;
  right: 42px;
  bottom: 42px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: 'Montserrat', sans-serif;
}

.lcs-cover-thumb {
  width: 92px;
  height: 92px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.lcs-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1;
}

.lcs-title {
  color: #fff;
  font-size: 27px;
  line-height: 1.1;
  font-weight: 900;
  text-transform: uppercase;
}

.lcs-artist {
  color: rgba(255,255,255,0.78);
  font-size: 24px;
  line-height: 1.15;
  font-weight: 600;
}

.lcs-site-tag {
  color: #ff1b2d;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* ================================================================
   HIGHLIGHT NA LETRA AO PASSAR O MOUSE
   Estilo de seleção personalizado dentro de #lyrics
   ================================================================ */
#lyrics ::selection {
  background: rgba(245, 197, 66, 0.28);
  color: inherit;
}


#start-lyrics-card-btn {
  margin: 12px 0 20px;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background: #d6001c;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

#start-lyrics-card-btn.active {
  background: #f5c542;
  color: #111;
}