/* ========================================================
   SPOTITUBE - MOBILE SPOTIFY DESIGN SYSTEM
   ======================================================== */

:root {
  --bg-base: #121212;
  --bg-highlight: #1a1a1a;
  --bg-card: #181818;
  --bg-card-hover: #282828;
  --bg-elevated: #242424;
  
  --spotify-green: #1db954;
  --spotify-green-hover: #1ed760;
  --spotify-green-pressed: #169c46;
  
  --text-base: #ffffff;
  --text-sub: #b3b3b3;
  --text-muted: #727272;
  
  --bottom-nav-height: 60px;
  --mini-player-height: 56px;
  
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body, html {
  width: 100%;
  height: 100%;
  background-color: #000;
  color: var(--text-base);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
}

/* App Container (Mobile centered view on desktop, full on mobile) */
.app-container {
  width: 100%;
  max-width: 500px;
  height: 100%;
  margin: 0 auto;
  background-color: var(--bg-base);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
}

/* ========================================================
   HEADER
   ======================================================== */
.app-header {
  padding: calc(var(--safe-top) + 14px) 16px 8px 16px;
  background: linear-gradient(180deg, rgba(30, 30, 30, 0.8) 0%, rgba(18, 18, 18, 0) 100%);
  z-index: 10;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.brand-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(29, 185, 84, 0.35);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand-header:hover .brand-logo-img {
  transform: scale(1.08) rotate(2deg);
}

.brand-text {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
}

.brand-spoti, .brand-family {
  color: #1ed760;
  text-shadow: 0 0 14px rgba(30, 215, 96, 0.45);
}

.brand-tube {
  color: #ff2b56;
  text-shadow: 0 0 14px rgba(255, 43, 86, 0.45);
}

.brand-music {
  color: #ffffff;
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.35);
}

.header-content h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.eq-header-btn {
  background: rgba(29, 185, 84, 0.15);
  border: 1px solid rgba(29, 185, 84, 0.4);
  color: #1ed760;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.eq-header-btn:hover {
  background: rgba(29, 185, 84, 0.25);
  border-color: #1ed760;
  transform: scale(1.03);
}

.eq-header-btn:active {
  transform: scale(0.95);
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-base);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 50%;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.icon-btn:active {
  transform: scale(0.92);
  opacity: 0.8;
}

.filter-chips {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  cursor: grab;
  padding-bottom: 2px;
}
.filter-chips.grabbing {
  cursor: grabbing;
}
.filter-chips::-webkit-scrollbar {
  display: none;
}

.chip {
  background-color: var(--bg-card-hover);
  color: var(--text-base);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.chip:hover {
  transform: translateY(-1px);
}

.chip:active {
  transform: scale(0.96);
}

.chip.active {
  background-color: var(--spotify-green);
  color: #000;
  font-weight: 700;
}

/* ========================================================
   SCROLL AREA & TABS
   ======================================================== */
.scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(var(--bottom-nav-height) + var(--mini-player-height) + var(--safe-bottom) + 20px);
  -webkit-overflow-scrolling: touch;
}

.tab-pane {
  display: none;
  padding: 12px 16px 30px 16px;
  animation: fadeIn 0.2s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0.7; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========================================================
   HOME TAB: QUICK GRID & SECTIONS
   ======================================================== */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.quick-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  display: flex;
  align-items: center;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.2s;
  height: 52px;
}

.quick-card:active {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(0.98);
}

.quick-card img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  flex-shrink: 0;
}

.quick-card .gradient-thumb {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #450af5, #8e8ee5);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quick-card span {
  font-size: 12px;
  font-weight: 700;
  padding: 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.section-block {
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-header h2 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.rail-arrows {
  display: flex;
  gap: 8px;
}

.rail-arrow-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.rail-arrow-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: scale(1.06);
}

.rail-arrow-btn:active {
  transform: scale(0.92);
}

.horizontal-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -16px;
  padding: 0 16px;
  scroll-behavior: smooth;
  cursor: grab;
  user-select: none;
}

