/* Estilos Base para el Botón de Descarga */
.downloadButton {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  color: #aaa;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  overflow: hidden;
  z-index: 1;
}

.downloadButton:hover {
  color: #fff;
  transform: translateY(-2px);
}

.downloadButton:active {
  transform: translateY(0);
}

.downloadButton:disabled {
  color: #666;
  cursor: not-allowed;
  transform: none;
}

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

.downloadButton:hover ion-icon {
  transform: scale(1.1);
}

/* Indicador de progreso mejorado */
.downloadIndicator {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  border-radius: 1.5px;
}

.downloadProgress {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  transition: width 0.3s ease;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
  border-radius: 1.5px;
}

/* Estilo para botón completo */
.buttonContent {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  transition: all 0.2s ease;
}

.buttonContent span {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.downloadProgressBar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  border-radius: 2px;
}

.progressFill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

/* Variación para móvil con diseño mejorado */
:global(.celular) .downloadButton {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

:global(.celular) .downloadButton:hover {
  background-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

:global(.celular) .downloadButton:active {
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
}

:global(.celular) .downloadButton ion-icon {
  font-size: 22px;
}

:global(.celular) .downloadButton::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

:global(.celular) .downloadButton:hover::before {
  opacity: 1;
}

/* Variación para desktop con efectos modernos */
:global(.desktop) .downloadButton {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.04);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

:global(.desktop) .downloadButton:hover {
  background-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

:global(.desktop) .downloadButton.full {
  width: auto;
  height: auto;
  padding: 10px 20px;
  border-radius: 8px;
  background-color: rgba(59, 130, 246, 0.15);
}

:global(.desktop) .downloadButton.full:hover {
  background-color: rgba(59, 130, 246, 0.25);
}

:global(.desktop) .downloadButton.full .buttonContent span {
  margin-right: 4px;
}

/* Estado de descarga con animaciones mejoradas */
.downloading {
  color: #3b82f6 !important;
  background-color: rgba(59, 130, 246, 0.1) !important;
}

:global(.desktop) .downloading {
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3), 0 2px 8px rgba(59, 130, 246, 0.2) !important;
}

/* Animación de pulso mejorada */
@keyframes pulse {
  0% {
    opacity: 0.7;
    transform: scale(0.95);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  100% {
    opacity: 0.7;
    transform: scale(0.95);
  }
}

.downloading ion-icon {
  animation: pulse 1.5s infinite ease-in-out;
}

/* Efecto de brillo durante la descarga */
@keyframes glowing {
  0% {
    box-shadow: 0 0 5px rgba(59, 130, 246, 0.3);
  }
  50% {
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
  }
  100% {
    box-shadow: 0 0 5px rgba(59, 130, 246, 0.3);
  }
}

.downloading.full {
  animation: glowing 2s infinite;
}

/* Botón versión completa con gradiente */
.downloadButton.full {
  background: linear-gradient(45deg, rgba(59, 130, 246, 0.85), rgba(37, 99, 235, 0.9));
  color: white;
  padding: 12px 24px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
  font-weight: 600;
  transition: all 0.3s ease;
}

.downloadButton.full:hover {
  background: linear-gradient(45deg, rgba(59, 130, 246, 0.95), rgba(37, 99, 235, 1));
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.downloadButton.full:active {
  transform: translateY(2px);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
}

/* Foco para accesibilidad */
.downloadButton:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.downloadButton:focus:not(:focus-visible) {
  box-shadow: none;
}

/* Soporte para modo oscuro y claro */
@media (prefers-color-scheme: dark) {
  .downloadButton {
    color: #bbb;
  }
  
  .downloadButton:hover {
    color: #fff;
  }
  
  .downloading {
    color: #60a5fa !important;
  }
}

@media (prefers-color-scheme: light) {
  .downloadButton {
    color: #666;
  }
  
  .downloadButton:hover {
    color: #3b82f6;
  }
  
  .downloading {
    color: #2563eb !important;
  }
}

/* Estado de éxito para descargas completadas */
.downloadSuccess {
  color: #10b981 !important;
  background-color: rgba(16, 185, 129, 0.1) !important;
}

.downloadSuccess ion-icon {
  animation: none;
  transform: scale(1.1);
}

/* Media queries para diferentes tamaños de pantalla */
@media (max-width: 768px) {
  .buttonContent span {
    font-size: 14px;
  }
  
  .downloadButton.full {
    padding: 10px 18px;
  }
}

@media (max-width: 480px) {
  :global(.desktop) .downloadButton {
    width: 34px;
    height: 34px;
  }
  
  :global(.celular) .downloadButton {
    width: 42px;
    height: 42px;
  }
  
  .downloadButton ion-icon {
    font-size: 18px;
  }
}