/* General container */
.songs-list-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
}

/* Individual song item - merged two definitions */
.song-item {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
  transition: all 0.3s ease;
  width: 100%;
  margin-bottom: 15px;
  padding: 15px;
}

/* Merged hover states */
.song-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

/* Merged inner container styles */
.song-item-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

/* Merged song cover styles */
.song-cover {
  width: 60px;
  height: 60px;
  margin-right: 15px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
}

/* Merged image styles */
.song-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.song-cover-placeholder {
  width: 100%;
  height: 100%;
  background-color: #f5f5f5;
  border-radius: 4px;
}

/* Merged song information styles */
.song-info {
  flex: 1;
  min-width: 150px;
  margin-right: 15px;
}

/* Merged song title styles */
.song-title {
  margin: 0 0 5px 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Merged song artist styles */
.song-artist {
  margin: 0 0 3px;
  font-size: 14px;
  color: #777;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-genre {
  display: inline-block;
  font-size: 12px;
  background: #f5f5f5;
  padding: 2px 8px;
  border-radius: 12px;
  color: #555;
}

/* Merged cart icon styles */
.song-cart-icon {
  margin-left: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 8px;
  transition: all 0.3s ease;
}

.song-cart-icon:hover {
  color: #923131;
}

.song-cart-icon a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #f5f5f5;
  border-radius: 50%;
  color: #333;
  transition: all 0.2s ease;
  text-decoration: none;
}

.song-cart-icon a:hover {
  background: #923131;
  color: white;
}

/* No songs found message */
.no-songs-found {
  padding: 30px;
  text-align: center;
  background: #f9f9f9;
  border-radius: 8px;
  color: #666;
}

/* AJAX error messages */
.songs-ajax-error {
  padding: 15px;
  margin: 10px 0;
  background-color: #fff5f5;
  border-left: 4px solid #e53e3e;
  color: #c53030;
  border-radius: 4px;
}

/* Modern player styles */
.song-preview-player {
  flex: 1;
  min-width: 280px;
  position: relative;
  padding: 5px 0;
  margin: 0 15px;
  display: flex;
  align-items: center;
}

.player-controls {
  display: flex;
  align-items: center;
  width: 100%;
}

.play-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #923131;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 12px;
  flex-shrink: 0;
  transition: all 0.2s ease;
  padding: 0;
  outline: none;
}

.play-button:hover {
  background: #19191B;
  transform: scale(1.05);
}

.play-button i {
  color: #ffffff;
}

.pause-icon {
  display: none;
}

.play-button.playing .play-icon {
  display: none;
}

.play-button.playing .pause-icon {
  display: block;
}

.waveform-container {
  flex: 1;
  height: 40px;
  width: 100%;
  border-radius: 4px;
  overflow: hidden;
  background: #f5f5f5;
}

/* Timer styles */
.timer {
  margin-left: 12px;
  font-size: 12px;
  color: #777;
  flex-shrink: 0;
  min-width: 80px;
  text-align: right;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.timer.timer-visible {
  opacity: 1;
}

.time-separator {
  color: #aaa;
  margin: 0 2px;
}

.current-time, .total-time {
  display: inline-block;
}

/* Additional styles for user state differentiation */
.song-preview-player[data-logged-in="1"] .waveform-container {
  border: 1px solid #e0e0e0;
}

.preview-badge {
  position: absolute;
  bottom: -20px;
  left: 48px;
  background: #f8f8f8;
  color: #777;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  border: 1px solid #eaeaea;
}

/* Merged responsive adjustments */
@media (max-width: 767px) {
  .song-item-inner {
    align-items: flex-start;
  }
  
  .song-cover {
    margin-right: 10px;
    margin-bottom: 10px;
  }
  
  .song-info {
    margin-bottom: 10px;
    width: 100%;
    margin-right: 0;
  }
  
  .song-preview-player {
    margin: 10px 0;
    width: 100%;
  }
  
  .song-cart-icon {
    margin-top: 10px;
    align-self: center;
  }
}

/* Loading state styling */
.song-preview-player.loading .play-button {
  opacity: 0.5;
  pointer-events: none;
}

.song-preview-player.loading .waveform-container {
  position: relative;
}

.song-preview-player.loading .waveform-container::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-top-color: #923131;
  border-radius: 50%;
  animation: player-loading 0.8s linear infinite;
}

@keyframes player-loading {
  to {
    transform: rotate(360deg);
  }
}

/* Placeholder animation for waveform before playing */
.waveform-container.idle-animation {
  position: relative;
  background: #f5f5f5;
  overflow: hidden;
}

.waveform-container.idle-animation::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    to right,
    transparent,
    transparent 2px,
    #19191b10 2px,
    #19191b10 4px
  );
}

.waveform-container.idle-animation .music-bars {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}

.waveform-container.idle-animation .bar {
  background-color: #923131;
  width: 3px;
  margin: 0 2px;
  border-radius: 3px;
  animation: sound-wave 1.5s infinite ease-in-out;
}

.waveform-container.idle-animation .bar:nth-child(1) {
  height: 30%;
  animation-delay: 0.2s;
}

.waveform-container.idle-animation .bar:nth-child(2) {
  height: 45%;
  animation-delay: 0.6s;
}

.waveform-container.idle-animation .bar:nth-child(3) {
  height: 70%;
  animation-delay: 0.3s;
}

.waveform-container.idle-animation .bar:nth-child(4) {
  height: 20%;
  animation-delay: 0.4s;
}

.waveform-container.idle-animation .bar:nth-child(5) {
  height: 55%;
  animation-delay: 0.1s;
}

.waveform-container.idle-animation .bar:nth-child(6) {
  height: 35%;
  animation-delay: 0.8s;
}

.waveform-container.idle-animation .bar:nth-child(7) {
  height: 60%;
  animation-delay: 0.5s;
}

@keyframes sound-wave {
  0%, 100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(0.7);
  }
}

/* Pagination styles */
.songs-pagination {
  margin-top: 30px;
  text-align: center;
}

.songs-pagination-links .page-numbers {
  display: inline-block;
  padding: 8px 12px;
  margin: 0 3px;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-decoration: none;
  color: #333;
}

.songs-pagination-links .page-numbers.current {
  background: #923131;
  color: white;
  border-color: #923131;
}