.horizontal-scroll.grabbing {
  cursor: grabbing;
}
.horizontal-scroll::-webkit-scrollbar {
  display: none;
}

/* Tarjeta de Canción / Álbum en Rail Horizontal */
.music-card {
  width: 140px;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 6px;
  transition: transform 0.15s ease;
}

.music-card:active {
  transform: scale(0.96);
}

.card-thumb-wrap {
  width: 140px;
  height: 140px;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
  background-color: var(--bg-card);
}

.card-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.card-artist {
  font-size: 12px;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Skeleton Loading */
.skeleton-card {
  width: 140px;
  height: 180px;
  border-radius: 6px;
  flex-shrink: 0;
  background: linear-gradient(90deg, #1e1e1e 25%, #2a2a2a 50%, #1e1e1e 75%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.5s infinite;
}

@keyframes skeletonPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========================================================
   SEARCH TAB
   ======================================================== */
.search-box-sticky {
  position: sticky;
  top: 0;
  background: var(--bg-base);
  padding: 4px 0 12px 0;
  z-index: 5;
}

.search-input-wrapper {
  background-color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  gap: 10px;
}

.search-icon {
  color: #000;
  flex-shrink: 0;
}

.search-input-wrapper input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 15px;
  font-weight: 500;
  color: #000;
}

.search-input-wrapper input::placeholder {
  color: #555;
}

.clear-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: #777;
  cursor: pointer;
  padding: 0 4px;
}

