/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */


/* Apple TV-style album hover effects */
[data-album-hover-target="artwork"] {
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

/* Album display fade in animation on page load */
@keyframes albumFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#album_display {
  animation: albumFadeIn 0.5s ease-out;
}

/* Enhanced shadow and lighting effects for Apple TV style */
[data-album-hover-target="artwork"] img,
[data-album-hover-target="artwork"] > div {
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  border-radius: 8px;
}

[data-album-hover-target="artwork"]:hover img,
[data-album-hover-target="artwork"]:hover > div {
  will-change: transform;
  box-shadow:
    0 35px 60px -12px rgba(0, 0, 0, 0.3),
    0 8px 25px -8px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Modal animation enhancements */
[data-controller="modal"] {
  /* Smooth modal backdrop and panel transitions */
}

[data-modal-target="backdrop"] {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition:
    opacity 300ms cubic-bezier(0.4, 0.0, 0.2, 1),
    backdrop-filter 300ms cubic-bezier(0.4, 0.0, 0.2, 1);
}

[data-modal-target="panel"] {
  transition:
    opacity 300ms cubic-bezier(0.4, 0.0, 0.2, 1),
    transform 300ms cubic-bezier(0.4, 0.0, 0.2, 1);
  will-change: transform, opacity;
}

/* Enhanced shadow for modal panels */
[data-modal-target="panel"] {
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(0, 0, 0, 0.05);
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  [data-modal-target="backdrop"],
  [data-modal-target="panel"] {
    transition: none !important;
  }

  #album_display {
    animation: none !important;
  }

  [data-album-hover-target="artwork"] {
    transition: none !important;
  }
}

/* Track listing fade-in animation */
@keyframes trackFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Track listing animations */
[data-track-listing-target="track"] {
  transition:
    background-color 0.2s ease-out,
    transform 0.2s ease-out,
    box-shadow 0.2s ease-out;
  border-radius: 6px;
  cursor: default;
}

[data-track-listing-target="track"]:hover {
  background-color: rgba(59, 130, 246, 0.04);
  transform: translateX(4px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Track position number subtle highlight on hover */
[data-track-listing-target="track"]:hover .text-gray-500 {
  color: rgb(59, 130, 246);
  transition: color 0.2s ease-out;
}

/* Smooth transitions for track titles */
[data-track-listing-target="track"] .text-gray-900 {
  transition: color 0.2s ease-out;
}

[data-track-listing-target="track"]:hover .text-gray-900 {
  color: rgb(17, 24, 39);
}

/* Side selector smooth transitions */
[data-track-listing-target="sideSelector"] {
  transition:
    border-color 0.2s ease-out,
    box-shadow 0.2s ease-out;
}

/* Track list container for smooth height changes */
[data-track-listing-target="trackList"] {
  transition: height 0.3s ease-out;
}

/* Track filtering transitions */
[data-track-listing-target="track"].filtering {
  transform: scale(0.95);
  opacity: 0;
  transition:
    opacity 0.2s ease-out,
    transform 0.2s ease-out;
}

/* Track loading state - for future enhancement */
[data-track-listing-target="track"].loading {
  background: linear-gradient(90deg,
    rgba(229, 231, 235, 0.1) 25%,
    rgba(229, 231, 235, 0.3) 50%,
    rgba(229, 231, 235, 0.1) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Disable track animations for reduced motion users */
@media (prefers-reduced-motion: reduce) {
  [data-track-listing-target="track"],
  [data-track-listing-target="sideSelector"],
  [data-track-listing-target="trackList"] {
    transition: none !important;
  }

  [data-track-listing-target="track"].loading {
    animation: none !important;
  }

  @keyframes trackFadeIn {
    from, to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes shimmer {
    from, to {
      background-position: 0% 0;
    }
  }
}
