/* ==========================================
   AnotherLine.Music — Global Player Styles
   ========================================== */

.al-player {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 999;
  background: rgba(10, 10, 10, 0.96);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  padding-bottom: env(safe-area-inset-bottom);
}
.al-player.visible {
  transform: translateY(0);
}

body.has-player {
  padding-bottom: 72px;
}

.al-player-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 20px;
  height: 64px;
}

/* Track info */
.al-player-track {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
  max-width: 280px;
  flex: 0 1 auto;
}
.al-player-cover {
  width: 44px; height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #1a1a1a;
}
.al-player-info {
  overflow: hidden;
}
.al-player-title {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}
.al-player-artist {
  font-size: 0.75rem;
  color: #9aa4ad;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.al-player-preview-badge {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.6rem;
  font-weight: 700;
  background: rgba(0,176,185,0.2);
  color: #00B0B9;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Controls */
.al-player-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.al-player-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: none;
  background: none;
  color: #9aa4ad;
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  position: relative;
}
.al-player-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}
.al-player-btn.active {
  color: #00B0B9;
}
.al-player-play {
  width: 42px; height: 42px;
  background: #00B0B9;
  color: #fff;
}
.al-player-play:hover {
  background: #008B93;
  color: #fff;
}
.al-repeat-badge {
  position: absolute;
  bottom: 2px; right: 2px;
  font-size: 0.55rem;
  font-weight: 700;
  color: #00B0B9;
  background: rgba(0,176,185,0.15);
  width: 12px; height: 12px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}

/* Progress */
.al-player-progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.al-player-time {
  font-size: 0.72rem;
  color: #666;
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: center;
  flex-shrink: 0;
}
.al-player-seek {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
}
.al-player-seek:hover {
  height: 6px;
}
.al-player-seek-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: #00B0B9;
  border-radius: 999px;
  transition: width 0.1s linear;
}
.al-player-seek-thumb {
  position: absolute;
  top: 50%; left: 0%;
  width: 12px; height: 12px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.al-player-seek:hover .al-player-seek-thumb,
.al-player-seek:active .al-player-seek-thumb {
  opacity: 1;
}

/* Volume */
.al-player-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 120px;
}

/* Download */
.al-player-download-wrap {
  position: relative;
}
.al-player-download-btn {
  color: rgba(255,255,255,0.7);
  transition: color 0.2s;
}
.al-player-download-btn:hover {
  color: #00B0B9;
}
.al-player-download-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30,30,38,0.98);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 4px;
  min-width: 90px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 100;
}
.al-player-download-menu.open {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.al-dl-option {
  background: none;
  border: none;
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: space-between;
}
.al-dl-option:hover:not(:disabled) {
  background: rgba(0,176,185,0.15);
  color: #00B0B9;
}
.al-dl-option:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Download tier tags */
.al-dl-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.3;
}
.al-dl-tag--premium {
  background: linear-gradient(135deg, rgba(255,215,0,0.2), rgba(255,165,0,0.15));
  color: #ffd700;
  border: 1px solid rgba(255,215,0,0.3);
}
.al-dl-tag--pro {
  background: linear-gradient(135deg, rgba(147,51,234,0.2), rgba(79,70,229,0.15));
  color: #a78bfa;
  border: 1px solid rgba(147,51,234,0.3);
}

/* Player toast */
.al-player-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30,30,38,0.95);
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 10001;
  white-space: nowrap;
}
.al-player-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.al-player-vol {
  width: 80px;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
}
.al-player-vol:hover {
  height: 6px;
}
.al-player-vol-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 80%;
  background: #fff;
  border-radius: 999px;
}
.al-player-vol-thumb {
  position: absolute;
  top: 50%; left: 80%;
  width: 10px; height: 10px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.2s;
}
.al-player-vol:hover .al-player-vol-thumb {
  opacity: 1;
}

/* ==========================================
   Mobile responsive
   ========================================== */
@media (max-width: 768px) {
  .al-player-inner {
    padding: 8px 12px;
    gap: 10px;
    height: 60px;
  }
  .al-player-track {
    min-width: 0;
    max-width: 40%;
  }
  .al-player-cover {
    width: 38px; height: 38px;
    border-radius: 6px;
  }
  .al-player-shuffle,
  .al-player-repeat,
  .al-player-time {
    display: none;
  }
  .al-player-right {
    display: flex;
    gap: 4px;
    align-items: center;
  }
  .al-player-right .al-player-vol,
  .al-player-right #alVolBtn {
    display: none;
  }
  .al-player-progress {
    gap: 0;
    position: absolute;
    top: -2px; left: 0; right: 0;
    padding: 0;
  }
  .al-player-seek {
    height: 3px;
    border-radius: 0;
  }
  .al-player-seek:hover {
    height: 3px;
  }
  body.has-player {
    padding-bottom: 60px;
  }
}

@media (max-width: 480px) {
  .al-player-title { font-size: 0.82rem; }
  .al-player-artist { font-size: 0.7rem; }
  .al-player-preview-badge { display: none; }
}