.search-type-chips {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.search-type-chip {
  background: #282828;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.search-type-chip:hover {
  background: #383838;
}

.search-type-chip.active {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.browse-categories h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 16px 0 12px 0;
}

.genre-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.genre-card {
  height: 90px;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  transition: transform 0.15s ease;
}

.genre-card:active {
  transform: scale(0.97);
}

.genre-card span {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Listas de Pistas (Track List) */
.results-container h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 16px 0 10px 0;
}

.track-list {
  display: flex;
  flex-direction: column;
}

.track-item {
  display: flex;
  align-items: center;
  padding: 8px 0;
  cursor: pointer;
  gap: 12px;
  border-radius: 6px;
}

.track-item:active {
  background-color: rgba(255, 255, 255, 0.05);
}

.track-thumb {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.track-info {
  flex: 1;
  min-width: 0;
}

.track-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.track-item.playing .track-name {
  color: var(--spotify-green);
}

.track-meta {
  font-size: 12px;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-action-btn {
  background: none;
  border: none;
  color: var(--text-sub);
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.track-action-btn:active {
  color: var(--text-base);
}

/* Loading Spinner */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  gap: 14px;
  color: var(--text-sub);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--spotify-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================================
   LIBRARY TAB
   ======================================================== */
.library-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.library-header h2 {
  font-size: 22px;
  font-weight: 700;
}

.icon-btn-round {
  background: none;
  border: none;
  color: var(--text-base);
  cursor: pointer;
  padding: 6px;
}

.playlist-row-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
  cursor: pointer;
}

.playlist-row-card:active {
  opacity: 0.8;
}

.playlist-cover-gradient {
  width: 60px;
  height: 60px;
  border-radius: 4px;
  background: linear-gradient(135deg, #450af5, #8e8ee5);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.playlist-cover-img {
  width: 60px;
  height: 60px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background-color: var(--bg-card);
}

.playlist-row-info {
  flex: 1;
  min-width: 0;
}

.playlist-row-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-base);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-row-owner {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #1DB954;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-row-sub {
  font-size: 13px;
  color: var(--text-sub);
}

/* ========================================================
   DETAIL VIEW (PLAYLIST)
   ======================================================== */
.detail-view {
  padding: 12px 16px 40px 16px;
  animation: fadeIn 0.2s ease;
}

.detail-header-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.detail-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 24px;
}

.detail-cover-container {
  width: 180px;
  height: 180px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  margin-bottom: 16px;
  background: linear-gradient(135deg, #450af5, #8e8ee5);
}

.detail-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-hero h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.detail-hero p {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 16px;
}

.detail-hero .detail-owner {
  font-size: 13px;
  font-weight: 600;
  color: #1DB954;
  margin-top: -2px;
  margin-bottom: 4px;
}

.detail-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-primary-play {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-color: var(--spotify-green);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(29, 185, 84, 0.4);
  transition: transform 0.15s ease;
}

.btn-primary-play:active {
  transform: scale(0.94);
}

.btn-shuffle-secondary {
  background: none;
  border: none;
  color: var(--text-sub);
  cursor: pointer;
  padding: 8px;
}

/* Buscador dentro de playlist y favoritas */
.detail-search-wrapper {
  width: 100%;
  max-width: 460px;
  margin-top: 18px;
  position: relative;
}

.detail-search-box {
  display: flex;
  align-items: center;
  background: #242424;
  border: 1px solid #333;
  border-radius: 20px;
  padding: 8px 14px;
  gap: 10px;
  transition: border-color 0.2s, background 0.2s;
}

.detail-search-box:focus-within {
  border-color: #1DB954;
  background: #282828;
}

.detail-search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 13px;
  width: 100%;
  font-family: inherit;
}

.detail-search-box input::placeholder {
  color: #888;
}

.btn-clear-detail-search {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 14px;
  line-height: 1;
  border-radius: 50%;
  transition: color 0.15s;
}

.btn-clear-detail-search:hover {
  color: #fff;
}

.detail-search-count {
  font-size: 11px;
  color: #1DB954;
  font-weight: 600;
  margin-top: 5px;
  text-align: left;
  padding-left: 14px;
}

/* ========================================================
   MINI PLAYER (FLOTANTE SOBRE BOTTOM NAV)
   ======================================================== */
.mini-player {
  position: absolute;
  bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 8px);
  left: 8px;
  right: 8px;
  background-color: #282828;
  border-radius: 8px;
  height: var(--mini-player-height);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 20;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.mini-progress-bar {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  position: relative;
  transition: height 0.1s ease;
}

.mini-progress-bar:hover, .mini-progress-bar:active {
  height: 6px;
}

.mini-progress-fill {
  width: 0%;
  height: 100%;
  background-color: #fff;
  transition: width 0.15s linear;
}

.mini-player-body {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 10px;
}

.mini-song-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.mini-thumb {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.mini-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mini-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-artist {
  font-size: 11px;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mini-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-btn.favorited {
  color: var(--spotify-green);
}

/* ========================================================
   FULL SCREEN PLAYER MODAL
   ======================================================== */
.full-player-sheet {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, #2c253b 0%, #121212 50%, #121212 100%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-top) + 12px) 24px calc(var(--safe-bottom) + 16px) 24px;
  animation: slideUp 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.full-player-sheet.sliding-down {
  animation: slideDown 0.25s cubic-bezier(0.9, 0.1, 1, 0.2) forwards;
}

@keyframes slideDown {
  from { transform: translateY(0); }
  to { transform: translateY(100%); }
}

.full-player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.full-header-titles {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.full-context-from {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-sub);
}

.full-context-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.full-player-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.full-artwork-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 340px;
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
  background-color: var(--bg-card);
  position: relative;
}

.artwork-tap-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 5;
  cursor: pointer;
}
.artwork-tap-zone.tap-left {
  left: 0;
}
.artwork-tap-zone.tap-right {
  right: 0;
}

.seek-feedback {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 700;
  pointer-events: none;
  z-index: 10;
  backdrop-filter: blur(4px);
}

.skip-10-btn {
  color: var(--text-sub);
  transition: color 0.15s ease, transform 0.1s ease;
}

.skip-10-btn:active {
  color: #fff;
  transform: scale(0.9);
}

.full-artwork {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.full-track-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
}

.full-titles {
  flex: 1;
  min-width: 0;
}

.full-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.full-artist {
  font-size: 15px;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.heart-btn.favorited {
  color: var(--spotify-green);
}

/* Scrubber / Slider */
.full-progress-container {
  margin-top: 18px;
}

.spotify-slider {
  width: 100%;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.2);
  height: 4px;
  border-radius: 2px;
  outline: none;
}

.spotify-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background-color: #fff;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.spotify-slider:active::-webkit-slider-thumb {
  transform: scale(1.4);
}

.time-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-sub);
  margin-top: 6px;
}

