/* Spotify-like styling */
:root {
  --music-primary: #6200ea; /* Use purple from index.css */
  --music-secondary: #b388ff; /* Lighter purple */
  --music-bg-dark: #1a1a1a; /* Slightly lighter dark */
  --music-bg-medium: #282828;
  --music-bg-light: #333333;
  --music-text-primary: #ffffff;
  --music-text-secondary: #b3b3b3;
}

body {
  background-color: var(--music-bg-dark); /* Use new dark bg */
  color: var(--music-text-primary);
  padding-bottom: 100px; /* Add padding to accommodate the player */
}
.navbar {
  transition: transform 0.3s ease, background 0.3s ease, padding 0.3s ease;
  box-shadow: 0 2px 10px rgba(60, 18, 18, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background-color: rgba(26, 26, 26, 0.85); /* var(--music-bg-dark) with alpha */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.navbar-brand {
  font-weight: 700;
  letter-spacing: 0.5px;
}
.nav-item {
  margin: 0 2px;
}
.nav-link {
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 8px 16px !important;
  border-radius: 4px;
  transition: all 0.2s ease;
}
.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}
.nav-link.active {
  background: linear-gradient(to right, rgba(98, 0, 234, 0.2), rgba(98, 0, 234, 0));
  border-left: 3px solid var(--music-primary);
}
.navbar.scrolled {
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  background-color: rgba(20, 20, 20, 0.95) !important; /* Darker on scroll */
}
.artist-header {
  background: linear-gradient(to bottom, rgba(98, 0, 234, 0.7), var(--music-bg-dark));
  padding: 80px 0 40px; /* Increased top padding */
  margin-top: 56px;
  position: relative; /* Needed for potential overlap */
  overflow: hidden; /* Hide gradient overflow */
}

.artist-img {
  width: 220px; /* Larger image */
  height: 220px; /* Larger image */
  object-fit: cover;
  border-radius: 15px; /* Slightly different rounding */
  box-shadow: 0 8px 70px rgba(0,0,0,.6); /* Enhanced shadow */
}

.artist-header .row > div:last-child {
  padding-top: 30px;
}

/* Reset album card heights */
.album-card {
  min-height: auto !important;
  height: auto !important;
  background-color: #181818; /* Or your existing color */
  transition: background-color 0.3s ease;
}

.album-card:hover {
  background-color: #282828; /* Or your existing hover color */
  cursor: pointer;
  transform: translateY(-4px); /* Lift effect on hover */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); /* Add shadow on hover */
  border-color: rgba(255, 255, 255, 0.1); /* Show border on hover */
}

/* Style the container for aspect ratio */
.album-img-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  position: relative;
  overflow: hidden;
  display: block; /* Or inline-block if needed */
  margin-bottom: 0.75rem; /* Add margin below image container */
}

/* Style the image itself to cover the container */
.album-img-container img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
  min-height: auto !important;
}

/* Remove bottom margin from images inside container */
.album-img-container .img-fluid {
  margin-bottom: 0 !important;
}

.album-card:hover .album-img-container img {
  transform: scale(1.05);
}

.album-title {
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-year {
  color: #b3b3b3;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-container {
  position: fixed;
  bottom: 0;
  width: 100%;
  z-index: 90; /* Less than footer z-index */
  background-color: rgba(18, 18, 18, 0.95); /* Slightly transparent */
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.player-controls {
  display: flex;
  justify-content: center;
  align-items: center;
}

.control-btn {
  background: none;
  border: none;
  color: var(--music-text-secondary);
  font-size: 1.2rem;
  margin: 0 10px;
  cursor: pointer;
}

.control-btn:hover {
  color: var(--music-text-primary);
}

.play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--music-primary);
  color: var(--music-text-primary); /* White icon on purple */
  display: flex;
  align-items: center;
  justify-content: center;
  border: none; /* Remove default border */
}
.play-btn:hover {
  background-color: var(--music-secondary); /* Lighter purple on hover */
}

.progress-container {
  cursor: pointer;
  position: relative;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: visible; /* Important to show handle */
  transition: height 0.2s ease;
}

.progress-container:hover {
  height: 6px;
}

.progress-bar {
  height: 100%;
  background-color: var(--music-primary); /* Purple progress */
  border-radius: 2px;
  position: relative;
  transition: width 0.1s ease;
}

.progress-container:hover .progress-bar {
  background-color: var(--music-secondary); /* Lighter purple on hover */
}

.progress-container .progress-bar::after {
  content: '';
  width: 12px;
  height: 12px;
  background-color: var(--music-text-primary); /* White handle */
  border-radius: 50%;
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  transition: transform 0.2s ease;
}

.progress-container:hover .progress-bar::after {
  transform: translateY(-50%) scale(1);
}

.volume-tooltip {
  position: absolute;
  background-color: #333;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  pointer-events: none;
}

.progress-container:hover .volume-tooltip {
  display: block;
}

.verified-badge {
  color: #3d91f4;
  font-size: 1.2rem;
  margin-left: 5px;
}

