/* ===== Living Text Player Styles ===== */

/* Section */
.player-section {
  padding: 100px 0 120px;
}

.player-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: stretch;
}

.player-layout > * {
  display: flex;
  flex-direction: column;
}

.player-layout > *:last-child {
  justify-content: space-between;
}

@media (max-width: 900px) {
  .player-layout {
    grid-template-columns: 1fr;
  }
}

/* Playlist Selector */
.playlist-selector {
  margin-bottom: 24px;
}

.playlist-selector select {
  width: 100%;
  padding: 12px 20px;
  background: rgba(20, 20, 30, 0.8);
  border: 1px solid rgba(0, 66, 37, 0.5);
  border-radius: 12px;
  color: #EAEAEF;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.3s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2350C878' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
}

.playlist-selector select:hover {
  border-color: #50C878;
}

.playlist-selector select option {
  background: #0A0A0F;
  color: #EAEAEF;
}

/* User playlist controls */
.user-playlist-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.user-playlist-controls input {
  flex: 1;
  min-width: 140px;
  padding: 8px 16px;
  background: rgba(20, 20, 30, 0.8);
  border: 1px solid rgba(0, 66, 37, 0.5);
  border-radius: 8px;
  color: #EAEAEF;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
}

.user-playlist-controls input:focus {
  border-color: #50C878;
}

.btn-sm {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid rgba(0, 66, 37, 0.5);
  background: rgba(0, 66, 37, 0.3);
  color: #EAEAEF;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  transition: background 0.3s, border-color 0.3s;
  white-space: nowrap;
}

.btn-sm:hover {
  background: rgba(0, 66, 37, 0.5);
  border-color: #50C878;
}

.btn-sm.danger {
  border-color: rgba(200, 50, 50, 0.4);
  background: rgba(200, 50, 50, 0.15);
}

.btn-sm.danger:hover {
  background: rgba(200, 50, 50, 0.3);
  border-color: rgba(200, 50, 50, 0.6);
}

/* Track list */
.track-list {
  background: rgba(20, 20, 30, 0.5);
  border: 1px solid rgba(0, 66, 37, 0.25);
  border-radius: 16px;
  overflow: hidden;
  max-height: 400px;
  overflow-y: auto;
}

.track-list::-webkit-scrollbar {
  width: 6px;
}

.track-list::-webkit-scrollbar-track {
  background: transparent;
}

.track-list::-webkit-scrollbar-thumb {
  background: rgba(0, 66, 37, 0.4);
  border-radius: 3px;
}

.track-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.track-item:last-child {
  border-bottom: none;
}

.track-item:hover {
  background: rgba(0, 66, 37, 0.2);
}

.track-item.active {
  background: rgba(0, 66, 37, 0.3);
  border-left: 3px solid #50C878;
}

.track-number {
  width: 32px;
  color: #606070;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.track-item.active .track-number {
  color: #50C878;
}

.track-info {
  flex: 1;
  min-width: 0;
}

.track-title {
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-author {
  font-size: 12px;
  color: #707080;
  margin-top: 2px;
}

.track-duration {
  color: #606070;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  margin-left: 12px;
}

.track-actions {
  display: flex;
  gap: 6px;
  margin-left: 8px;
}

.track-btn-icon {
  background: none;
  border: none;
  color: #606070;
  cursor: pointer;
  font-size: 16px;
  padding: 8px 10px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  line-height: 1;
}

.track-btn-icon:hover {
  color: #50C878;
}

.track-btn-icon.danger:hover {
  color: #e05050;
}

/* Player controls */
.player-controls {
  background: rgba(20, 20, 30, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 66, 37, 0.3);
  border-radius: 24px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.player-cover {
  width: 60%;
  max-width: 200px;
  aspect-ratio: 1;
  border-radius: 16px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #13131A;
  border: 1px solid rgba(0, 66, 37, 0.3);
  padding: 12px;
}

.player-cover img,
.player-cover canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
}

.player-song-info {
  text-align: center;
  margin-bottom: 24px;
}

.player-song-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 4px;
}

.player-song-author {
  font-size: 14px;
  color: #50C878;
}

/* Progress bar */
.progress-container {
  margin-bottom: 20px;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #004225, #50C878);
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}

.progress-times {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #606070;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

/* Buttons row */
.player-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.player-btn {
  background: none;
  border: none;
  color: #808090;
  cursor: pointer;
  font-size: 16px;
  padding: 8px;
  border-radius: 12px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
}

.player-btn:hover {
  color: #EAEAEF;
  background: rgba(255, 255, 255, 0.04);
}

.player-btn.active {
  color: #50C878;
  box-shadow: 0 0 16px rgba(80, 200, 120, 0.15);
}

.player-btn.active:hover {
  color: #50C878;
}

.player-btn-play {
  background: linear-gradient(135deg, #004225, #003318);
  border: 1px solid rgba(80, 200, 120, 0.3);
  width: 52px;
  height: 52px;
  font-size: 20px;
  border-radius: 14px;
}

.player-btn-play:hover {
  box-shadow: 0 0 24px rgba(0, 66, 37, 0.5);
  transform: scale(1.05);
  border-color: rgba(80, 200, 120, 0.5);
}

/* Volume */
.player-volume {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  justify-content: center;
}

.player-volume-icon {
  color: #606070;
  font-size: 14px;
}

.volume-slider {
  width: 100px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: #50C878;
  border-radius: 50%;
  cursor: pointer;
}

.volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #50C878;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: #606070;
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 14px;
}

/* Auto-next toggle */
.player-autonext {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  justify-content: center;
}

.autonext-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.autonext-toggle input {
  display: none;
}

.toggle-track {
  width: 40px;
  height: 22px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  position: relative;
  transition: background 0.3s;
  flex-shrink: 0;
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #606070;
  border-radius: 50%;
  transition: transform 0.3s, background 0.3s;
}

.autonext-toggle input:checked + .toggle-track {
  background: rgba(0, 66, 37, 0.7);
}

.autonext-toggle input:checked + .toggle-track::after {
  transform: translateX(18px);
  background: #50C878;
}

.toggle-label {
  font-size: 13px;
  color: #808090;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(0, 66, 37, 0.9);
  border: 1px solid rgba(80, 200, 120, 0.3);
  color: #EAEAEF;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