/* Controles de reproducción */
.full-main-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0;
}

.control-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-btn.active, .control-btn.active svg {
  color: var(--spotify-green) !important;
  fill: var(--spotify-green) !important;
  filter: drop-shadow(0 0 6px rgba(29, 185, 84, 0.7));
}

.control-btn.active {
  position: relative;
}

.control-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0px;
  width: 5px;
  height: 5px;
  background-color: var(--spotify-green);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--spotify-green);
}

.btn-shuffle-secondary.active {
  color: var(--spotify-green) !important;
  background: rgba(29, 185, 84, 0.2);
  border-radius: 50%;
}
.btn-shuffle-secondary.active svg {
  fill: var(--spotify-green) !important;
}

.play-btn-large {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.1s ease;
}

.play-btn-large:active {
  transform: scale(0.92);
}

/* Acciones inferiores (Letras, Cola, Añadir) */
.full-bottom-actions {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-top: 8px;
}

.action-pill-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-base);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.action-pill-btn:active {
  background: rgba(255, 255, 255, 0.16);
}

/* ========================================================
   BOTTOM SHEETS & MODALS
   ======================================================== */
.modal-sheet {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 60;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  animation: fadeIn 0.2s ease;
}

.sheet-content {
  background: var(--bg-elevated);
  border-radius: 16px 16px 0 0;
  max-height: 80%;
  display: flex;
  flex-direction: column;
  padding: 16px 20px calc(var(--safe-bottom) + 20px) 20px;
  animation: slideUp 0.25s ease;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.sheet-header h3 {
  font-size: 17px;
  font-weight: 700;
}

.btn-close-sheet {
  background: none;
  border: none;
  font-size: 26px;
  color: var(--text-sub);
  cursor: pointer;
}

.queue-body {
  overflow-y: auto;
  max-height: 400px;
}

.queue-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  margin: 12px 0 8px 0;
}

.lyrics-body {
  overflow-y: auto;
  max-height: 450px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.8;
  color: #fff;
  white-space: pre-wrap;
  padding-bottom: 20px;
}

.lyrics-loading {
  color: var(--text-sub);
  font-size: 14px;
}

