/* Mini video player */
.mini-player {
  position: fixed;
  width: 400px;
  height: 240px;
  background: #000;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  z-index: 9990;
  resize: both;
  min-width: 320px;
  min-height: 240px;
  max-width: 800px;
  max-height: 600px;
}

.mini-player.movie {
  border: 2px solid #9b4d5f;
}

.mini-player.game {
  border: 2px solid #196875;
}

.mini-player-content {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.mini-player-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  z-index: 9995;
  transition: all 0.2s ease;
}

.mini-player-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.mini-player-drag-handle {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 30px;
  cursor: move;
  z-index: 9992;
}

.resize-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.3);
  z-index: 9993;
}

.resize-handle.top-left {
  top: 0;
  left: 0;
  cursor: nwse-resize;
}

.resize-handle.top-right {
  top: 0;
  right: 0;
  cursor: nesw-resize;
}

.resize-handle.bottom-left {
  bottom: 0;
  left: 0;
  cursor: nesw-resize;
}

.resize-handle.bottom-right {
  bottom: 0;
  right: 0;
  cursor: nwse-resize;
}

/* Pin button and music button for mini player */
.pin-video-btn,
.music-btn {
  position: absolute;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  z-index: 10001;
  transition: all 0.2s ease;
  opacity: 0.7;
}

/* Button positioning for mini player specifically */
.mini-player .pin-video-btn {
  bottom: 20px;
  right: 70px;
}

.mini-player .music-btn {
  bottom: 20px;
  right: 20px;
}

.pin-video-btn:hover,
.music-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
  opacity: 1;
}

/* Music button styling for expanded cards */
.expanded-card .music-btn {
  position: absolute;
  top: 130px; /* Below the pin-video-btn */
  right: 10px;
  width: 30px;
  height: 30px;
  background: rgba(186, 63, 224, 0.6); /* Purple shade to differentiate from pin button */
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  z-index: 25;
  transition: all 0.2s ease;
  box-shadow: 0 0 10px rgba(186, 63, 224, 0.4);
  opacity: 0;
}

.expanded-card:hover .music-btn {
  opacity: 1;
}

.expanded-card .music-btn:hover {
  background: rgba(186, 63, 224, 0.9);
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(186, 63, 224, 0.8);
}

.expanded-card .music-btn.active {
  background: rgba(186, 63, 224, 0.9);
  box-shadow: 0 0 20px rgba(186, 63, 224, 0.8);
}

/* Movie-specific music button */
.movie-expanded .music-btn {
  background: rgba(155, 77, 130, 0.6); /* More pink-purple for movies */
  box-shadow: 0 0 10px rgba(155, 77, 130, 0.4);
}

.movie-expanded .music-btn:hover,
.movie-expanded .music-btn.active {
  background: rgba(155, 77, 130, 0.9);
  box-shadow: 0 0 15px rgba(155, 77, 130, 0.8);
}

/* Mini audio player */
.mini-audio-player {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: rgba(8, 11, 17, 0.8);
  border: 2px solid rgba(186, 63, 224, 0.7);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
  z-index: 9998;
  overflow: hidden;
  transition: all 0.3s ease-in-out;
  cursor: pointer;
}

/* Type-specific styling */
.mini-audio-player.movie {
  border-color: rgba(155, 77, 95, 0.7);
}

.mini-audio-player.game {
  border-color: rgba(63, 203, 224, 0.7);
}

.mini-audio-player.tvshow {
  border-color: rgba(61, 90, 254, 0.6);
}

.mini-audio-player.book {
  border-color: rgba(176, 141, 87, 0.6);
}

/* Expanded state for audio player when hovered */
.mini-audio-player.expanded {
  width: 300px;
  height: 120px;
  border-radius: 10px;
}

/* Audio icon container */
.audio-icon-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 12px;
  box-sizing: border-box;
  z-index: 1; /* Ensure it's above the YouTube iframe */
  background: rgba(8, 11, 17, 0.9);
}

/* Audio icon */
.audio-icon {
  font-size: 24px;
  color: #fff;
  text-shadow: 0 0 10px rgba(186, 63, 224, 0.8);
  margin-right: 10px;
  min-width: 24px;
}

.movie .audio-icon {
  text-shadow: 0 0 10px rgba(155, 77, 95, 0.8);
}

.game .audio-icon {
  text-shadow: 0 0 10px rgba(63, 203, 224, 0.8);
}

/* Audio title */
.audio-title {
  color: white;
  font-size: 0.85em;
  margin-left: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  max-width: 0;
  transition: opacity 0.3s ease, max-width 0.3s ease;
  flex-grow: 1;
}

.mini-audio-player.expanded .audio-title {
  opacity: 1;
  max-width: 200px;
}

/* Audio close button */
.audio-close {
  width: 22px;
  height: 22px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  margin-right: 10px;
  transition: all 0.2s ease;
}

.audio-close:hover {
  opacity: 1;
  background: rgba(255, 0, 0, 0.4);
}

/* YouTube controls container for the actual player */
.youtube-controls-container {
  position: absolute;
  top: 50px; /* Position below the header */
  left: 0;
  width: 100%;
  height: calc(100% - 50px);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: #000;
}

/* When expanded, show the YouTube controls */
.mini-audio-player.expanded .youtube-controls-container {
  opacity: 1;
}

/* Style the YouTube iframe to show only the bottom control bar */
.youtube-controls-frame {
  position: absolute;
  width: 300px;      /* Same as expanded width */
  height: 169px;     /* 16:9 ratio height */
  top: -99px;        /* Hide most of the video, showing only controls */
  left: 0;
  border: none;
}