/* Music.css */

/* =============================================== */
/* 💻 기본 스타일 (PC 기준)                      */
/* =============================================== */

#music {
  padding-top: 5rem;
}

#music h2 {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 3rem;
  color: #111827;
  font-weight: 600;
}

.album-container {
  display: flex;
  justify-content: center;
  gap: 4rem;
  padding: 2rem;
  flex-wrap: wrap;
}

.album-box {
  width: 100%;
  max-width: 400px;
  background-color: #f9fafb;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
}

.album-box.active-album {
  box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.2), 0 4px 6px -4px rgba(79, 70, 229, 0.2);
  transform: translateY(-5px);
}

.album-box h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #111827;
  text-align: center;
}

.album-art {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.player-ui {
  margin-top: 1rem;
}

.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

.controls button,
.control-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #4b5563;
  transition: color 0.2s ease;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.controls button:hover:not(:disabled),
.control-btn:hover:not(:disabled) {
  color: #111827;
  background-color: #f3f4f6;
}
.controls button:disabled,
.control-btn:disabled {
  color: #d1d5db;
  cursor: not-allowed;
}
.controls button svg,
.control-btn svg {
  width: 32px;
  height: 32px;
}
.controls button:nth-child(2) svg,
.control-btn.play-pause-btn svg {
  width: 38px;
  height: 38px;
}

.progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.time-display {
  font-size: 0.875rem;
  color: #6b7280;
  min-width: 35px;
  text-align: center;
}

.progress input[type="range"],
.progress-slider {
  flex-grow: 1;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: linear-gradient(to right, #4f46e5 var(--progress-percent, 0%), #e5e7eb var(--progress-percent, 0%));
  border-radius: 9999px;
  outline: none;
  cursor: pointer;
  transition: height 0.2s ease;
}
.progress input[type="range"]:hover,
.progress-slider:hover {
    height: 12px;
}
.progress input[type="range"]::-webkit-slider-thumb,
.progress-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: #fff;
  cursor: pointer;
  border-radius: 50%;
  border: 4px solid #4f46e5;
  margin-top: -5px;
  transition: transform 0.2s ease;
}
.progress input[type="range"]:hover::-webkit-slider-thumb,
.progress-slider:hover::-webkit-slider-thumb {
    transform: scale(1.1);
}
.progress input[type="range"]::-moz-range-thumb,
.progress-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #fff;
  cursor: pointer;
  border-radius: 50%;
  border: 4px solid #4f46e5;
}
.progress input[type="range"]:disabled,
.progress-slider:disabled {
  cursor: not-allowed;
  background: #e5e7eb;
}
.progress input[type="range"]:disabled::-webkit-slider-thumb,
.progress-slider:disabled::-webkit-slider-thumb {
  background: #d1d5db;
  border-color: #9ca3af;
}

.tracklist {
  margin-top: 1.5rem;
  text-align: left;
  list-style-position: inside;
  padding: 0;
  height: 240px;
  overflow-y: auto;
  border-top: 1px solid #e5e7eb;
}
.tracklist::-webkit-scrollbar {
  width: 6px;
}
.tracklist::-webkit-scrollbar-track {
  background: transparent;
}
.tracklist::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}
.tracklist::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.tracklist li,
.track-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.75rem 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: 0.9rem;
  color: #374151;
}
.tracklist li:hover,
.track-item:hover {
  background-color: #f3f4f6;
}
.tracklist li.active,
.track-item.active {
  background-color: #e0e7ff;
  color: #3730a3;
  font-weight: 600;
}
.tracklist li.active .track-duration,
.track-item.active .track-duration {
  color: #4f46e5;
  font-weight: 600;
}
.tracklist li.last-played,
.track-item.last-played {
  background-color: #f3f4f6;
  font-weight: 500;
}

.track-title {
  flex: 1;
  white-space: nowrap;
  overflow-x: auto;
  margin-right: 1rem;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.track-title::-webkit-scrollbar {
  display: none;
}

.track-duration {
  color: #6b7280;
  font-size: 0.85rem;
}

/* =============================================== */
/* 📟 태블릿 (1024px 이하)                          */
/* =============================================== */
@media (max-width: 1024px) {
  #music h2 {
    font-size: 2.5rem;
  }
  .album-container {
    gap: 2rem;
    padding: 1rem;
  }
  .album-box {
    width: calc(50% - 1rem); 
    max-width: 380px;
  }
}

/* =============================================== */
/* 📱 모바일 & 아이패드 미니 세로 (768px 이하)      */
/* =============================================== */
@media (max-width: 768px) {
  #music h2 {
    font-size: 2.2rem;
    margin-bottom: 2rem;
  }
  .album-container {
    padding: 0 1rem;
    gap: 2.5rem;
  }
  .album-box {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 1rem;
  }

  .progress {
    gap: 0.5rem;
  }
  .time-display {
    min-width: 32px;
    font-size: 0.8rem;
  }

  .tracklist {
    height: 200px;
  }
  .controls {
    gap: 1.25rem;
  }
  .controls button svg,
  .control-btn svg {
    width: 28px;
    height: 28px;
  }
  .controls button:nth-child(2) svg,
  .control-btn.play-pause-btn svg {
    width: 34px;
    height: 34px;
  }
}