:root {
  --bg-main: #000000;
  --bg-surface: #121212;
  --bg-card: #181818;
  --primary: #22c55e;
  --primary-color: #22c55e; /* Compatibilidade com index.html */
  --primary-hover: #1ed760;
  --text-main: #ffffff;
  --text-muted: #b3b3b3;
  --border: #282828;
  --nav-height: 80px; /* Aumentado para acomodar logo maior */
  --chord-red: #ff3b3b;
  --bg-chords: #0f0f0f;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }

/* --- NAVBAR PROFISSIONAL --- */
.global-nav {
  height: var(--nav-height);
  padding: 0 24px;
  background-color: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--border);
  z-index: 1000;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
}

.logo-img {
  height: 60px; /* Aumentado de 48px */
  object-fit: contain;
  transition: transform 0.3s ease;
}

.logo-img:hover {
  transform: scale(1.05);
}

.nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
  padding: 8px 12px;
  border-radius: 4px;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text-main);
  background: rgba(255,255,255,0.05);
}

.btn-logout {
  color: #ff4757 !important;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 71, 87, 0.3);
  padding: 6px 15px !important;
}

.btn-logout:hover {
  background: rgba(255, 71, 87, 0.1) !important;
  border-color: #ff4757;
}

/* --- LAYOUT DO APP (SPOTIFY LIKE) --- */
.main-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* SIDEBAR ESQUERDA */
.sidebar {
  width: 320px;
  background-color: var(--bg-main);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid var(--border);
}

.sidebar-card {
  background-color: var(--bg-card);
  border-radius: 8px;
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-card h3 {
  font-size: 1rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
}

.track-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
}

.track-item {
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
  transition: background 0.2s;
}

.track-item:hover { background: rgba(255,255,255,0.1); }
.track-item.active { background: rgba(34, 197, 94, 0.1); color: var(--primary); }

