#bpm {
  width: 120px;
  font-size: 1.2rem;
}
/* styles.css - Tema oscuro, glass, animaciones elegantes gris/negro/naranja */

body.dark-bg {
  background: linear-gradient(135deg, #232526 0%, #414345 100%);
  color: #f5f5f5;
  font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
  min-height: 100vh;
}

.glass-card, .glass-sidebar, .glass-main, .glass-right, .glass-topbar {
  background: rgba(40, 40, 45, 0.85);
  border-radius: 18px;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  transition: background 0.3s, box-shadow 0.3s;
}

.glass-card {
  max-width: 400px;
}

.glass-sidebar {
  width: 260px;
  min-width: 220px;
  margin: 16px 0 16px 16px;
}

.glass-main {
  min-width: 0;
  margin: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#song-editor-shell {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#song-editor-shell .EasyMDEContainer {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

#song-editor-shell .EasyMDEContainer .CodeMirror {
  flex: 1;
  height: 100% !important;
  min-height: 0;
}

#song-editor-shell .EasyMDEContainer .CodeMirror-scroll {
  min-height: 0 !important;
  max-height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

.cm-detected-chord {
  background: rgba(255, 152, 0, 0.18);
  border-bottom: 1px solid rgba(255, 152, 0, 0.75);
  border-radius: 3px;
  padding: 0 1px;
}

.glass-right {
  width: 320px;
  min-width: 220px;
  margin: 16px 16px 16px 0;
}

.glass-topbar {
  height: 64px;
  border-radius: 0 0 18px 18px;
  background: rgba(30, 30, 35, 0.92);
  box-shadow: 0 2px 12px 0 rgba(31, 38, 135, 0.10);
}

/* Animaciones suaves */
#app, .glass-card, .glass-sidebar, .glass-main, .glass-right, .glass-topbar {
  animation: fadeIn 0.7s cubic-bezier(0.4,0,0.2,1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Botones naranja elegante */
.btn-primary, .btn-success {
  background: linear-gradient(90deg, #ff7300 0%, #ff9800 100%);
  border: none;
  color: #fff;
  box-shadow: 0 2px 8px 0 rgba(255, 115, 0, 0.15);
  transition: background 0.2s;
}
.btn-primary:hover, .btn-success:hover {
  background: linear-gradient(90deg, #ff9800 0%, #ff7300 100%);
}

.btn-danger {
  background: #232526;
  border: 1px solid #ff7300;
  color: #ff7300;
}
.btn-danger:hover {
  background: #ff7300;
  color: #fff;
}

.btn-warning {
  background: #ff9800;
  color: #232526;
}
.btn-warning:hover {
  background: #ff7300;
  color: #fff;
}

.btn-outline-light {
  border-color: #ff9800;
  color: #ff9800;
}
.btn-outline-light:hover {
  background: #ff9800;
  color: #232526;
}

/* Sidebar y listas */
.list-group-item {
  background: rgba(50, 50, 55, 0.85);
  color: #f5f5f5;
  border: 1px solid rgba(255,255,255,0.05);
  transition: background 0.2s;
}
.list-group-item.active, .list-group-item:hover {
  background: linear-gradient(90deg, #ff7300 0%, #ff9800 100%);
  color: #fff;
}

/* Inputs y selects */
.form-control, .form-select {
  background: rgba(60, 60, 65, 0.85);
  color: #f5f5f5;
  border: 1px solid rgba(255,255,255,0.10);
}
.form-control:focus, .form-select:focus {
  border-color: #ff9800;
  box-shadow: 0 0 0 2px rgba(255,152,0,0.15);
}

/* PDF Viewer */
.pdf-viewer {
  background: rgba(30, 30, 35, 0.92);
  border-radius: 12px;
  min-height: 480px;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 4px 16px 0 rgba(31, 38, 135, 0.10);
  padding: 16px;
}
#pdf-canvas {
  width: 100%;
  max-width: 700px;
  border-radius: 8px;
  box-shadow: 0 2px 8px 0 rgba(255, 115, 0, 0.10);
}

/* Loader */
.spinner-border {
  color: #ff9800;
}

/* Estado de guardado */
#save-status {
  font-size: 0.95em;
  font-weight: 500;
  color: #ff9800;
  transition: color 0.2s;
}

/* Scroll slider */
#scroll-speed {
  accent-color: #ff9800;
  width: 100% !important;
  margin-top: 8px;
}

/* Metronome controls */
#metronome-controls .btn {
  min-width: 90px;
}

/* Responsive */
@media (max-width: 900px) {
  .glass-right { display: block; width: 100%; margin: 0 0 16px 0; }
  .glass-main { margin: 0 0 16px 0; }
}
@media (max-width: 600px) {
  .glass-sidebar { display: block; width: 100%; margin: 0 0 16px 0; }
  .glass-main { margin: 0 0 16px 0; }
}

/* Responsive layout for mobile */
@media (max-width: 900px) {
  .d-flex.vh-100 {
    flex-direction: column !important;
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
  }
  .glass-main, .pdf-viewer, #pdf-container {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    order: 1;
  }
  #song-editor-shell {
    flex: none;
    height: 60vh;
    min-height: 420px;
    max-height: 70vh;
  }
  .glass-sidebar, .glass-right {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    display: block !important;
    width: 100% !important;
    margin-bottom: 16px !important;
  }
  .glass-right { order: 2; }
  .glass-sidebar { order: 3; }

  html, body {
    height: auto !important;
    min-height: 100vh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
  #song-info {
    width: 100% !important;
    margin-bottom: 12px;
  }
  .modal-dialog {
    max-width: 95vw !important;
  }
  .d-flex.align-items-center.mb-3 {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px;
  }
  #scroll-speed {
    width: 100% !important;
    margin-top: 8px;
  }
  #scroll-speed-value {
    display: block;
    margin-left: 0;
    margin-bottom: 8px;
  }
  #pdf-container {
    margin-bottom: 16px;
  }
  #float-new-setlist-btn {
    width: 90vw !important;
    left: 5vw !important;
    right: auto !important;
    bottom: 16px !important;
  }
  body {
    padding-bottom: 80px !important;
  }
  /* Asegurar que los botones no se recorten en móvil */
  .btn, .form-control, .form-select {
    font-size: 1.1rem !important;
  }
  .btn {
    min-width: 44px;
    min-height: 44px;
  }
}

