/* === Variables y reset === */
:root {
  --primary-color: #2986ff;
  --secondary-color: #953eff;
  --bg-dark: #111827;
  --bg-card: #1f2937;
  --bg-card2: #1f2937;
  --bg-card3: rgba(31, 41, 55, 0.63);
  --bg-card4: rgba(17, 24, 39, 0.5);
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-thirdary: #d1d5db;
  --accent-color: #10b981;
  --danger-color: #ef4444;
  --sidebar-bg: #111827;
  --border-color: rgba(255, 255, 255, 0.2);
  --border-right: 1px solid rgba(255, 255, 255, 0.1);
  --transition-main: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-main: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --lyrics-bg: rgba(0, 0, 0, 0.8);
}

.light-mode {
  --bg-dark: #ffffff;
  --bg-card: #f9fafb;
  --bg-card2: #f0f4f8;
  --bg-card3: rgba(240, 244, 248, 0.8);
  --bg-card4: rgba(240, 240, 240, 0.5);
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-thirdary: #1a2335;
  --accent-color: #10b981;
  --danger-color: #ef4444;
  --sidebar-bg: #f0f4f8;
  --lyrics-bg: rgba(255, 255, 255, 0.9);
  --border-color: rgba(0, 0, 0, 0.1);
  --hover-bg-color: rgba(0, 0, 0, 0.05);
  --hover-color: rgba(0, 0, 0, 0.05);
  --scrollbar-thumb: #c2c8d0;
  --input-bg: #ffffff;
  --card-bg: #ffffff;
  --accent-hover: #0ea271;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-main);
}

body {
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

button,
input {
  font-family: var(--font-main);
}

/* === Layout === */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* === App layout === */
.music-app {
  display: grid;
  grid-template-columns: 250px 1fr;
  grid-template-rows: 1fr auto;
  grid-template-areas:
    "sidebar main"
    "player player";
  height: 100vh;
}

/* === Sidebar === */
.sidebar {
  grid-area: sidebar;
  background-color: var(--sidebar-bg);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-text {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-right: 8px;
}

.sidebar-logo img {
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.2));
  width: 40px;
  height: 40px;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-title {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 1px;
  margin-bottom: 12px;
  padding-left: 8px;
}

.nav-item,
.nav-item2 {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-main);
  color: var(--text-thirdary);
  margin-bottom: 4px;
  text-decoration: none;
  position: relative;
}

.nav-item2:hover,
.nav-item:hover,
.nav-item-header,
.nav-item.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
  border-radius: 0 4px 4px 0;
}

.nav-icon {
  font-size: 20px;
}

/* === Mobile navigation === */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
  backdrop-filter: blur(5px);
}

@media (max-width: 768px) {
  .section {
    margin-top: 40px;
  }

  .lyrics-display {
    width: 80% !important;
  }

  .settings-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .settings-item > div,
  .settings-item > button {
    margin-top: 0.5rem;
  }

  .btn {
    width: 100%;
    margin-left: 0;
    margin-top: 0.5rem;
    text-align: center;
  }

  .mobile-nav {
    display: block;
  }

  .main-content {
    padding-top: 15px;
  }

  .welcome-title {
    font-size: 22px;
  }

  .section-title {
    font-size: 16px;
  }
  .song-actions {
    padding: 8px;
  }
  .songs-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }

  .song-card {
    border-radius: 8px;
  }

  .song-info {
    padding: 12px;
  }

  .song-title {
    font-size: 14px;
  }

  .play-btn {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }

  #recentTable th:nth-child(3),
  #recentTable td:nth-child(3) {
    display: none;
  }

  .music-app {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "player";
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -250px;
    height: 100vh;
    width: 250px;
    z-index: 200;
    transition: var(--transition-main);
    box-shadow: none;
  }

  .sidebar.active {
    left: 0;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  }

  .logo-icon,
  .logo-text {
    font-size: 20px;
  }

  .nav-item,
  .nav-item2 {
    padding: 8px 12px;
    gap: 8px;
  }

  .nav-title {
    font-size: 10px;
  }
}

/* === Main content === */
.main-content {
  width: 100%;
  height: 100%;
  grid-area: main;
  padding: 24px;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(46, 59, 255, 0.15) 0%, rgba(17, 24, 39, 0) 250px);
}

.welcome-section {
  margin-bottom: 32px;
}

.welcome-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.welcome-subtitle {
  color: var(--text-secondary);
  font-size: 16px;
}

.content-section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
}

.section-link {
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition-main);
}

.section-link:hover {
  color: var(--primary-color);
}