.section-divider {
  border-bottom: 1px solid var(--music-bg-light);
  margin: 30px 0;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
}

@keyframes equalize {
  0% { transform: scaleY(0.1); }
  50% { transform: scaleY(1); }
  100% { transform: scaleY(0.1); }
}

.bg-secondary[style*="animation: equalize"] {
  transition: height 0.1s ease-in-out;
}

#track-artist {
  color: var(--music-text-primary);
}

.main-content {
  padding-bottom: 100px; /* Make room for fixed player */
}

/* Font Awesome Icon Fixes */
.fa-pause:before {
  content: "\f04c";
}

.fa-step-forward:before {
  content: "\f051";
}

.fa-step-backward:before {
  content: "\f048";
}

.fa-volume-up:before {
  content: "\f028";
}

.fa-volume-down:before {
  content: "\f027";
}

.fa-volume-mute:before {
  content: "\f6a9";
}

/* Touch-friendly slider handles */
.slider-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  background-color: var(--music-text-primary); /* White handle */
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 10;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.2s ease, width 0.2s ease, height 0.2s ease;
}

#progress-handle {
  left: calc(var(--progress-percent, 0%) - 8px);
}

#volume-handle {
  left: calc(var(--volume-percent, 70%) - 8px);
}

/* Show handles on hover/touch */
.progress-container:hover .slider-handle,
.progress-container:active .slider-handle,
.progress-container.dragging .slider-handle {
  opacity: 1;
  width: 20px;
  height: 20px;
}

/* For touch devices */
@media (pointer: coarse) {
  .slider-handle {
    opacity: 1;
    width: 20px;
    height: 20px;
  }
}
/* View More button styling */
.view-more-row {
  background: transparent !important;
  transition: background-color 0.3s ease;
}

.view-more-row:hover {
  background-color: rgba(255, 255, 255, 0.05) !important;
}

.view-more-row td {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#view-more-btn {
  padding: 0.4rem 1.5rem;
  border-radius: 30px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

#view-more-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* Animation for new tracks */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

#tracks-table tbody tr.track-row {
  animation: fadeIn 0.3s ease-in-out;
}
/* Show Less button styling */
#show-less-btn {
  padding: 0.4rem 1.5rem;
  border-radius: 30px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  background-color: rgba(255, 255, 255, 0.05);
}

#show-less-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* Animation for removing tracks */
@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

.track-row.removing {
  animation: fadeOut 0.3s ease-in-out;
}

/* Update active track highlight in table if needed */
.table-dark > tbody > tr.active,
.table-dark > tbody > tr.table-active {
    background-color: rgba(98, 0, 234, 0.2); /* Purple highlight */
    color: var(--music-secondary); /* Lighter purple text */
}
.table-dark > tbody > tr.active h6,
.table-dark > tbody > tr.table-active h6 {
    color: var(--music-secondary); /* Lighter purple text */
}

/* Style for the popular tracks table */
.table-dark {
    background-color: transparent; /* Remove default dark bg if needed */
}

.table-dark > tbody > tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08); /* Subtle row separator */
    transition: background-color 0.2s ease;
}

.table-dark > tbody > tr:last-child {
    border-bottom: none; /* Remove border for the last row */
}

.table-dark > tbody > tr:hover {
    background-color: rgba(255, 255, 255, 0.05); /* Keep hover effect subtle */
}

/* Ensure active track highlight overrides hover */
.table-dark > tbody > tr.active,
.table-dark > tbody > tr.table-active {
    background-color: rgba(98, 0, 234, 0.2) !important; /* Purple highlight */
    color: var(--music-secondary); /* Lighter purple text */
    border-left: 3px solid var(--music-primary); /* Add left border for active */
}
.table-dark > tbody > tr.active td:first-child,
.table-dark > tbody > tr.table-active td:first-child {
    padding-left: calc(1rem - 3px); /* Adjust padding for border */
}

.table-dark > tbody > tr.active h6,
.table-dark > tbody > tr.table-active h6 {
    color: var(--music-secondary); /* Lighter purple text */
}

/* Footer positioning fix */
.footer {
  position: relative;
  z-index: 10; /* Ensure footer stays above player */
  margin-bottom: 0;
  background-color: var(--music-bg-dark);
}

:root {
  --music-primary: #1ed760;
  --music-secondary: #1ed760;
  --music-bg-dark: #121212;
  --music-bg-medium: #181818;
  --music-bg-light: #282828;
  --music-text-secondary: #b3b3b3;
}

body {
  background: #121212;
  color: #fff;
  font-family: Arial, sans-serif;
}

.artist-header {
  min-height: 360px;
  padding: 112px 0 36px;
  margin-top: 0;
  background:
    linear-gradient(180deg, rgba(30, 215, 96, 0.35) 0%, rgba(18, 18, 18, 0.88) 82%),
    url("../Images/On stage.jpg") center 38% / cover no-repeat;
}

.artist-header .container {
  position: relative;
  z-index: 1;
}

.artist-header .row > div:last-child {
  padding-top: 0;
}

.artist-label {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
}