@media (min-width: 901px) {
  /* Restaurar layout horizontal en desktop */
  .d-flex.vh-100 {
    flex-direction: row !important;
    height: calc(100vh - 80px) !important;
  }
  .glass-sidebar, .glass-right {
    width: 260px !important;
    min-width: 220px !important;
    padding: 24px !important;
    margin-bottom: 0;
    overflow-y: auto;
    max-height: 100%;
  }
  .glass-main {
    width: 100% !important;
    min-width: 0 !important;
    padding: 24px !important;
  }
  #song-editor-shell {
    height: auto;
  }
  .d-flex.align-items-center.mb-3 {
    flex-direction: row !important;
    align-items: center !important;
    gap: 0;
  }
  #scroll-speed {
    width: 25% !important;
    margin-top: 0;
  }
  #scroll-speed-value {
    display: inline;
    margin-left: 8px;
    margin-bottom: 0;
  }
  #float-new-setlist-btn {
    width: auto !important;
    left: auto !important;
    right: 24px !important;
    bottom: 24px !important;
  }
  body {
    padding-bottom: 0 !important;
  }
}

/* Editor del modal de canción: más amplio y alineación exacta para acordes/letra */
#song-modal .modal-dialog {
  max-width: min(1280px, 96vw);
}

#song-modal .EasyMDEContainer .CodeMirror {
  height: 460px !important;
  font-family: Consolas, "Courier New", monospace;
  font-size: 1.04rem;
  line-height: 1.35;
  tab-size: 4;
}

#song-modal .EasyMDEContainer .CodeMirror-scroll {
  overflow-x: auto !important;
  overflow-y: auto !important;
}

#song-modal #song-paste-mode {
  min-width: 170px;
}

#song-modal .form-select-sm {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}
