/* ============================================
   MUSIKANJI - Estilos del Sistema de Canciones
   ============================================ */

/* ============================================
   MODAL PRINCIPAL
   ============================================ */

.modal-musikanji-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-musikanji-overlay.active {
  display: flex !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-musikanji {
  background: var(--bg-secondary, white);
  border-radius: 20px;
  width: 95%;
  max-width: 900px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   HEADER DEL MODAL
   ============================================ */

.musikanji-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.musikanji-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.musikanji-header h2::before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 32px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.musikanji-usage {
  font-size: 0.9rem;
  opacity: 0.9;
  background: rgba(255,255,255,0.15);
  padding: 6px 14px;
  border-radius: 20px;
}

.musikanji-usage strong {
  font-weight: 700;
}

.btn-cerrar-mk {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.2);
  color: white;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-cerrar-mk:hover {
  background: rgba(255,255,255,0.35);
  transform: scale(1.1);
}

/* ============================================
   CONTENIDO PRINCIPAL
   ============================================ */

.musikanji-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  position: relative;
}

/* ============================================
   PANEL DE BUSQUEDA
   ============================================ */

.musikanji-search-panel {
  margin-bottom: 24px;
}

.search-input-group {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.input-url-mk {
  flex: 1;
  padding: 14px 18px;
  font-size: 1rem;
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  background: var(--bg-tertiary, #f9fafb);
  color: var(--text-primary, #1a1a1a);
  transition: all 0.2s ease;
}

.input-url-mk:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.input-url-mk::placeholder {
  color: var(--text-tertiary, #98a2b3);
}

.btn-buscar-mk {
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-buscar-mk:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-buscar-mk:active {
  transform: translateY(0);
}

.search-options {
  display: flex;
  gap: 20px;
  padding-left: 4px;
}

.search-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--text-secondary, #667085);
  cursor: pointer;
}

.search-options input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #667eea;
}

/* ============================================
   SECCION HOME - CANCIONES POPULARES
   ============================================ */

.musikanji-section {
  animation: fadeIn 0.3s ease;
}

.musikanji-section h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary, #1a1a1a);
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-row {
  margin-bottom: 16px;
}

.filter-row select {
  padding: 8px 16px;
  font-size: 0.9rem;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  background: var(--bg-secondary, white);
  color: var(--text-primary, #1a1a1a);
  cursor: pointer;
}

/* ============================================
   GRID DE CANCIONES
   ============================================ */

.songs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.song-card {
  background: var(--bg-tertiary, #f9fafb);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 2px solid transparent;
}

.song-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  border-color: #667eea;
}

.song-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: linear-gradient(135deg, #667eea20, #764ba220);
}

.song-card-info {
  padding: 12px;
}

.song-card-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary, #1a1a1a);
  margin: 0 0 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-card-info p {
  font-size: 0.85rem;
  color: var(--text-secondary, #667085);
  margin: 0 0 8px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============================================
   BADGES DE NIVEL
   ============================================ */

.badge-level {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* Colores HSK (Chino) */
.badge-level.level-HSK1 { background: #dcfce7; color: #166534; }
.badge-level.level-HSK2 { background: #d1fae5; color: #065f46; }
.badge-level.level-HSK3 { background: #fef3c7; color: #92400e; }
.badge-level.level-HSK4 { background: #fed7aa; color: #9a3412; }
.badge-level.level-HSK5 { background: #fecaca; color: #991b1b; }
.badge-level.level-HSK6 { background: #e9d5ff; color: #6b21a8; }

/* Colores JLPT (Japones) */
.badge-level.level-N5 { background: #dcfce7; color: #166534; }
.badge-level.level-N4 { background: #d1fae5; color: #065f46; }
.badge-level.level-N3 { background: #fef3c7; color: #92400e; }
.badge-level.level-N2 { background: #fed7aa; color: #9a3412; }
.badge-level.level-N1 { background: #fecaca; color: #991b1b; }

.badge-level.level-unknown { background: #f3f4f6; color: #6b7280; }

.song-views {
  font-size: 0.8rem;
  color: var(--text-tertiary, #98a2b3);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================
   PREVIEW DE CANCION
   ============================================ */

.btn-back-mk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  font-size: 0.95rem;
  color: #667eea;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
  margin-bottom: 20px;
}

.btn-back-mk:hover {
  text-decoration: underline;
}

.preview-card {
  display: flex;
  gap: 20px;
  background: var(--bg-tertiary, #f9fafb);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
}

.preview-thumbnail {
  width: 200px;
  flex-shrink: 0;
}

.preview-thumbnail img {
  width: 100%;
  border-radius: 12px;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: #e5e7eb;
}

.preview-info {
  flex: 1;
}

.preview-info h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--text-primary, #1a1a1a);
}

.preview-info p {
  font-size: 1rem;
  color: var(--text-secondary, #667085);
  margin: 0;
}

.preview-stats {
  margin-bottom: 20px;
}

.preview-stats h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: var(--text-primary, #1a1a1a);
}

.preview-stats ul {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
}

.preview-stats li {
  font-size: 0.95rem;
  color: var(--text-secondary, #667085);
  padding: 6px 0;
}

/* Breakdown de niveles (barras visuales) */
.level-breakdown {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.level-bar-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.level-bar {
  width: 60px;
  height: 8px;
  background: var(--border-color, #e5e7eb);
  border-radius: 4px;
  overflow: hidden;
}

.level-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.level-bar-fill.HSK1, .level-bar-fill.N5 { background: #22c55e; }
.level-bar-fill.HSK2, .level-bar-fill.N4 { background: #84cc16; }
.level-bar-fill.HSK3, .level-bar-fill.N3 { background: #eab308; }
.level-bar-fill.HSK4, .level-bar-fill.N2 { background: #f97316; }
.level-bar-fill.HSK5, .level-bar-fill.N1 { background: #ef4444; }
.level-bar-fill.HSK6 { background: #a855f7; }
.level-bar-fill.unknown { background: #9ca3af; }

.preview-warning {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 0.95rem;
  color: #92400e;
  margin-bottom: 20px;
}

.preview-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn-secondary-mk {
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 500;
  background: var(--bg-tertiary, #f9fafb);
  color: var(--text-primary, #1a1a1a);
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary-mk:hover {
  background: var(--border-color, #e5e7eb);
}

.btn-primary-mk {
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary-mk:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* ============================================
   FORMULARIO MANUAL
   ============================================ */

.manual-input h3 {
  color: #92400e;
  margin-bottom: 8px;
}

.manual-input > p {
  color: var(--text-secondary, #667085);
  margin-bottom: 20px;
}

.form-group-mk {
  margin-bottom: 16px;
}

.form-group-mk label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary, #1a1a1a);
  margin-bottom: 6px;
}

.form-group-mk input,
.form-group-mk textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 10px;
  background: var(--bg-tertiary, #f9fafb);
  color: var(--text-primary, #1a1a1a);
  transition: all 0.2s ease;
}

.form-group-mk input:focus,
.form-group-mk textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.form-group-mk textarea {
  resize: vertical;
  min-height: 150px;
  font-family: inherit;
}

/* ============================================
   VISTA DE CANCION PROCESADA
   ============================================ */

.song-header-mk {
  margin-bottom: 20px;
}

.song-header-mk h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 6px 0;
}

.song-header-mk p {
  font-size: 1rem;
  color: var(--text-secondary, #667085);
  margin: 0 0 12px 0;
}

.song-stats-row {
  display: flex;
  gap: 20px;
  font-size: 0.95rem;
  color: var(--text-secondary, #667085);
}

.song-stats-row span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Video toggle */
.btn-toggle-video {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.9rem;
  color: #667eea;
  background: rgba(102, 126, 234, 0.1);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 20px;
}

.btn-toggle-video:hover {
  background: rgba(102, 126, 234, 0.2);
}

.video-container-mk {
  margin-bottom: 20px;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: #000;
}

.video-container-mk iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ============================================
   PANEL DE FILTROS
   ============================================ */

.filters-panel-mk {
  background: var(--bg-tertiary, #f9fafb);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 20px;
}

.filters-panel-mk h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 14px 0;
  color: var(--text-primary, #1a1a1a);
}

.filters-grid-mk {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}

.filter-group-mk {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group-mk > label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary, #667085);
}

.filter-group-mk select,
.filter-group-mk input[type="number"] {
  padding: 8px 10px;
  font-size: 0.9rem;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  background: var(--bg-secondary, white);
  color: var(--text-primary, #1a1a1a);
}

.filter-group-mk select[multiple] {
  min-height: 80px;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-primary, #1a1a1a);
  cursor: pointer;
  padding-top: 6px;
}

.filter-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: #667eea;
}

.btn-link-mk {
  padding: 6px 0;
  font-size: 0.85rem;
  color: #667eea;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  margin-top: 8px;
}

/* ============================================
   CONTENEDOR DE LETRA
   ============================================ */

.lyrics-container-mk {
  background: var(--bg-secondary, white);
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
  line-height: 2;
  font-size: 1.2rem;
}

.song-lyrics {
  font-family: 'Noto Sans SC', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Palabras con highlighting */
.word {
  display: inline;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.word:hover {
  transform: scale(1.05);
  z-index: 10;
}

/* Colores por nivel HSK */
.word.level-HSK1 { background: rgba(34, 197, 94, 0.25); color: #166534; }
.word.level-HSK2 { background: rgba(132, 204, 22, 0.25); color: #3f6212; }
.word.level-HSK3 { background: rgba(234, 179, 8, 0.25); color: #854d0e; }
.word.level-HSK4 { background: rgba(249, 115, 22, 0.25); color: #9a3412; }
.word.level-HSK5 { background: rgba(239, 68, 68, 0.25); color: #991b1b; }
.word.level-HSK6 { background: rgba(168, 85, 247, 0.25); color: #6b21a8; }

/* Colores por nivel JLPT */
.word.level-N5 { background: rgba(34, 197, 94, 0.25); color: #166534; }
.word.level-N4 { background: rgba(132, 204, 22, 0.25); color: #3f6212; }
.word.level-N3 { background: rgba(234, 179, 8, 0.25); color: #854d0e; }
.word.level-N2 { background: rgba(249, 115, 22, 0.25); color: #9a3412; }
.word.level-N1 { background: rgba(239, 68, 68, 0.25); color: #991b1b; }

.word.level-unknown { background: rgba(156, 163, 175, 0.2); color: #6b7280; }

.word.selected {
  outline: 3px solid #667eea;
  outline-offset: 1px;
  background: rgba(102, 126, 234, 0.2) !important;
}

.word.known {
  opacity: 0.5;
}

.word.hidden {
  color: transparent;
  background: var(--border-color, #e5e7eb);
}

/* ============================================
   POPUP DE PALABRA
   ============================================ */

.word-popup {
  position: fixed;
  background: var(--bg-secondary, white);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  padding: 18px;
  min-width: 260px;
  max-width: 320px;
  z-index: 100001;
  animation: popIn 0.2s ease;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.word-popup-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.word-popup-word {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary, #1a1a1a);
}

.word-popup-reading {
  font-size: 1rem;
  color: var(--text-secondary, #667085);
}

.word-popup-meaning {
  font-size: 1rem;
  color: var(--text-primary, #1a1a1a);
  margin-bottom: 12px;
}

.word-popup-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.word-popup-meta .badge {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-tertiary, #f9fafb);
  color: var(--text-secondary, #667085);
}

.word-popup-extra {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-tertiary, #98a2b3);
  margin-bottom: 14px;
}

.word-popup-known {
  padding: 10px;
  background: #dcfce7;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #166534;
  text-align: center;
}

.btn-add-word {
  width: 100%;
  padding: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add-word:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* ============================================
   PANEL DE SELECCION
   ============================================ */

.selection-panel-mk {
  background: linear-gradient(135deg, #667eea15, #764ba215);
  border: 2px solid #667eea40;
  border-radius: 14px;
  padding: 18px;
}

.selection-info {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #1a1a1a);
  margin-bottom: 12px;
}

.selection-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.selection-quick-actions .btn-link-mk {
  margin: 0;
  padding: 6px 12px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 6px;
  text-decoration: none;
}

.selection-quick-actions .btn-link-mk:hover {
  background: rgba(102, 126, 234, 0.2);
}

.selection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.selection-actions select {
  flex: 1;
  min-width: 180px;
  padding: 10px 14px;
  font-size: 0.95rem;
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 10px;
  background: var(--bg-secondary, white);
  color: var(--text-primary, #1a1a1a);
}

.selection-actions .btn-secondary-mk,
.selection-actions .btn-primary-mk {
  padding: 10px 18px;
  font-size: 0.95rem;
}

.selection-actions .btn-secondary-mk:disabled,
.selection-actions .btn-primary-mk:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================
   LOADING OVERLAY
   ============================================ */

.loading-overlay-mk {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.95);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 100;
  border-radius: 20px;
}

[data-theme="dark"] .loading-overlay-mk {
  background: rgba(26, 31, 41, 0.95);
}

.loading-overlay-mk.active {
  display: flex;
}

.loading-content-mk {
  text-align: center;
}

.spinner-mk {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color, #e5e7eb);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-content-mk p {
  font-size: 1rem;
  color: var(--text-secondary, #667085);
  margin-bottom: 16px;
}

.progress-bar-mk {
  width: 200px;
  height: 6px;
  background: var(--border-color, #e5e7eb);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill-mk {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* ============================================
   EMPTY STATES
   ============================================ */

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-tertiary, #98a2b3);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .modal-musikanji {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .musikanji-header {
    padding: 16px 18px;
  }

  .musikanji-header h2 {
    font-size: 1.2rem;
  }

  .musikanji-usage {
    display: none;
  }

  .musikanji-content {
    padding: 18px;
  }

  .search-input-group {
    flex-direction: column;
  }

  .btn-buscar-mk {
    width: 100%;
    justify-content: center;
  }

  .songs-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .preview-card {
    flex-direction: column;
  }

  .preview-thumbnail {
    width: 100%;
  }

  .preview-actions {
    flex-direction: column;
  }

  .preview-actions button {
    width: 100%;
  }

  .filters-grid-mk {
    grid-template-columns: 1fr 1fr;
  }

  .lyrics-container-mk {
    font-size: 1.1rem;
    padding: 16px;
  }

  .selection-actions {
    flex-direction: column;
  }

  .selection-actions select,
  .selection-actions button {
    width: 100%;
  }

  .word-popup {
    left: 10px !important;
    right: 10px !important;
    max-width: calc(100vw - 20px);
  }
}

@media (max-width: 480px) {
  .songs-grid {
    grid-template-columns: 1fr;
  }

  .filters-grid-mk {
    grid-template-columns: 1fr;
  }

  .song-stats-row {
    flex-direction: column;
    gap: 8px;
  }
}

/* ============================================
   BOTON DEL MENU PRINCIPAL
   ============================================ */

.btn-musikanji-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  font-size: 0.95rem;
  color: var(--text-primary, #1a1a1a);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.btn-musikanji-menu:hover {
  background: linear-gradient(135deg, #667eea15, #764ba215);
}

.btn-musikanji-menu svg {
  flex-shrink: 0;
}

.btn-musikanji-menu .badge-new {
  margin-left: auto;
  font-size: 0.7rem;
  padding: 2px 6px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-radius: 4px;
  font-weight: 600;
}