/* Dialogos emergentes */
.modal-dialog {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

.dialog-card {
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dialog-card h3 {
  font-size: 18px;
  font-weight: 700;
}

.dialog-card p {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.4;
}

.dialog-input {
  background: #333;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 10px 14px;
  color: #fff;
  font-size: 15px;
  outline: none;
}

.dialog-input:focus {
  border-color: var(--spotify-green);
}

.dialog-playlist-list {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dialog-pl-item {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.dialog-pl-item:active {
  background: rgba(29, 185, 84, 0.2);
}

.dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.btn-primary-small {
  background: var(--spotify-green);
  color: #000;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn-secondary-full {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-text-cancel {
  background: none;
  border: none;
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
}

/* Tarjeta QR */
.qr-card {
  align-items: center;
  text-align: center;
}

.qr-box {
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.url-badge {
  background: #000;
  color: var(--spotify-green);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-family: monospace;
  word-break: break-all;
}

.pwa-tip {
  font-size: 12px;
  color: #aaa;
}

/* Toast */
.toast {
  position: absolute;
  bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 70px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  color: #000;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 99;
  white-space: nowrap;
  animation: fadeIn 0.2s ease;
}

/* ========================================================
   BOTTOM NAVIGATION (BARRA INFERIOR)
   ======================================================== */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bottom-nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.8) 0%, rgba(0, 0, 0, 0.95) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 15;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-item {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 16px;
  transition: color 0.15s ease;
}

.nav-item span {
  font-size: 10px;
  font-weight: 600;
}

.nav-item.active {
  color: #fff;
}

.hidden {
  display: none !important;
}

/* ========================================================
   EQ / CALIDAD DE AUDIO MODAL
   ======================================================== */
.eq-dialog-card {
  max-width: 400px;
}

.eq-badge-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(29, 185, 84, 0.1);
  border: 1px solid rgba(29, 185, 84, 0.3);
  padding: 10px 14px;
  border-radius: 8px;
}

.hd-badge {
  font-size: 13px;
  font-weight: 800;
  color: var(--spotify-green);
  letter-spacing: 0.5px;
}

.hd-sub {
  font-size: 11px;
  color: #bbb;
}

.eq-presets-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.eq-preset-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.eq-preset-card:active {
  transform: scale(0.98);
}

.eq-preset-card.active {
  background: rgba(29, 185, 84, 0.15);
  border-color: var(--spotify-green);
}

.eq-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.eq-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.eq-preset-card.active .eq-name {
  color: var(--spotify-green);
}

.eq-tag {
  font-size: 10px;
  font-weight: 700;
  background: var(--spotify-green);
  color: #000;
  padding: 2px 8px;
  border-radius: 10px;
}

.eq-desc {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.3;
}

/* ========================================================
   PERSONALIZAR INICIO MODAL & SMART SECTION
   ======================================================== */
.section-title-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  padding-right: 8px;
}

.section-title-wrap h2,
.section-title-wrap .section-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-subtitle {
  font-size: 11px;
  font-weight: 600;
  color: var(--spotify-green);
  margin-top: 1px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rail-header-actions {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
  flex-wrap: nowrap !important;
}

.btn-edit-rail,
.btn-delete-rail {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-sub);
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  padding: 0;
}

.btn-edit-rail:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--spotify-green);
  transform: scale(1.06);
}

.btn-delete-rail:hover {
  background: rgba(255, 82, 82, 0.2);
  color: #ff5252;
  border-color: rgba(255, 82, 82, 0.4);
  transform: scale(1.06);
}

.customize-home-card {
  max-width: 440px;
}

.custom-row-selector-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.row-selector-tab {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-sub);
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.row-selector-tab.active {
  background: var(--spotify-green);
  color: #000;
  border-color: var(--spotify-green);
  font-weight: 700;
}

.genre-chips-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
  padding: 4px 0;
}

.genre-pick-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 5px 11px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.genre-pick-chip:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.genre-pick-chip.selected {
  background: var(--spotify-green);
  color: #000;
  border-color: var(--spotify-green);
  font-weight: 700;
}

.chip-customize {
  border: 1px dashed rgba(29, 185, 84, 0.6);
  background: rgba(29, 185, 84, 0.1);
  color: #1ed760;
  font-weight: 600;
}
.chip-customize:hover {
  background: rgba(29, 185, 84, 0.2);
}

.btn-random-pick {
  background: rgba(29, 185, 84, 0.15);
  border: 1px solid var(--spotify-green);
  color: var(--spotify-green);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-random-pick:hover {
  background: var(--spotify-green);
  color: #000;
}

.share-dialog-card {
  text-align: center;
  max-width: 360px;
}

#modal-shared-song {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 999999 !important;
  background: rgba(0, 0, 0, 0.85) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px !important;
}

#modal-shared-song.hidden {
  display: none !important;
}

.share-icon-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(29, 185, 84, 0.15);
  border: 2px solid var(--spotify-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 12px auto;
}

/* ========================================================
   SPOTIFY IMPORTER STYLES
   ======================================================== */
.spotify-banner-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(30, 215, 96, 0.12) 0%, rgba(18, 18, 18, 0.8) 100%);
  border: 1px solid rgba(30, 215, 96, 0.3);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.spotify-banner-card:hover {
  background: linear-gradient(135deg, rgba(30, 215, 96, 0.2) 0%, rgba(24, 24, 24, 0.9) 100%);
  border-color: var(--spotify-green);
  transform: translateY(-1px);
}

.spotify-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.spotify-logo-badge {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(30, 215, 96, 0.4);
}

