/* =========================
   AI Player
========================= */
.ai-player {
  width: 100%;
  min-width: 250px;
  max-width: 600px;
  margin: 0 auto;
  height: 250px;
  background-color: #0a0a0a;
  border: 4px solid #0ff;
  box-shadow: 0 0 15px #0ff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  font-family: 'Rajdhani', sans-serif;
  color: #0ff;
  background-image: url("/images/player_background.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
}

.ai-player .btn-play-stop {
  width: 84px;
  height: 46px;
  padding: 0;
  border: none;
  line-height: 0;
  font-size: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  box-sizing: content-box;
}

.ai-player .btn-play-stop:hover {
  transform: scale(1.05);
}

.player-top {
  display: flex;
  align-items: center;
  gap: 20px;
}

.player-top > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.track-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #0ff;
  font-family: 'Rajdhani', sans-serif;
  transition: opacity 0.25s ease, transform 0.25s ease;
  min-width: 0;
}

.track-info.hidden {
  opacity: 0;
  transform: translateX(-10px);
  pointer-events: none;
}

.track-artist {
  font-size: 18px;
  font-weight: 600;
}

.track-title {
  font-size: 14px;
  opacity: 0.8;
}

.ai-player .volume-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-player input[type=range] {
  -webkit-appearance: none;
  width: 200px;
  height: 6px;
  background: #222;
  outline: none;
  border: none;
  cursor: pointer;
}

.ai-player input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #e63946;
  border: none;
}

.ai-player input[type=range]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #e63946;
  border: none;
}

.ai-player .visualizer {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 10px 0;
}

.ai-player .visualizer .bar {
  width: 10px;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  gap: 2px;
}

.ai-player .visualizer .bar-segment {
  width: 100%;
  height: 6px;
  background-color: #111;
  border-radius: 2px;
  transition: background-color 0.1s;
}

/* Buttons like/dislike */
.like-dislike-container {
  margin-left: auto;
  display: flex;
  gap: 10px;
}

.like-dislike-container button {
  width: 62px;
  height: 34px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: filter 0.2s, opacity 0.2s;
  /* normal state */
  filter: saturate(40%) brightness(70%);
  opacity: 0.7;
}

.like-dislike-container button:hover {
  filter: saturate(70%) brightness(90%);
  opacity: 0.9;
}

/* selected */
.like-dislike-container button.selected {
  filter: none;
  opacity: 1;
  transform: scale(1.1);
}

/* disabled */
.like-dislike-container button.disabled {
  opacity: 0.25;
  filter: grayscale(100%) brightness(50%);
  pointer-events: none;
}

.btn-like {
  background-image: url("/images/btn_like.png");
}

.btn-dislike {
  background-image: url("/images/btn_dislike.png");
}

@media (max-width: 520px) {
  .player-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .like-dislike-container {
    order: 2;
    width: 100%;
    justify-content: flex-start;
  }
}

/* =========================
   Mini Player
========================= */
#miniPlayer {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  background: #0a0a0a;
  border: 2px solid #0ff;
  box-shadow: 0 0 10px #0ff;
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

#miniPlayer button {
  background: transparent;
  border: none;
  color: #0ff;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.2s;
  line-height: 1;
}

#miniPlayer button:hover {
  color: #fff;
}

#miniPlayer input[type=range] {
  -webkit-appearance: none;
  width: 80px;
  height: 4px;
  background: #222;
  outline: none;
  border: none;
  cursor: pointer;
}

#miniPlayer input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: #e63946;
  border: none;
  border-radius: 50%;
}

#miniPlayer input[type=range]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #e63946;
  border: none;
  border-radius: 50%;
}

/* =========================
   Track History
========================= */

/* --- Wrapper & Container --- */
.track-history-wrapper {
  width: 100%;
  max-width: 600px;
  margin: 8px auto 0;
  position: relative;
}

.track-history {
  background-color: #0a0a0a;
  border: 1px solid rgba(0, 255, 255, 0.25);
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.08);
  font-family: 'Rajdhani', sans-serif;
  overflow-y: auto;
  max-height: 132px;
  scroll-behavior: smooth;
}

.track-history::-webkit-scrollbar {
  width: 4px;
}

.track-history::-webkit-scrollbar-track {
  background: #111;
}

.track-history::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 255, 0.3);
  border-radius: 2px;
}

/* --- History Item (shared) --- */
.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(0, 255, 255, 0.07);
  transition: background 0.2s;
}

.history-item:last-child {
  border-bottom: none;
}

.history-item:hover {
  background: rgba(0, 255, 255, 0.04);
}

.history-info {
  flex: 1;
  min-width: 0;
  text-align: left;
}

/* --- Like / Dislike (shared) --- */
.history-like-dislike {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.history-like-dislike button {
  width: 42px;
  height: 23px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: filter 0.2s, opacity 0.2s;
  filter: saturate(40%) brightness(70%);
  opacity: 0.7;
  background-color: transparent;
}

.history-like-dislike button:hover {
  filter: saturate(70%) brightness(90%);
  opacity: 0.9;
}

.history-like-dislike button.selected {
  filter: none;
  opacity: 1;
}

.history-like-dislike button.disabled {
  opacity: 0.25;
  filter: grayscale(100%) brightness(50%);
  pointer-events: none;
}

/* --- New Track Badge --- */
.history-new-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: #e63946;
  color: #fff;
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 10px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}

.history-new-badge.visible {
  opacity: 1;
  pointer-events: auto;
}

/* --- Music Tracks --- */
.history-cover {
  width: 44px;
  height: 44px;
  object-fit: cover;
  flex-shrink: 0;
  opacity: 0.85;
}

.history-cover-placeholder {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: #111;
  border: 1px solid rgba(0, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: rgba(0, 255, 255, 0.2);
}

.history-artist {
  font-size: 13px;
  font-weight: 600;
  color: #0ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-title {
  font-size: 12px;
  color: rgba(0, 255, 255, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- News --- */
.history-news-sources {
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.history-news-article {
  padding: 2px 0;
  border-top: 1px solid rgba(0, 255, 255, 0.12);
}

.history-news-article:first-child {
  border-top: none;
  padding-top: 0;
}

.history-news-article:last-child {
  padding-bottom: 0;
}

.history-news-source {
  font-size: 11px;
  color: rgba(0, 255, 255, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.history-source-label {
  color: rgba(0, 255, 255, 0.4);
  font-size: 11px;
}

.history-news-source a {
  color: rgba(0, 255, 255, 0.7);
  text-decoration: none;
}

.history-news-source a:hover {
  color: #0ff;
  text-decoration: underline;
}
