/* Estilos para el modal de descargas - Versión optimizada */

/* Estilos base del modal */
.modalOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease-out;
}

.descargarModal {
  background: rgb(2, 2, 2);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 1px 1px rgba(255, 255, 255, 0.1) inset;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1px solid rgb(34, 29, 29);
  width: 100%;
}

.desktopModal {
  width: 520px;
  max-height: 85vh;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobileModal {
  width: 100%;
  max-height: 90vh;
  border-radius: 20px 20px 0 0;
  position: absolute;
  bottom: 0;
  animation: slideUpMobile 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Encabezado del modal */
.modalHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(to right, rgba(59, 130, 246, 0.03), rgba(37, 99, 235, 0.06));
}

.modalTitle {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  letter-spacing: -0.5px;
}

.closeButton {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.closeButton:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Información de la pista */
.trackInfo {
  display: flex;
  padding: 20px;
  background: linear-gradient(135deg, rgba(30, 30, 40, 0.9), rgba(20, 20, 30, 0.95));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.albumCover {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  overflow: hidden;
  margin-right: 18px;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  transform: translateZ(0);
  transition: transform 0.3s ease;
}

.albumCover:hover {
  transform: translateY(-3px);
}

.albumCover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.trackDetails {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.trackTitle {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.artistName, .albumName {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.3px;
}

.albumName {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
}

/* Contenido principal */
.modalContent {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  max-height: 60vh;
}

.sectionTitle {
  font-size: 16px;
  font-weight: 600;
  color: #ddd;
  margin: 0 0 16px;
  letter-spacing: -0.3px;
}

/* Selector de formato */
.formatSelector {
  margin-bottom: 16px;
}

/* Dropdowns compactos */
.dropdownGroup {
  margin-bottom: 14px;
  position: relative;
}

.dropdownLabel {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

/* Custom dropdown trigger */
.dropdownTrigger {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dropdownTrigger:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
}

.dropdownTriggerOpen {
  border-color: rgba(255, 255, 255, 0.2);
}

.dropdownTrigger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dropdownTriggerText {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdownTrigger ion-icon {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
}

/* Dropdown menu */
.dropdownMenu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #1a1a1d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 4px;
  z-index: 10;
  box-shadow: none;
  animation: fadeIn 0.15s ease-out;
  max-height: 200px;
  overflow-y: auto;
}

.dropdownItem {
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s ease;
}

.dropdownItem:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dropdownItemActive {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.dropdownItemActive:hover {
  background: rgba(255, 255, 255, 0.12);
}

.dropdownItem ion-icon {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
}

.formatOptions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Categorías */
.categoryContainer {
  margin-bottom: 20px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.categoryHeader {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.categoryName {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: #ffffff;
}

.categoryDescription {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 3px;
}

/* Formato */
.formatContainer {
  margin-left: 5%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.formatContainer:last-child {
  border-bottom: none;
}

                            
                          
.formatOption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background-color: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: all 0.25s;
  border-radius: 10px;
}

.formatOption:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.formatOption.selectedFormat {
  background-color: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.5);
}

.formatInfo {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.formatName {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.formatDescription {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
}

.formatControls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.formatRadio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.formatOption.selectedFormat .formatRadio {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.radioCircle {
  width: 0;
  height: 0;
  border-radius: 50%;
  background-color: transparent;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.formatOption.selectedFormat .radioCircle {
  width: 10px;
  height: 10px;
  background-color: #3b82f6;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.6);
}

.expandIcon {
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.3s ease;
}

.formatOption:hover .expandIcon {
  color: rgba(255, 255, 255, 0.8);
}

/* Selector de calidad */
.qualitySelector {
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.qualityHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background-color: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: all 0.25s;
  user-select: none;
}

.qualityHeader:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.qualityHeader ion-icon {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.3s ease;
}

.qualityHeader:hover ion-icon {
  color: rgba(255, 255, 255, 0.8);
}

.qualityHeader .dropdownLabel {
  margin-bottom: 0;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.qualityOptions {
  display: flex;
  flex-direction: column;
  padding: 8px;
}

.qualityOption {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.04);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.25s;
  border: 1px solid transparent;
}

.qualityOption:hover {
  background-color: rgba(255, 255, 255, 0.07);
}

.qualityOption.selected {
  background-color: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.4);
}

.qualityOption.defaultQuality {
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3);
}

.qualityRadio {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.qualityOption.selected .qualityRadio {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.qualityOption.selected .radioCircle {
  width: 8px;
  height: 8px;
  background-color: #3b82f6;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.4);
}

.qualityInfo {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.qualityName {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 6px;
}

.qualityDetails {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 3px;
}

.qualitySize {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-left: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 7px;
  border-radius: 4px;
}

.qualityOption:hover .qualitySize {
  color: rgba(255, 255, 255, 0.7);
}

/* Badges para calidades */
.qualityBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.badgeHiRes {
  background: linear-gradient(135deg, #e2b14a, #daa520);
  color: #fff;
}

.badgeHd {
  background: linear-gradient(135deg, #4aa1e2, #3b82f6);
  color: #fff;
}

.badgeFlac {
  background: linear-gradient(135deg, #4ae267, #10b981);
  color: #fff;
}

.badgeStudio {
  background: linear-gradient(135deg, #e94c54, #c92a2a);
  color: #fff;
}

.badgeDSD {
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
  color: #fff;
}

.defaultLabel {
  font-size: 11px;
  color: #3b82f6;
  font-weight: normal;
  margin-left: 6px;
  opacity: 0.9;
}

/* Checkbox de preferencia */
.preferenceCheckbox {
  margin: 16px 0;
}

.checkboxLabel {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

.checkboxLabel input {
  margin-right: 10px;
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
  position: relative;
  cursor: pointer;
}

.checkboxLabel input:checked {
  background-color: #3b82f6;
  border-color: #3b82f6;
}

.checkboxLabel input:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkboxLabel:hover input {
  border-color: rgba(255, 255, 255, 0.5);
}

/* Botones de acción */
.actionButtons {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.downloadButtonA {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.downloadButtonA:hover {
  background: linear-gradient(135deg, #4f8df8, #3060e9);
}

.downloadButtonA:active {
}

.downloadButtonA:disabled {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  cursor: not-allowed;
  transform: none;
}

.downloadButtonA ion-icon {
  font-size: 18px;
  transition: transform 0.2s ease;
}

.downloadButtonA:hover ion-icon {
  transform: translateY(-2px);
}

.cancelButton {
  padding: 12px 20px;
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cancelButton:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.cancelButton:active {
  transform: translateY(1px);
}

.retryButton {
  background: linear-gradient(135deg, #4b5563, #374151);
  color: #fff;
  border: none;
  padding: 9px 18px;
  margin-top: 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-weight: 500;
  font-size: 14px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.retryButton:hover {
  background: linear-gradient(135deg, #5b6675, #404756);
  transform: translateY(-2px);
}

/* Progreso de descarga */
.downloadProgress {
  margin-top: 24px;
}

.progressContainer {
  height: 8px;
  background-color: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) inset;
}

.progressBar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 4px;
  transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
  position: relative;
}

.progressBar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px 4px 0 0;
}

.progressText {
  display: block;
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
}

/* Mensaje de descarga completada */
.downloadComplete {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
  animation: fadeIn 0.5s ease-out;
}

.downloadComplete ion-icon {
  font-size: 48px;
  color: #10b981;
  margin-bottom: 16px;
  animation: scaleUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1.2);
  filter: drop-shadow(0 4px 8px rgba(16, 185, 129, 0.4));
}

.downloadComplete p {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px;
}

.downloadDetails {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 14px;
  background-color: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  margin-bottom: 18px;
  text-align: center;
  word-break: break-all;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) inset;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.downloadDetails span {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  line-height: 1.4;
}

.downloadDetails span:first-child {
  font-weight: 500;
  color: #fff;
}

/* Mensaje informativo */
.infoMessage {
  padding: 14px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.15));
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 10px;
}

.infoMessage ion-icon {
  color: #64748b;
  font-size: 18px;
  flex-shrink: 0;
}

.infoMessage p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  margin: 0;
  line-height: 1.4;
}

/* Estados de carga y error */
.loadingContainer, .errorContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  text-align: center;
  padding: 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(59, 130, 246, 0.15);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.2);
}

.errorContainer ion-icon {
  font-size: 48px;
  color: #ef4444;
  margin-bottom: 14px;
  filter: drop-shadow(0 2px 6px rgba(239, 68, 68, 0.3));
}

.errorMessage {
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  max-width: 85%;
}

/* Animaciones */
@keyframes scaleUp {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

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

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

@keyframes slideUpMobile {
  from {
    transform: translateY(100%);
    opacity: 0.8;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Media queries para dispositivos móviles */
@media (max-width: 576px) {
  .modalContent {
    padding: 16px;
    max-height: 65vh;
  }
  
  .qualityOption, .formatOption {
    padding: 10px 12px;
  }
  
  .formatName {
    font-size: 14px;
  }
  
  .qualityName {
    font-size: 13px;
  }
  
  .downloadButtonA, .cancelButton {
    padding: 10px 16px;
    font-size: 14px;
  }
  
  .actionButtons {
    flex-direction: column;
  }
  
  .albumCover {
    width: 50px;
    height: 50px;
  }
  
  .trackTitle {
    font-size: 16px;
  }
  
  .artistName {
    font-size: 13px;
  }
  
  .downloadDetails {
    font-size: 12px;
  }
}

/* Estilos para dispositivos de bajo rendimiento */
@media (prefers-reduced-motion: reduce) {
  .modalOverlay, .descargarModal, .formatOption, .qualityOption, 
  .downloadButtonA, .cancelButton, .albumCover, .closeButton {
    animation: none !important;
    transition: opacity 0.1s linear !important;
    transform: none !important;
  }
  
  .spinner {
    animation: spin 1.5s linear infinite !important;
  }
}

/* ─── FASE 2: Panel de éxito ─── */
.successPhase {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.06));
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.2);
  animation: fadeInSuccess 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.successIcon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  animation: scaleUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1.2);
}

.successIcon ion-icon {
  font-size: 38px;
  color: #10b981;
}

.successTitle {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px;
  text-align: center;
}

.anotherDownloadButton {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  margin-top: 8px;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.anotherDownloadButton:hover {
  background-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.anotherDownloadButton ion-icon {
  font-size: 16px;
}

@keyframes fadeInSuccess {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Animación para hacer que el mensaje de éxito entre desde arriba */
@keyframes fadeInDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Mejoras a elementos existentes */

/* Hacer el botón de descarga más atractivo */
.downloadButtonA {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.downloadButtonA::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}

.downloadButtonA:hover::before {
  left: 100%;
}

.downloadButtonA:hover {
  background: linear-gradient(135deg, #4f8df8, #3060e9);
}

/* Hacer que las opciones de calidad sean más interactivas */
.qualityOption {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.04);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.25s;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.qualityOption:hover {
  background-color: rgba(255, 255, 255, 0.07);
  transform: translateX(3px);
}

.qualityOption.selected {
  background-color: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.4);
}

.qualityOption.selected:hover {
  background-color: rgba(59, 130, 246, 0.18);
}

/* Mejoras para móviles */
@media (max-width: 576px) {
  .successPhase {
    padding: 24px 16px;
  }

  .successIcon {
    width: 52px;
    height: 52px;
  }

  .successIcon ion-icon {
    font-size: 30px;
  }

  .successTitle {
    font-size: 14px;
  }
  
  .anotherDownloadButton {
    padding: 8px 16px;
    font-size: 12px;
  }
  
  .downloadButtonA, .cancelButton {
    padding: 12px 16px;
  }
  
  /* Mejorar el scroll en móviles */
  .modalContent {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  }
  
  .modalContent::-webkit-scrollbar {
    width: 6px;
  }
  
  .modalContent::-webkit-scrollbar-track {
    background: transparent;
  }
  
  .modalContent::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
  }
}

/* Mejoras para tablets */
@media (min-width: 577px) and (max-width: 768px) {
  .desktopModal {
    width: 480px;
  }
  
  .modalContent {
    max-height: 55vh;
  }
}

/* Mejoras para pantallas pequeñas en modo horizontal */
@media (max-height: 640px) and (min-width: 576px) {
  .desktopModal {
    max-height: 90vh;
  }
  
  .modalContent {
    max-height: 50vh;
  }
  
  .trackInfo {
    padding: 12px 20px;
  }
  
  .albumCover {
    width: 50px;
    height: 50px;
  }
}

/* Efecto para la barra de progreso */
.progressBar {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  background-size: 200% 100%;
  animation: gradientShift 2s linear infinite;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}


/* Estilos para el tema claro del modal de descargas */

/* Estilos base del modal */
:global(.light-theme) .modalOverlay {
  background-color: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
}

:global(.light-theme) .descargarModal {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Encabezado del modal */
:global(.light-theme) .modalHeader {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: linear-gradient(to right, rgba(59, 130, 246, 0.03), rgba(37, 99, 235, 0.04));
}

:global(.light-theme) .modalTitle {
  color: #1e293b;
}

:global(.light-theme) .closeButton {
  background: rgba(0, 0, 0, 0.04);
  color: #64748b;
}

:global(.light-theme) .closeButton:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #1e293b;
}

/* Información de la pista */
:global(.light-theme) .trackInfo {
  background: linear-gradient(135deg, rgba(240, 240, 250, 0.9), rgba(245, 245, 255, 0.95));
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

:global(.light-theme) .albumCover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

:global(.light-theme) .trackTitle {
  color: #1e293b;
}

:global(.light-theme) .artistName {
  color: rgba(0, 0, 0, 0.8);
}

:global(.light-theme) .albumName {
  color: rgba(0, 0, 0, 0.6);
}

/* Contenido principal */
:global(.light-theme) .sectionTitle {
  color: #1e293b;
}

/* Selector de formato */
:global(.light-theme) .categoryContainer {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

:global(.light-theme) .categoryHeader {
  background: rgba(0, 0, 0, 0.04);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

:global(.light-theme) .categoryName {
  color: #1e293b;
}

:global(.light-theme) .categoryDescription {
  color: rgba(0, 0, 0, 0.6);
}

:global(.light-theme) .formatContainer {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

:global(.light-theme) .formatOption {
  background-color: rgba(0, 0, 0, 0.02);
}

:global(.light-theme) .formatOption:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

:global(.light-theme) .formatOption.selectedFormat {
  background-color: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.3);
}

:global(.light-theme) .formatName {
  color: #1e293b;
}

:global(.light-theme) .formatDescription {
  color: rgba(0, 0, 0, 0.6);
}

:global(.light-theme) .formatRadio {
  border: 2px solid rgba(0, 0, 0, 0.3);
}

:global(.light-theme) .expandIcon {
  color: rgba(0, 0, 0, 0.4);
}

:global(.light-theme) .formatOption:hover .expandIcon {
  color: rgba(0, 0, 0, 0.7);
}

/* Selector de calidad */
:global(.light-theme) .qualitySelector {
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
}

:global(.light-theme) .qualityOption {
  background-color: rgba(0, 0, 0, 0.02);
}

:global(.light-theme) .qualityOption:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

:global(.light-theme) .qualityOption.selected {
  background-color: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.3);
}

:global(.light-theme) .qualityOption.defaultQuality {
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2);
}

:global(.light-theme) .qualityRadio {
  border: 2px solid rgba(0, 0, 0, 0.2);
}

:global(.light-theme) .qualityName {
  color: rgba(0, 0, 0, 0.85);
}

:global(.light-theme) .qualityDetails {
  color: rgba(0, 0, 0, 0.55);
}

:global(.light-theme) .qualitySize {
  color: rgba(0, 0, 0, 0.5);
  background: rgba(0, 0, 0, 0.04);
}

:global(.light-theme) .qualityOption:hover .qualitySize {
  color: rgba(0, 0, 0, 0.7);
}

/* Badge colores se mantienen iguales */

:global(.light-theme) .defaultLabel {
  color: #3b82f6;
}

/* Checkbox de preferencia */
:global(.light-theme) .checkboxLabel {
  color: rgba(0, 0, 0, 0.7);
}

:global(.light-theme) .checkboxLabel input {
  border: 2px solid rgba(0, 0, 0, 0.2);
  background-color: rgba(0, 0, 0, 0.03);
}

:global(.light-theme) .checkboxLabel:hover input {
  border-color: rgba(0, 0, 0, 0.4);
}

/* Botones de acción - Mantenemos colores para botones de acción principales */
:global(.light-theme) .cancelButton {
  background-color: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.85);
}

:global(.light-theme) .cancelButton:hover {
  background-color: rgba(0, 0, 0, 0.08);
  color: #000;
}

:global(.light-theme) .retryButton {
  background: linear-gradient(135deg, #64748b, #475569);
}

:global(.light-theme) .retryButton:hover {
  background: linear-gradient(135deg, #64748b, #334155);
}

/* Progreso de descarga */
:global(.light-theme) .progressContainer {
  background-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) inset;
}

:global(.light-theme) .progressText {
  color: rgba(0, 0, 0, 0.85);
}

/* Mensaje de descarga completada */
:global(.light-theme) .downloadComplete p {
  color: #1e293b;
}

:global(.light-theme) .downloadDetails {
  background-color: rgba(0, 0, 0, 0.04);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) inset;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

:global(.light-theme) .downloadDetails span {
  color: rgba(0, 0, 0, 0.85);
}

:global(.light-theme) .downloadDetails span:first-child {
  color: #1e293b;
}

/* Mensaje informativo */
:global(.light-theme) .infoMessage {
  background: linear-gradient(to right, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.02));
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

:global(.light-theme) .infoMessage ion-icon {
  color: #94a3b8;
}

:global(.light-theme) .infoMessage p {
  color: rgba(0, 0, 0, 0.6);
}

/* Estados de carga y error */
:global(.light-theme) .spinner {
  border: 3px solid rgba(59, 130, 246, 0.15);
  border-top-color: #3b82f6;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.15);
}

:global(.light-theme) .loadingContainer p,
:global(.light-theme) .errorMessage {
  color: rgba(0, 0, 0, 0.9);
}

/* Dropdown selector de formato en light */
:global(.light-theme) .dropdownLabel {
  color: rgba(0, 0, 0, 0.7);
}

:global(.light-theme) .dropdownTrigger {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #1e293b;
}

:global(.light-theme) .dropdownTrigger:hover {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.06);
}

:global(.light-theme) .dropdownTriggerOpen {
  border-color: rgba(0, 0, 0, 0.25);
}

:global(.light-theme) .dropdownTriggerText {
  color: #1e293b;
}

:global(.light-theme) .dropdownTrigger ion-icon {
  color: rgba(0, 0, 0, 0.5);
}

:global(.light-theme) .dropdownMenu {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: none;
}

:global(.light-theme) .dropdownItem {
  color: rgba(0, 0, 0, 0.85);
}

:global(.light-theme) .dropdownItem:hover {
  background: rgba(0, 0, 0, 0.05);
}

:global(.light-theme) .dropdownItemActive {
  background: rgba(0, 0, 0, 0.06);
  color: #1e293b;
}

:global(.light-theme) .dropdownItemActive:hover {
  background: rgba(0, 0, 0, 0.08);
}

/* Calidad header en light */
:global(.light-theme) .qualityHeader {
  background-color: rgba(0, 0, 0, 0.03);
}

:global(.light-theme) .qualityHeader:hover {
  background-color: rgba(0, 0, 0, 0.06);
}

:global(.light-theme) .qualityHeader ion-icon {
  color: rgba(0, 0, 0, 0.5);
}

:global(.light-theme) .qualityHeader:hover ion-icon {
  color: rgba(0, 0, 0, 0.8);
}

:global(.light-theme) .qualityHeader .dropdownLabel {
  color: #1e293b;
}

/* Panel de éxito en tema claro */
:global(.light-theme) .successPhase {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.03));
  border: 1px solid rgba(16, 185, 129, 0.15);
}

:global(.light-theme) .successTitle {
  color: #1e293b;
}

:global(.light-theme) .successIcon {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
}

:global(.light-theme) .anotherDownloadButton {
  background-color: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #475569;
}

:global(.light-theme) .anotherDownloadButton:hover {
  background-color: rgba(0, 0, 0, 0.08);
  color: #1e293b;
}

:global(.light-theme) .downloadDetails {
  background-color: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

:global(.light-theme) .downloadDetails span {
  color: #475569;
}

:global(.light-theme) .downloadDetails span:first-child {
  color: #1e293b;
}

/* Mejora para scrollbar en tema claro */
:global(.light-theme) .modalContent {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

:global(.light-theme) .modalContent::-webkit-scrollbar {
  width: 6px;
}

:global(.light-theme) .modalContent::-webkit-scrollbar-track {
  background: transparent;
}

:global(.light-theme) .modalContent::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}

:global(.light-theme) .modalContent::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.25);
}