/* === Song cards === */
.songs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 200px;
}

.song-card {
  background: linear-gradient(135deg, var(--bg-dark), var(--bg-card4));
  backdrop-filter: blur(10px);
  transition: var(--transition-main);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.song-card:hover {
  box-shadow: 0 10px 10px rgba(0, 0, 0, 0.3);
}

.song-card.active {
  border: 2px solid var(--primary-color);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
}

.play-pause-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #fff;
  cursor: pointer;
}

.song-thumb {
  position: relative;
  padding-top: 100%;
  overflow: hidden;
}

.song-thumb img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.song-card:hover .song-thumb img {
  transform: scale(1.08);
}

.song-info {
  padding: 16px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.song-title {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.song-album {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-actions {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background-color: rgba(0, 0, 0, 0.05);
}
.action-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.action-btn:hover {
  color: var(--primary-color);
  background-color: rgba(255, 255, 255, 0.1);
}

.play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
}

.play-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  display: flex;
  justify-content: center;
  align-items: center;
  transform: translateY(20px) scale(0.8);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  color: white;
  font-size: 20px;
}

.song-card:hover .play-overlay {
  opacity: 1;
}

.song-card:hover .play-btn {
  transform: translateY(0) scale(1);
}

/* === Recent plays table === */
#recentTable {
  width: 100%;
  border-collapse: collapse;
}

#recentTable thead tr th {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

#recentTable tbody td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.recent-row {
  transition: var(--transition-main);
  cursor: pointer;
}

.recent-row:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.recent-row.active {
  background-color: rgba(46, 59, 255, 0.15);
}

.song-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.song-index {
  min-width: 20px;
  text-align: right;
  color: var(--text-secondary);
}

.song-thumb-small {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
}

.song-thumb-small img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.song-meta {
  display: flex;
  flex-direction: column;
}

.album-cell {
  color: var(--text-secondary);
}

/* === Player controls === */
.player-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  grid-area: player;
  background-color: var(--bg-card2);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px 24px;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: center;
  z-index: 1000;
}

.current-song {
  display: flex;
  align-items: center;
  gap: 12px;
}

.current-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
}

.current-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.current-info .song-title {
  margin-bottom: 4px;
}

.player-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.control-buttons {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 12px;
}

.control-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-main);
  display: flex;
  justify-content: center;
  align-items: center;
}

.control-btn:hover {
  color: var(--primary-color);
}

.btn-play-pause {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 10px rgba(46, 59, 255, 0.3);
}

.btn-play-pause:hover {
  color: white;
  box-shadow: 0 0px 10px 5px rgba(46, 59, 255, 0.3);
}

