/* ============================================
   IMPROVED ICON BUTTONS - COMPACT STYLE
   ============================================ */

/* Icon button animations */
.icon-btn {
  position: relative;
  overflow: hidden;
}

.icon-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}

.icon-btn:active::before {
  width: 100px;
  height: 100px;
}

/* Focus states for accessibility */
.icon-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ============================================
   YOUTUBE THUMBNAIL IMPROVEMENTS
   ============================================ */

/* YouTube thumbnail loading state */
.youtube-preview-card img {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

/* Loading placeholder animation */
.youtube-preview-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(61, 200, 220, 0.05) 0%,
    rgba(61, 200, 220, 0.15) 50%,
    rgba(61, 200, 220, 0.05) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
  z-index: 1;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.youtube-preview-card img[style*="opacity: 1"] ~ *::before,
.youtube-preview-card:has(img[style*="opacity: 1"])::before {
  opacity: 0;
}

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

/* YouTube play overlay stays visible */
.youtube-play-overlay {
  z-index: 10;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

.youtube-preview-card:hover .youtube-play-overlay {
  filter: drop-shadow(0 6px 16px rgba(255, 0, 0, 0.6));
}

/* ============================================
   SPOTIFY EMBED IMPROVEMENTS
   ============================================ */

/* Better loading state - Height is now controlled by aspect-ratio: 16/9 in main CSS */

.spotify-embed-wrapper iframe {
  background: transparent;
}

/* Shimmer loading effect */
.spotify-placeholder::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(30, 215, 96, 0.02) 0%,
    rgba(30, 215, 96, 0.08) 50%,
    rgba(30, 215, 96, 0.02) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* ============================================
   CARD IMAGE IMPROVEMENTS
   ============================================ */

.card-image {
  position: relative;
  width: 100%;
  background: linear-gradient(135deg, #0a0d10 0%, #1a1d22 100%);
  border-radius: 16px;
  overflow: hidden;
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* Use will-change for animated elements */
.icon-btn:hover,
.youtube-preview-card:hover,
.track-section:hover {
  will-change: transform;
}

/* GPU acceleration for smooth animations */
.icon-btn,
.youtube-play-overlay,
.youtube-preview-card img,
.spotify-placeholder-icon {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* ============================================
   ADDITIONAL HOVER EFFECTS
   ============================================ */

/* Card hover enhancement */
.release-card {
  will-change: transform, box-shadow;
}

/* Smooth image loading */
.youtube-preview-card img,
.youtube-thumbnail-large img {
  transition: opacity 0.3s ease, transform 0.4s ease, filter 0.4s ease;
}

/* ============================================
   DARK MODE ENHANCEMENTS
   ============================================ */

@media (prefers-color-scheme: dark) {
  .icon-btn {
    background: rgba(61, 200, 220, 0.15);
    border-color: rgba(61, 200, 220, 0.3);
  }
  
  .icon-btn:hover {
    background: var(--primary);
  }
  
  .icon-btn-spotify {
    background: rgba(30, 215, 96, 0.15);
    border-color: rgba(30, 215, 96, 0.4);
  }
}

/* ============================================
   RESPONSIVE ICON BUTTON ADJUSTMENTS
   ============================================ */

@media (max-width: 640px) {
  .icon-btn svg {
    width: 16px;
    height: 16px;
  }
  
  .card-actions-icons {
    gap: 10px;
  }
  
  .youtube-play-overlay svg {
    width: 56px !important;
    height: 40px !important;
  }
}

/* Tablet adjustments */
@media (min-width: 641px) and (max-width: 1024px) {
  .icon-btn {
    width: 42px;
    height: 42px;
  }
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Better focus states */
.icon-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(61, 200, 220, 0.2);
}

.youtube-preview-card:focus-visible,
.youtube-thumbnail-large:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .icon-btn,
  .youtube-preview-card,
  .spotify-placeholder-icon,
  .track-section {
    transition: none;
    animation: none;
  }
  
  .spotify-placeholder::after,
  .youtube-preview-card::before {
    animation: none;
  }
}

/* ============================================
   DETAIL PAGE ENHANCEMENTS
   ============================================ */

/* Smooth scroll for lyrics */
.lyrics-body {
  scroll-behavior: smooth;
}

/* Better section hover feedback */
.track-section {
  border: 1px solid transparent;
}

.track-section:hover {
  border-color: rgba(61, 200, 220, 0.1);
}

/* Hero action button improvements */
.hero-action-btn {
  position: relative;
  overflow: hidden;
}

.hero-action-btn::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: left 0.5s ease;
}

.hero-action-btn:hover::before {
  left: 100%;
}

/* ============================================
   LOADING STATES
   ============================================ */

/* Skeleton loading for cards */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.04) 0%,
    rgba(0, 0, 0, 0.08) 50%,
    rgba(0, 0, 0, 0.04) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

/* ============================================
   MICRO-INTERACTIONS
   ============================================ */

/* Button press effect */
.icon-btn:active {
  transform: scale(0.95);
}

/* Link hover underline effect */
.read-more-link {
  position: relative;
}

.read-more-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.read-more-link:hover::after {
  width: 100%;
}