.track-item-info { flex: 1; min-width: 0; }
.track-item-name { font-size: 0.9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.track-item-sub { font-size: 0.75rem; color: var(--text-muted); }

/* ÁREA CENTRAL */
.content-area {
  flex: 1;
  background: linear-gradient(to bottom, #1e3a2f, var(--bg-main) 400px);
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  text-align: center;
}

.now-playing-visual {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.album-art {
  width: 280px;
  height: 280px;
  background: #111;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #222;
  position: relative;
  overflow: hidden;
}

.album-art svg { width: 120px; height: 120px; }

.song-info { width: 100%; }
.song-title { font-size: 2rem; font-weight: 800; margin-bottom: 8px; color: #fff; }
.song-artist { font-size: 1.1rem; color: var(--text-muted); }

/* --- CONTROLES DO RODAPÉ (FIXO) --- */
.player-footer {
  height: 100px;
  background-color: var(--bg-main);
  border-top: 1px solid var(--border);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-left { width: 30%; display: flex; align-items: center; gap: 12px; }
.footer-center { width: 40%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.footer-right { width: 30%; display: flex; justify-content: flex-end; align-items: center; gap: 16px; }

.progress-container {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.progress-bar-bg {
  flex: 1;
  height: 4px;
  background: #4d4d4d;
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: var(--text-main);
  border-radius: 2px;
  width: 0%;
  position: relative;
}

.progress-bar-bg:hover .progress-bar-fill { background: var(--primary); }

.control-btns { display: flex; align-items: center; gap: 24px; }

.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover { color: var(--text-main); transform: scale(1.05); }
.btn-icon.active { color: var(--primary); }

.btn-play-pause {
  width: 40px;
  height: 40px;
  background: #fff;
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-play-pause:hover { transform: scale(1.08); background: #f0f0f0; }

/* --- BOTÕES GERAIS --- */
.btn-primary {
  background: var(--primary);
  color: #000;
  padding: 12px 24px;
  border-radius: 50px;
  border: none;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover { background: var(--primary-hover); transform: scale(1.05); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: #fff;
  padding: 10px 20px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  text-decoration: none;
}

.btn-outline:hover { background: rgba(255,255,255,0.05); border-color: #fff; }

/* MODALS */
.modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
}

.modal-content {
  background: var(--bg-card);
  padding: 40px;
  border-radius: 12px;
  width: 100%;
  max-width: 440px;
  position: relative;
}

.close-modal {
  position: absolute; top: 16px; right: 20px;
  font-size: 1.5rem; cursor: pointer; color: #888;
}

/* INPUTS */
.input-field {
  width: 100%;
  background: #2a2a2a;
  border: 1px solid transparent;
  padding: 14px;
  border-radius: 4px;
  color: #fff;
  font-size: 1rem;
  margin-bottom: 20px;
}

.input-field:focus { outline: none; border-color: var(--primary); }

/* CUSTOM SCROLLBAR */
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #555; border-radius: 6px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #888; border: 3px solid transparent; background-clip: content-box; }



/* --- AI TRANSCRIPTION & CHORDS --- */
.ai-screen {
  flex: 1;
  display: flex;
  overflow: hidden;
  height: calc(100vh - var(--nav-height));
}

.ai-main-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.saved-chords-sidebar {
  width: 280px;
  background: var(--bg-main);
  border-right: 1px solid var(--border);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.chords-list {
  list-style: none;
  overflow-y: auto;
}

.chord-item {
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 8px;
  background: var(--bg-card);
  transition: 0.2s;
  border: 1px solid transparent;
}

.chord-item:hover { border-color: var(--primary); background: rgba(34, 197, 94, 0.05); }

.cifra-viewer {
  background: var(--bg-chords);
  padding: 32px;
  border-radius: 12px;
  border: 1px solid var(--border);
  min-height: 400px;
  text-align: left;
  overflow-x: auto;
}

.cifra-viewer .line {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 12px;
  min-height: 1.2em;
}

.bloco {
  display: inline-flex;
  flex-direction: column;
  vertical-align: bottom;
  font-family: 'Courier New', Courier, monospace;
}

.acorde {
  color: var(--chord-red);
  font-weight: 800;
  font-size: 1.1rem;
  height: 1.25em;
  white-space: pre;
}

.letra {
  color: #ffffff;
  font-size: 1.1rem;
  white-space: pre;
  min-height: 1em;
}

/* Identifica cabeçalhos como [Verso] */
.section-header {
  color: var(--primary);
  font-weight: bold;
  margin: 20px 0 10px 0;
  width: 100%;
}

/* Cifra viewer — linhas paralelas monospace */
.chord-row {
  font-family: 'Courier New', monospace;
  color: #22c55e;
  font-weight: 700;
  white-space: pre;
  line-height: 1.4;
  font-size: 0.88rem;
}
.lyric-row {
  font-family: 'Courier New', monospace;
  color: #e0e0e0;
  white-space: pre;
  line-height: 1.6;
  margin-bottom: 2px;
  font-size: 0.9rem;
}

.chord-highlight {
  color: var(--chord-red);
  font-weight: 800;
  background: rgba(255, 59, 59, 0.05); /* Sutil */
  padding: 2px 4px;
  border-radius: 4px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: 0.2s;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.chords-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  padding: 8px 16px;
  border-radius: 50px;
  border: 1px solid var(--border);
}

.btn-small {
  background: #2a2a2a;
  border: 1px solid #444;
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.btn-small:hover {
  background: #333;
  border-color: var(--primary);
  color: var(--primary);
}

#btn-transpose-up, #btn-transpose-down {
  border-color: var(--primary);
  color: var(--primary);
}

.tone-control {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1a1a1a;
  padding: 5px 15px;
  border-radius: 50px;
  border: 1px solid #333;
}

.tone-input {
  width: 45px;
  background: transparent;
  border: none;
  color: var(--primary);
  font-weight: 800;
  text-align: center;
  font-size: 1.1rem;
  outline: none;
}

/* Novo Estilo Botão PDF */
#btn-download {
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  color: #000 !important;
  border: none !important;
  border-radius: 50px !important;
  padding: 8px 20px !important;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.2);
}

#btn-download:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

#chord-editor {
  width: 100%;
  height: 500px;
  background: #0a0a0a;
  color: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1rem;
  resize: vertical;
  outline: none;
}

#chord-editor:focus { border-color: var(--primary); }

.ai-container {
  background: var(--bg-card);
  padding: 32px;
  border-radius: 16px;
  border: 1px solid var(--border);
  text-align: center;
}

.loader {
  border: 3px solid rgba(255,255,255,0.1);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 12px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .saved-chords-sidebar { 
    position: fixed; 
    left: 0; top: var(--nav-height); 
    width: 250px; height: calc(100% - var(--nav-height));
    z-index: 1500;
  }
  .saved-chords-sidebar.hidden-mobile { display: none; }
  
  .mobile-only { display: block !important; }
  .hidden-mobile { display: none; }

  .footer-left { display: none; }
  .footer-right { display: none; }
  .footer-center { width: 100%; }

  .bloco {
    margin-right: 1px;
  }
  .acorde, .letra {
    font-size: 1rem;
  }
}

/* --- LANDING PAGE STYLES (RESTAURADOS) --- */
.landing-body {
  background: var(--bg-main);
  background-image: radial-gradient(circle at top left, rgba(34, 197, 94, 0.15), transparent 40%),
                    radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.1), transparent 40%);
  height: auto !important; /* Permitir crescer para scroll */
  overflow-y: auto !important; /* Habilitar scroll na landing */
}

.landing-nav {
  height: var(--nav-height);
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(12px);
  z-index: 1500; /* Acima de tudo mas abaixo do modal */
}

.hero {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 60px;
  padding: 60px 40px;
  text-align: left;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-content {
  flex: 1;
}

.hero h1 {
  font-size: 4rem;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 24px;
  color: #fff;
}

.hero .highlight {
  color: var(--primary);
}

.hero-image {
  flex: 1;
  display: flex;
  justify-content: center;
}

.features {
  padding: 100px 40px;
  text-align: center;
  background: #050505;
}

.features h2 {
  font-size: 2.5rem;
  margin-bottom: 50px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.feature-card {
  background: var(--bg-card);
  padding: 40px;
  border-radius: 20px;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.feature-card:hover { transform: translateY(-10px); border-color: var(--primary); }
.feature-card h3 { color: var(--primary); margin-bottom: 15px; }

.pricing-section {
  padding: 100px 40px;
  text-align: center;
}

.pricing-grid {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 50px;
  flex-wrap: wrap; /* Importante para mobile */
}

.pricing-card {
  background: var(--bg-card);
  padding: 40px;
  border-radius: 24px;
  border: 1px solid var(--border);
  width: 100%;
  max-width: 380px;
  position: relative;
  transition: all 0.3s ease;
}

.card-pro {
  border: 2px solid var(--primary);
  box-shadow: 0 10px 40px rgba(34, 197, 94, 0.1);
}

.pro-badge {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #000;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.75rem;
}

.price {
  font-size: 2.5rem;
  font-weight: 900;
  margin: 20px 0;
}

.features-list {
  list-style: none;
  text-align: left;
  margin-bottom: 30px;
}

.features-list li {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.landing-footer {
  padding: 40px;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}

@media (max-width: 1024px) {
  .hero {
    flex-direction: column;
    text-align: center;
    gap: 40px;
    padding-top: 100px;
  }
  .hero h1 { font-size: 3rem; }
  .hero-image { order: -1; } /* Imagem no topo no tablet/mobile */
}

@media (max-width: 768px) {
  .landing-nav { padding: 0 20px; }
  .logo-img { height: 50px; }
  .nav-links a { font-size: 0.8rem; padding: 4px 8px; }
  .nav-links { gap: 10px; }

  .hero h1 { font-size: 2.2rem; }
  .logo-img-hero { max-width: 280px; }
  
  .feature-grid { grid-template-columns: 1fr; }
  .pricing-card { max-width: 100%; }
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
  100% { transform: translateY(0px); }
}

.logo-img-hero {
  max-width: 400px;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0px 0px 30px rgba(34, 197, 94, 0.4));
  animation: float 6s ease-in-out infinite;
}

/* ═══════════════════════════════════════════
   CIFRA VIEWER — acordes acima da letra
═══════════════════════════════════════════ */
.cifra-viewer {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.95rem;
  line-height: 1.2;
  white-space: pre-wrap;
  overflow-x: auto;
}
/* Linha com bloco acorde+letra */
.cifra-line {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  margin-bottom: 4px;
  overflow-x: auto;
}
/* Bloco individual: acorde em cima, sílaba embaixo */
.cifra-block {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  white-space: pre;
}
.cifra-chord {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.4;
  min-height: 1.2em;
  white-space: pre;
}
.cifra-lyric {
  color: #e0e0e0;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre;
}
/* Cabeçalho de seção */
.section-header {
  display: block;
  color: #c0392b;
  font-weight: 700;
  font-size: 0.88rem;
  margin: 14px 0 5px;
  font-style: normal;
}
/* Linha só de acordes (sem letra associada) */
.cifra-chord-only {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 2px;
  white-space: pre;
}
/* Linha só de letra (sem acorde) */
.cifra-lyric-only {
  color: #e0e0e0;
  font-size: 0.95rem;
  margin-bottom: 4px;
  white-space: pre-wrap;
}


.mob-only { display: none !important; }
.desk-only { display: block; }

@media (max-width: 768px) {
  .mob-only { display: block !important; }
  .desk-only { display: none !important; }

  /* Compensar bottom nav fixa */
  .mob-pad-bottom { padding-bottom: 70px; }

  /* FAB — Floating Action Button */
  .mob-fab {
    position: fixed; bottom: 74px; right: 16px;
    width: 52px; height: 52px; border-radius: 50%;
    background: #22c55e; color: #000; border: none;
    font-size: 1.4rem; cursor: pointer;
    box-shadow: 0 4px 16px rgba(34,197,94,0.4);
    display: flex; align-items: center; justify-content: center;
    z-index: 90; -webkit-tap-highlight-color: transparent;
  }

  /* Global nav links — esconder em mobile */
  .global-nav .nav-links a:not(.btn-logout) { display: none; }
  .global-nav .nav-links .btn-logout { font-size: 0.82rem; padding: 5px 10px; }
  .global-nav { padding: 0 14px; }
  .logo-img { height: 30px !important; }
}