.progress-container {
  width: 100%;
  max-width: 500px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-time {
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 45px;
}

.progress-bar {
  flex-grow: 1;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.progress-current {
  height: 100%;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  border-radius: 2px;
  position: relative;
}

.progress-handle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  position: absolute;
  top: 50%;
  right: -6px;
  transform: translateY(-50%) scale(0);
  transition: transform 0.2s ease;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.progress-bar:hover .progress-handle,
.progress-bar.active .progress-handle {
  transform: translateY(-50%) scale(1);
}

.volume-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.volume-slider {
  width: 100px;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.volume-level {
  height: 100%;
  background: linear-gradient(to right, var(--text-secondary), var(--text-primary));
  border-radius: 2px;
}
/* === Visualizer === */
.visualizer {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  position: fixed;
  bottom: 100px;
  left: 0;
  right: 0;
  background: linear-gradient(to top, var(--bg-card), transparent 70%);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease;
  z-index: 1000;
  perspective: 800px;
}

.visualizer.visible {
  opacity: 0.75;
  visibility: visible;
}

.visualizer-bar {
  flex: 1;
  min-width: 3px;
  max-width: 8px;
  height: 2px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(to top, var(--primary-color), var(--secondary-color));
  transition: height 0.05s cubic-bezier(0.4, 0, 0.2, 1), transform 0.1s ease, opacity 0.2s ease;
  transform-origin: bottom center;
  position: relative;
  box-shadow: 0 0 5px 0 rgba(var(--primary-color-rgb), 0.3);
  overflow: visible;
}

@media (max-width: 768px) {
  .visualizer {
    padding: 0 5%;
    gap: 1px;
    height: 120px;
  }

  .visualizer-bar {
    min-width: 2px;
    max-width: 6px;
  }
}

/* Efectos adicionales para barras extremas */
.visualizer-bar:nth-child(1),
.visualizer-bar:nth-child(2),
.visualizer-bar:nth-last-child(1),
.visualizer-bar:nth-last-child(2) {
  opacity: 0.7; /* Barras de los extremos ligeramente transparentes */
}

/* Efecto de resplandor para barras con alta energía */
.visualizer-bar[style*="height: 8"] {
  box-shadow: 0 0 8px 2px rgba(var(--primary-color-rgb), 0.5);
}

/* === Toasts === */
.toast-container {
  position: fixed;
  bottom: 120px;
  right: 20px;
  z-index: 1000;
}

.toast {
  background-color: var(--bg-card);
  border-left: 4px solid var(--primary-color);
  border-radius: 6px;
  padding: 16px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  max-width: 300px;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* === Responsive === */
@media (max-width: 768px) {
  .sidebar-credits {
    margin: auto 0 100px 0 !important;
  }

  .toast-container {
    bottom: 180px;
  }

  .visualizer {
    bottom: 120px;
  }

  .player-container {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 12px;
  }

  .current-song {
    justify-content: center;
  }

  .current-thumb {
    display: none;
  }

  .volume-controls {
    display: none;
  }

  .progress-container {
    max-width: 100%;
  }

  .control-btn {
    font-size: 18px;
  }

  .btn-play-pause {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  .playlists-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
  }

  .playlist-info {
    padding: 12px;
  }

  .playlist-info h3 {
    font-size: 0.9rem;
  }

  .sidebar-credits {
    margin: auto 0 110px 0 !important;
  }

  .visualizer {
    bottom: 130px;
  }

  .songs-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }

  .welcome-title {
    font-size: 24px;
  }

  .section-title {
    font-size: 18px;
  }

  .action-btn {
    width: 28px;
    height: 28px;
  }

  .song-meta {
    flex-direction: column;
    gap: 2px;
  }
  .song-info {
    padding: 12px;
  }

  .song-title {
    font-size: 14px;
  }

  #recentTable th:nth-child(3),
  #recentTable td:nth-child(3) {
    display: none;
  }

  .player-controls {
    margin-top: 10px;
  }

  .progress-container {
    max-width: 100%;
  }
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.header-container {
  z-index: 2;
  background-color: var(--bg-card2);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  padding: 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
}

.nav-item-header {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: var(--transition-main);
  color: var(--text-thirdary);
  cursor: pointer;
  font-size: 20px;
}

.search-container {
  flex-grow: 1;
  display: flex;
  align-items: center;
  position: relative;
  max-width: 400px;
}

.search-container .fa-search {
  position: absolute;
  left: 12px;
  color: var(--text-secondary);
  font-size: 16px;
}

.search-input {
  width: 100%;
  padding: 8px 8px 8px 36px;
  border-radius: 8px;
  background: var(--bg-card3);
  color: var(--text-thirdary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
}

@media (max-width: 768px) {
  .header-container {
    justify-content: space-between;
    padding: 8px 12px;
  }

  .search-container {
    max-width: 100%;
  }

  .search-input {
    font-size: 14px;
    padding: 8px 8px 8px 32px;
  }

  .nav-item-header {
    display: flex;
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
}

.like-btn:hover {
  color: #ff5e6d;
}

.like-btn.liked {
  color: #ff5e6d;
}

.like-btn.liked:hover {
  color: #ff3a4c;
}

.share-btn:hover {
  color: lightblue;
}

.download-btn:hover {
  color: lightgreen;
}

.like-btn,
.share-btn,
.download-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 1.2rem;
  transition: color 0.3s ease;
}

.new-badge {
  background-color: var(--primary-color);
  color: white;
}

.exclusive-badge {
  background-color: var(--secondary-color);
  color: white;
}
.new-badge,
.exclusive-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 10;
}

.section {
  display: none;
  flex-direction: column;
  animation: fadeIn 0.3s ease-in-out;
  background-color: var(--bg-card);
  border-radius: 8px;
  padding: 16px;
  margin-top: 24px;
}

.section.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.theme-toggle {
  margin-top: auto;
  display: flex;
  justify-content: center;
  padding: 16px 0;
}

#themeToggle {
  background: none;
  border: none;
  color: var(--text-thirdary);
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition-main);
}

#themeToggle:hover {
  color: var(--primary-color);
}

/* === Créditos === */
.sidebar-credits {
  margin: auto 0 75px 0;
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.sidebar-credits p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.sidebar-credits .credits-link {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-main);
}

.sidebar-credits .credits-link:hover {
  color: var(--secondary-color);
}