.spotify-banner-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.spotify-banner-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
}

.spotify-banner-desc {
  font-size: 11px;
  color: var(--text-sub);
  line-height: 1.3;
}

.btn-spotify-pill {
  background: var(--spotify-green);
  color: #000;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.btn-spotify-pill:hover {
  transform: scale(1.05);
}

.spotify-import-card {
  max-width: 480px;
}

.spotify-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.guide-steps-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 12px;
  line-height: 1.5;
}

.guide-steps-box ol {
  margin: 6px 0 0 18px;
  padding: 0;
  color: var(--text-sub);
}

.guide-steps-box li {
  margin-bottom: 4px;
}

.guide-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--spotify-green);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.external-link {
  color: var(--spotify-green);
  text-decoration: underline;
  font-weight: 600;
}

.dialog-textarea {
  width: 100%;
  background: #282828;
  border: 1px solid #404040;
  border-radius: 6px;
  color: #fff;
  padding: 8px 12px;
  font-size: 12px;
  font-family: inherit;
  resize: vertical;
}

.dialog-textarea:focus {
  outline: none;
  border-color: var(--spotify-green);
}

.file-selected-text {
  display: block;
  font-size: 11.5px;
  color: var(--spotify-green);
  margin-top: 6px;
  font-weight: 600;
}

.detected-summary-box {
  background: rgba(30, 215, 96, 0.1);
  border: 1px solid rgba(30, 215, 96, 0.3);
  border-radius: 8px;
  padding: 12px 14px;
  text-align: center;
}

.detected-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.detected-badge {
  display: inline-block;
  background: var(--spotify-green);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
}

.dest-radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  color: #ddd;
}

.dest-radio-label input[type="radio"] {
  accent-color: var(--spotify-green);
  width: 16px;
  height: 16px;
}

.import-progress-wrap {
  padding: 16px 4px;
  text-align: center;
}

.import-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--spotify-green);
  border-radius: 4px;
  transition: width 0.25s ease;
}

.current-importing-track {
  font-size: 12px;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 8px;
}

.complete-icon {
  font-size: 40px;
  text-align: center;
  margin-bottom: 8px;
}

/* Botón Añadir Más Filas en Inicio */
.add-rail-box {
  margin: 18px 0 36px 0;
  text-align: center;
}

.btn-add-rail {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px dashed rgba(29, 185, 84, 0.6);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-add-rail:hover {
  background: rgba(29, 185, 84, 0.15);
  border-color: var(--spotify-green);
  color: var(--spotify-green);
  transform: translateY(-2px);
}

.btn-delete-rail {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.15s ease;
}

.btn-delete-rail:hover {
  color: #ff4d4d;
  background: rgba(255, 77, 77, 0.15);
}

/* Banner de Canciones Pendientes / No Encontradas en Biblioteca */
.unmatched-banner-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(255, 179, 0, 0.12) 0%, rgba(18, 18, 18, 0.8) 100%);
  border: 1px solid rgba(255, 179, 0, 0.35);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.unmatched-banner-card:hover {
  background: linear-gradient(135deg, rgba(255, 179, 0, 0.22) 0%, rgba(24, 24, 24, 0.9) 100%);
  border-color: #ffb300;
}

.unmatched-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.unmatched-warning-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.unmatched-banner-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.unmatched-banner-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffb300;
}

.unmatched-banner-desc {
  font-size: 11px;
  color: var(--text-sub);
}

.btn-warning-pill {
  background: #ffb300;
  color: #000;
  border: none;
  border-radius: 18px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

/* Modal de Listas No Encontradas */
.unmatched-dialog-card {
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.unmatched-lists-container {
  overflow-y: auto;
  max-height: 55vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 4px;
}

.unmatched-list-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px;
}

.unmatched-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 8px;
}

.unmatched-header-title-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.unmatched-list-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.unmatched-list-date {
  font-size: 10.5px;
  color: var(--text-sub);
}