.artist-img {
  width: min(220px, 100%);
  height: auto;
  aspect-ratio: 1;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.artist-header h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  letter-spacing: -0.04em;
}

.artist-header .text-secondary,
.album-year,
.track-artist {
  color: #b3b3b3 !important;
}

#random-play-btn {
  min-width: 112px;
  min-height: 48px;
  color: #08140b;
  font-weight: 700;
  background: var(--music-primary);
  border-color: var(--music-primary);
  box-shadow: none;
}

#random-play-btn:hover,
#random-play-btn:focus-visible {
  color: #08140b;
  background: #3be477;
  border-color: #3be477;
  transform: scale(1.04);
}

.main-content {
  padding-top: 2rem !important;
}

.section-title {
  margin-bottom: 1rem;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.section-divider {
  margin: 2rem 0;
  border-color: rgba(255, 255, 255, 0.1);
}

.table-dark {
  --bs-table-bg: transparent;
  --bs-table-color: #b3b3b3;
  margin-bottom: 0;
}

.table-dark > tbody > tr {
  border: 0;
}

.table-dark > tbody > tr:hover {
  background: rgba(255, 255, 255, 0.08);
}

.table-dark > tbody > tr.active,
.table-dark > tbody > tr.table-active {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff;
  border-left: 3px solid var(--music-primary);
}

.table-dark > tbody > tr.active h6,
.table-dark > tbody > tr.table-active h6 {
  color: var(--music-primary);
}

.track-row {
  cursor: pointer;
}

.track-row td {
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
  vertical-align: middle;
}

.track-row img {
  border-radius: 4px;
  object-fit: cover;
}

.track-title,
.album-title {
  color: #fff;
}

.album-card {
  height: 100% !important;
  padding: 1rem !important;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #181818;
}

.album-card:hover {
  background: #282828;
  border-color: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
  box-shadow: none;
}

.singles-grid {
  padding-bottom: 8px;
  scroll-behavior: smooth;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  scrollbar-width: thin;
}

.singles-grid::-webkit-scrollbar {
  height: 6px;
}

.singles-grid::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.2);
}

.singles-pagination .btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.singles-pagination .btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}

#singles-page-indicator {
  margin: 0 0.5rem;
  color: #fff;
}

.player-container {
  background: rgba(24, 24, 24, 0.98);
  border-top-color: rgba(255, 255, 255, 0.1);
}

.play-btn {
  color: #111;
  background: #fff;
}

.play-btn:hover {
  color: #111;
  background: #e5e5e5;
}

.progress-container {
  background: #5e5e5e;
}

.progress-bar {
  background: #fff;
}

.progress-container:hover .progress-bar {
  background: var(--music-primary);
}

.progress-container[style*="width: 100px"] {
  height: 4px;
}

.progress-container[style*="width: 100px"] .progress-bar {
  background: #b3b3b3;
}

.footer {
  padding-bottom: 7rem !important;
}

.album-artist-header {
  min-height: 360px;
  padding-bottom: 36px;
  background:
    linear-gradient(180deg, rgba(30, 215, 96, 0.35) 0%, rgba(18, 18, 18, 0.9) 90%),
    #181818;
}

.album-artist-header .album-cover-img {
  width: min(250px, 100%);
  max-width: 250px;
  border-radius: 8px;
}

.album-artist-header .row > div:last-child {
  padding-top: 0;
}

.album-track-row {
  height: 64px;
  cursor: pointer;
}

.album-track-row.active,
.album-track-row.active:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-left: 3px solid var(--music-primary);
}

.album-track-row.active h6 {
  color: var(--music-primary);
}

.album-track-row .play-track-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.album-track-row:hover .play-track-btn,
.album-track-row:focus-within .play-track-btn {
  color: var(--music-primary) !important;
}

.album-track-row .track-duration,
.track-row .duration-cell {
  min-width: 72px;
  color: #b3b3b3;
  font-variant-numeric: tabular-nums;
}

.album-metadata {
  padding: 1rem;
  border-radius: 8px;
  background: #181818;
}

@media (max-width: 767.98px) {
  body {
    padding-bottom: 150px;
  }

  .artist-header {
    min-height: 0;
    padding: 96px 0 32px;
    background-position: center;
  }

  .album-artist-header {
    min-height: 0;
    padding-bottom: 32px;
  }

  .artist-header .artist-img {
    width: 180px;
    margin-bottom: 1rem;
  }

  .artist-header .row > div:last-child {
    text-align: center;
  }

  .artist-header .row > div:last-child > div {
    justify-content: center;
  }

  .player-container {
    padding: 0.75rem 0 !important;
  }

  .player-container .row {
    row-gap: 0.5rem;
  }

  .player-container .row > div:first-child {
    display: none;
  }

  .player-container .row > div:nth-child(2) {
    width: 75%;
  }

  .player-container .row > div:last-child {
    width: 25%;
  }

  .player-container .control-btn {
    margin: 0 0.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .album-card,
  .nav-link,
  #random-play-btn {
    transition: none;
  }
}