/* Contenedor de resultados de búsqueda */
.search-results-list {
  background-color: var(--bg-card);
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.search-result-item {
  display: flex;
  align-items: center;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  background-color: var(--hover-bg-color, rgba(255, 255, 255, 0.02));
  transition: background-color 0.2s ease;
}

.search-result-item:hover {
  background-color: var(--hover-bg-color, rgba(255, 255, 255, 0.1));
}

.search-result-thumb img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 12px;
}

.search-result-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.search-result-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary-color, #ffffff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-album {
  font-size: 12px;
  color: var(--text-secondary-color, #b3b3b3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === Estilos para la sección de Discord === */
#settingsSection {
  padding: 1.5rem;
  background-color: var(--bg-card);
  border-radius: 8px;
  margin: 1rem 0;
  color: var(--text-primary);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.75rem;
}

.section-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.settings-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-group {
  background-color: var(--bg-card2);
  border-radius: 4px;
  padding: 1rem;
  transition: var(--transition-main);
}

.settings-group h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.settings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-item label {
  color: var(--text-thirdary);
  font-size: 0.9rem;
}

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
}

.toggle-input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-label {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: var(--transition-main);
  border-radius: 34px;
}

.toggle-label:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--bg-dark);
  transition: var(--transition-main);
  border-radius: 50%;
}

.toggle-input:checked + .toggle-label {
  background-color: var(--primary-color);
}

.toggle-input:checked + .toggle-label:before {
  transform: translateX(20px);
}

/* Status text */
#discord-status-text {
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  padding: 0.5rem 1rem;
  border-radius: 3px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-main);
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  border: none;
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-left: 0.5rem;
}

.btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Estilos para badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
}
.lyrics-container {
  border-radius: 12px;
  opacity: 0;
  overflow: hidden;
  visibility: hidden;
  width: 100%;
  height: 100%;
  z-index: 50;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  display: flex;
  flex-direction: column;
  position: fixed;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.lyrics-container.visible {
  opacity: 1;
  visibility: visible;
}

.lyrics-display {
  position: relative;
  width: 50%;
  height: 70%;
  background: linear-gradient(to bottom, rgba(18, 18, 18, 0.95), rgba(18, 18, 18, 0.99));
  flex: 0 0 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  border-radius: 12px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.lyrics-display.visible {
  opacity: 1;
  visibility: visible;
}

.lyrics-song-info {
  text-align: center;
  padding: 0.5rem;
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.lyrics-song-title {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 0.25rem;
}

.lyrics-song-artist {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 0.25rem;
}

.lyrics-song-album {
  font-size: 0.8rem;
  opacity: 0.7;
}

.lyrics-content {
  position: relative;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  padding: 5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lyric-line {
  margin: 1.2rem 0;
  transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
  opacity: 0.5;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  line-height: 1.5;
  text-align: center;
  width: 100%;
}

.lyric-line span {
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.lyric-line.active {
  opacity: 1;
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  transform: scale(1.05);
}

.lyric-line.active span {
  background: rgba(255, 255, 255, 0.1);
}

.lyric-line.next {
  opacity: 0.7;
  color: rgba(255, 255, 255, 0.9);
}

.lyric-line.recent {
  opacity: 0.6;
}

#lyricsToggle,
#visualToggle {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
}

#lyricsToggle:hover,
#visualToggle:hover {
  background: rgba(255, 255, 255, 0.3);
}

body.light-mode .lyrics-container {
  background: rgba(240, 240, 240, 0.95);
  backdrop-filter: blur(10px);
  color: #333;
}

body.light-mode .lyrics-song-info {
  background: rgba(240, 240, 240, 0.8);
}

body.light-mode .lyric-line {
  color: rgba(0, 0, 0, 0.7);
}

body.light-mode .lyric-line.active {
  color: #000;
}

body.light-mode .lyric-line.active span {
  background: rgba(0, 0, 0, 0.05);
}

.empty-favorites {
  text-align: center;
  padding: 2rem 0;
}
.empty-message {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-secondary);
}
.empty-message i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.now-playing-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.actions-cell {
  width: 40px;
  text-align: center;
}
.remove-fav {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s, color 0.2s;
}
.remove-fav:hover {
  opacity: 1;
  color: var(--accent-color);
}

/* Grid de listas de reproducción */
.playlists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
}

/* Tarjeta de playlist */
.playlist-card {
  background: var(--bg-card4);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.playlist-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

/* Portada de la playlist */
.playlist-cover {
  position: relative;
  padding-top: 100%; /* Mantiene la relación de aspecto 1:1 */
  overflow: hidden;
}

.playlist-cover img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.playlist-card:hover .playlist-cover img {
  transform: scale(1.08);
}

/* Información de la playlist */
.playlist-info {
  padding: 16px;
  text-align: center;
}

.playlist-info h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary, #ffffff);
}

.playlist-info p {
  font-size: 0.9rem;
  color: var(--text-secondary, #b3b3b3);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Botón de eliminar playlist */
.delete-playlist-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s ease;
  z-index: 10;
}

.delete-playlist-btn:hover {
  background-color: rgba(255, 0, 0, 0.8);
  transform: scale(1.1);
}

.user-playlist:hover .delete-playlist-btn {
  opacity: 1;
}

/* Estilos para crear nueva playlist */
.create-playlist-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2.5rem;
  transition: all 0.3s ease;
}

.create-playlist-cover i {
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
}

.playlist-card:hover .create-playlist-cover i {
  transform: scale(1.2) rotate(90deg);
}

/* Menú de selección de playlist */
.playlist-selection-menu {
  background-color: var(--bg-card, #282828);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  padding: 12px;
  min-width: 240px;
  max-height: 350px;
  overflow-y: auto;
  z-index: 1000;
}

.playlist-selection-menu::-webkit-scrollbar {
  width: 6px;
}

.playlist-selection-menu::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb, #535353);
  border-radius: 3px;
}

.playlist-selection-menu::-webkit-scrollbar-track {
  background: transparent;
}

.menu-title {
  font-weight: 700;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border-color, #333333);
  margin-bottom: 12px;
  color: var(--text-primary, #ffffff);
}

.playlist-option {
  padding: 10px 14px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background-color 0.2s ease;
}

.playlist-option:hover {
  background-color: var(--hover-color, #333333);
}

.menu-divider {
  height: 1px;
  background-color: var(--border-color, #333333);
  margin: 12px 0;
}

.no-playlists-message {
  padding: 16px;
  text-align: center;
  color: var(--text-secondary, #b3b3b3);
  font-style: italic;
}

/* Indicador de reproducción actual */
.now-playing {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: var(--accent-color, #1db954);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: uppercase;
  z-index: 10;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.playlist-card.active .now-playing {
  opacity: 1;
  transform: translateY(0);
}

/* Contador de pistas */
.track-count {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  z-index: 10;
}

/* Responsive */
@media (max-width: 768px) {
  .playlists-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
  }

  .playlist-info h3 {
    font-size: 1rem;
  }

  .playlist-info p {
    font-size: 0.8rem;
  }
}

.modal-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.modal-container.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: var(--card-bg);
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transform: translateY(-20px);
  transition: transform 0.3s;
  overflow: hidden;
}

.modal-container.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text-color);
}

.close-modal {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  padding: 5px;
}

.close-modal:hover {
  color: var(--accent-color);
}

.modal-body {
  padding: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}

.playlist-name-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background-color: var(--input-bg);
  color: var(--text-color);
  font-size: 16px;
}

.playlist-name-input:focus {
  border-color: var(--accent-color);
  outline: none;
}

.error-message {
  color: #ff4d4d;
  font-size: 14px;
  margin-top: 8px;
  min-height: 20px;
}

.modal-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.modal-btn {
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.cancel-btn {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.cancel-btn:hover {
  background-color: var(--hover-color);
}

.confirm-btn {
  background-color: var(--accent-color);
  border: 1px solid var(--accent-color);
  color: white;
}

.confirm-btn:hover {
  background-color: var(--accent-hover);
}

body:not(.light-mode) .modal-content {
  background-color: #1f1f1f;
  border: 1px solid #333;
}

body.light-mode .modal-content {
  background-color: #f8f8f8;
  border: 1px solid #ddd;
}

.disabled-feature {
  color: #888;
  font-style: italic;
}
.discord-info-icon {
  margin-left: 8px;
  color: #888;
  cursor: help;
}

.menu-content {
  z-index: 1000;
  position: absolute;
  top: 80px;
  right: 20px;
  background-color: var(--bg-card);
  border-radius: 12px;
  padding: 8px;
  width: 320px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transform: translateY(-20px);
  animation: slideIn 0.3s forwards;
  animation: fadeIn 0.3s forwards;
}

.menu-content ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu-content li {
  margin-bottom: 12px;
}

.menu-content li:last-child {
  margin-bottom: 0;
}

.menu-content a {
  display: block;
  padding: 12px 16px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 18px;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.menu-content a:hover {
  opacity: 0.75;
}

.light-mode .menu-content {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