.btn-delete-unmatched-list {
  background: rgba(255, 77, 77, 0.1);
  border: 1px solid rgba(255, 77, 77, 0.3);
  color: #ff6b6b;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-delete-unmatched-list:hover {
  background: #ff4d4d;
  color: #fff;
}

.unmatched-tracks-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.unmatched-track-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
  padding: 6px 10px;
  border-radius: 6px;
  gap: 8px;
}

.unmatched-track-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}

.unmatched-track-title {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unmatched-track-artist {
  font-size: 10.5px;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-search-manual-pill {
  background: rgba(29, 185, 84, 0.15);
  border: 1px solid var(--spotify-green);
  color: var(--spotify-green);
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-search-manual-pill:hover {
  background: var(--spotify-green);
  color: #000;
}

/* ========================================================
   OFFLINE DOWNLOADS & CIRCULAR PROGRESS RING (ESTILO CHROME)
   ======================================================== */

.download-btn,
.btn-download-control,
.btn-download-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  padding: 0;
  outline: none;
  box-sizing: border-box;
  transition: transform 0.15s ease, opacity 0.2s ease;
  overflow: visible;
}

.download-btn:hover,
.btn-download-control:hover,
.btn-download-track:hover {
  transform: scale(1.08);
}

.download-btn:active,
.btn-download-control:active,
.btn-download-track:active {
  transform: scale(0.95);
}

.dl-btn-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* El SVG circular que rodea al icono (estilo Chrome) */
.dl-ring-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: rotate(-90deg); /* Empieza arriba a las 12 en punto */
  opacity: 0;
  display: none;
  transition: opacity 0.2s ease;
  overflow: visible;
}

/* Pista de fondo del círculo (línea tenue de guía) */
.dl-ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 2.8;
}

/* Línea animada que recorre todo el círculo alrededor indicando progreso */
.dl-ring-bar {
  fill: none;
  stroke: #1DB954;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-dasharray: 97.4;
  stroke-dashoffset: 97.4; /* 0% */
  transition: stroke-dashoffset 0.14s ease-out;
}

/* Icono de flecha en el centro */
.dl-arrow-icon {
  position: relative;
  z-index: 1;
  transition: fill 0.2s ease, transform 0.2s ease;
  fill: currentColor;
}

/* 1. NO DESCARGADO: Flecha en verde Spotify, sin línea alrededor */
.not-downloaded {
  color: #1DB954 !important;
}
.not-downloaded .dl-arrow-icon {
  fill: #1DB954 !important;
}
.not-downloaded .dl-ring-svg {
  opacity: 0 !important;
  display: none !important;
}

/* 2. DESCARGANDO: La línea alrededor se crea y va recorriendo todo el icono */
.is-downloading {
  color: #1DB954 !important;
}
.is-downloading .dl-arrow-icon {
  fill: #1DB954 !important;
  transform: scale(0.92);
}
.is-downloading .dl-ring-svg {
  opacity: 1 !important;
  display: block !important;
}

/* 3. YA DESCARGADO: La línea alrededor desaparece por completo y el icono pasa a gris */
.downloaded {
  color: #888888 !important;
  opacity: 0.85;
}
.downloaded .dl-arrow-icon {
  fill: #888888 !important;
}
.downloaded .dl-ring-svg {
  opacity: 0 !important;
  display: none !important;
}

/* Tamaños específicos por componente */

/* Botón en Full Player */
#full-btn-download {
  width: 40px;
  height: 40px;
}
#full-btn-download .dl-arrow-icon {
  width: 20px;
  height: 20px;
}

/* Botón descargar lista completa en vista detalle */
.btn-download-control {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.btn-download-control:hover {
  background: rgba(255, 255, 255, 0.15);
}
.btn-download-control.downloaded {
  border-color: rgba(255, 255, 255, 0.08);
}
.btn-download-control .dl-arrow-icon {
  width: 22px;
  height: 22px;
}

/* Botón individual de descarga en filas de canciones */
.btn-download-track {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  margin-right: 2px;
}
.btn-download-track .dl-arrow-icon {
  width: 17px;
  height: 17px;
}

.track-actions-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
