/* ==========================================================================
   Powerline Radio - Fullscreen Player Styles
   ========================================================================== */

/* Fullscreen mode with smooth transitions */
.audio-player {
  will-change: transform, height, opacity;
  transition: all 0.3s ease-out;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.audio-player.fullscreen {
  height: 100vh;
  z-index: 1000;
  background: linear-gradient(135deg, 
              rgba(var(--color-bg-rgb), 0.97) 0%, 
              rgba(var(--color-bg-rgb), 0.95) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden; /* Ensure blobs don't cause scrollbars */
  position: fixed; /* Change to fixed to cover the whole viewport */
  top: 0;
  left: 0;
  width: 100%;
  margin: 0;
  animation: none; /* Remove fade-in animation */
}

/* Animation for fading in - simplified */
@keyframes fadeIn {
  from {
    opacity: 0.7;
  }
  to {
    opacity: 1;
  }
}

.audio-player.fullscreen .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  width: 100%;
  padding: 0;
  position: relative;
}

.audio-player .player-content {
  will-change: opacity;
  transition: opacity 0.2s ease-out;
}

.audio-player.fullscreen .player-content {
  display: none;
  opacity: 0;
}

/* Animated Background Blobs */
.blob-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  will-change: opacity;
  transition: opacity 0.6s ease;
}

.audio-player.fullscreen .blob-container {
  opacity: 0.7; /* Start with some visibility */
}

.audio-player.fullscreen.playing .blob-container {
  opacity: 1;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.3;
  mix-blend-mode: screen;
  will-change: transform, opacity;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
  transform: translateZ(0);
}

.blob1 {
  width: 600px;
  height: 600px;
  background-color: rgba(var(--color-primary-rgb), 0.4);
  top: -300px;
  left: -200px;
  animation-name: blob1-float;
  animation-duration: 15s;
}

.blob2 {
  width: 450px;
  height: 450px;
  background-color: rgba(var(--color-secondary-rgb, 0, 195, 255), 0.3);
  bottom: -200px;
  right: -100px;
  animation-name: blob2-float;
  animation-duration: 18s;
}

.blob3 {
  width: 500px;
  height: 500px;
  background-color: rgba(var(--color-primary-rgb), 0.2);
  bottom: 30%;
  right: 10%;
  animation-name: blob3-float;
  animation-duration: 12s;
}

.blob4 {
  width: 350px;
  height: 350px;
  background-color: rgba(var(--color-secondary-rgb, 0, 195, 255), 0.25);
  top: 20%;
  left: 15%;
  animation-name: blob4-float;
  animation-duration: 20s;
}

/* Blob animation keyframes - simplified */
@keyframes blob1-float {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(50px, 150px) scale(1.05);
  }
}

@keyframes blob2-float {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(-60px, -100px) scale(1.05);
  }
}

@keyframes blob3-float {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(-40px, 40px) scale(1.05);
  }
}

@keyframes blob4-float {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(40px, -40px) scale(1.05);
  }
}

/* Pause animations when audio is paused */
.audio-player.fullscreen:not(.playing) .blob {
  animation-play-state: paused;
  opacity: 0.15; /* Reduce opacity when paused */
  transition: opacity 0.5s ease;
}

/* Fullscreen player with transitions - optimized */
.fullscreen-player {
  display: none;
  flex-direction: column;
  height: 100%;
  width: 100%;
  padding: 40px 20px 20px;
  position: relative;
  overflow-y: auto;
  z-index: 1; /* Ensure above blobs */
  opacity: 0;
  will-change: opacity, transform;
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
  transform: translateY(15px);
}

.audio-player.fullscreen .fullscreen-player {
  display: flex;
  opacity: 1;
  transform: translateY(0);
  /* Remove slideUp animation to reduce lag */
  animation: none;
}

/* Simplified slideUp animation */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Gradient overlay for visual interest */
.fullscreen-player::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 250px;
  background: linear-gradient(180deg, 
              rgba(var(--color-primary-rgb), 0.1) 0%, 
              rgba(var(--color-primary-rgb), 0) 100%);
  pointer-events: none;
  z-index: -1;
}

/* Close button with transition - optimized */
.audio-player.fullscreen .close-fullscreen {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(var(--color-primary-rgb), 0.4);
  cursor: pointer;
  z-index: 9999; /* Very high z-index to ensure it's on top */
  will-change: transform;
  transform: scale(1) rotate(0);
  transition: transform 0.25s ease;
  /* Remove animation to reduce lag */
  animation: none;
}

/* Simplified fadeRotateIn animation */
@keyframes fadeRotateIn {
  from {
    opacity: 0;
    transform: scale(0.7) rotate(-45deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

/* Close button hover effect */
.audio-player.fullscreen .close-fullscreen:hover {
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 5px 15px rgba(var(--color-primary-rgb), 0.5);
}

/* Top section with album art and info - optimized */
.fullscreen-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 40px;
  text-align: center;
  /* Remove animation to reduce lag */
  animation: none;
  opacity: 1;
  transform: translateY(0);
}

.fullscreen-album {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  position: relative;
  border: 10px solid rgba(var(--color-text-rgb), 0.1);
  will-change: transform;
}

.fullscreen-album::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20%;
  height: 20%;
  background: rgba(var(--color-bg-rgb), 0.8);
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

/* Add subtle animation to album art when playing */
.playing .fullscreen-album {
  animation: album-rotate 20s infinite linear;
}

/* Stop rotation when paused */
.fullscreen-album {
  transition: all 0.5s ease;
}

@keyframes album-rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.fullscreen-album img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fullscreen-info h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.fullscreen-info p {
  font-size: 16px;
  color: var(--color-text-light);
  margin: 0;
}

.fullscreen-description {
  margin-top: 15px !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
  max-width: 600px;
  opacity: 0.85;
  white-space: normal !important;
  overflow-wrap: break-word;
  word-wrap: break-word;
  /* Remove text truncation */
  display: block;
  overflow: visible;
}

/* Progress bar section - optimized */
.fullscreen-progress {
  width: 100%;
  max-width: 500px;
  margin: 0 auto 30px;
  /* Remove animation to reduce lag */
  animation: none;
  opacity: 1;
  transform: translateY(0);
}

.fullscreen-progress .progress-container {
  margin-top: 0;
}

.fullscreen-progress .progress-bar {
  height: 6px;
  background-color: rgba(var(--color-text-rgb), 0.1);
  border-radius: 3px;
}

.fullscreen-progress .progress {
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-radius: 3px;
  position: relative;
  will-change: width;
}

/* Reduce glow effect on progress bar to improve performance */
.playing .fullscreen-progress .progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 30px;
  background: linear-gradient(90deg, 
              transparent 0%, 
              rgba(255, 255, 255, 0.3) 50%, 
              transparent 100%);
  animation: progress-glow 2s linear infinite;
  will-change: transform;
}

@keyframes progress-glow {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(500%);
  }
}

.fullscreen-progress .current-time,
.fullscreen-progress .total-time {
  font-size: 14px;
  width: 50px;
  font-weight: 600;
}

.fullscreen-progress .current-time {
  color: var(--color-primary);
}

/* Player controls - optimized */
.fullscreen-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 40px;
  /* Remove animation to reduce lag */
  animation: none;
  opacity: 1;
  transform: translateY(0);
}

.fullscreen-controls .control-btn {
  font-size: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: rgba(var(--color-text-rgb), 0.05);
  color: var(--color-text);
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
}

.fullscreen-controls .control-btn:hover {
  background-color: rgba(var(--color-primary-rgb), 0.1);
  color: var(--color-primary);
  transform: translateY(-3px);
}

.fullscreen-controls .play-pause {
  width: 70px;
  height: 70px;
  font-size: 24px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  box-shadow: 0 5px 15px rgba(var(--color-primary-rgb), 0.4);
}

.fullscreen-controls .play-pause:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(var(--color-primary-rgb), 0.5);
  color: white;
}

/* Fix for play/pause icon toggle in fullscreen */
.fullscreen-controls .play-pause .fa-play {
  display: block;
}

.fullscreen-controls .play-pause .fa-pause {
  display: none;
}

.audio-player.playing .fullscreen-controls .play-pause .fa-play {
  display: none;
}

.audio-player.playing .fullscreen-controls .play-pause .fa-pause {
  display: block;
}

/* Responsive adjustments */
@media (min-width: 768px) {
  .fullscreen-top {
    flex-direction: row;
    text-align: left;
    gap: 40px;
    align-items: center;
    justify-content: center;
  }
  
  .fullscreen-album {
    margin-bottom: 0;
    width: 300px;
    height: 300px;
  }
  
  .fullscreen-info {
    max-width: 350px;
  }
  
  .fullscreen-info h2 {
    font-size: 36px;
  }
  
  .fullscreen-info p {
    font-size: 18px;
  }
  
  .fullscreen-controls .control-btn {
    width: 60px;
    height: 60px;
    font-size: 22px;
  }
  
  .fullscreen-controls .play-pause {
    width: 80px;
    height: 80px;
    font-size: 28px;
  }
}

/* Small screens adjustments */
@media (max-width: 480px) {
  .fullscreen-player {
    padding: 30px 15px 15px;
  }
  
  .fullscreen-album {
    width: 180px;
    height: 180px;
  }
  
  .fullscreen-info h2 {
    font-size: 22px;
  }
  
  .fullscreen-info p {
    font-size: 14px;
  }
  
  .fullscreen-controls {
    gap: 15px;
  }
  
  .fullscreen-controls .control-btn {
    width: 45px;
    height: 45px;
    font-size: 18px;
  }
  
  .fullscreen-controls .play-pause {
    width: 60px;
    height: 60px;
    font-size: 22px;
  }
}

/*marquee mod*/
/* Marquee container styles */
.marquee-container {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

/* Animation for the marquee effect */
@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Styling for the scrolling text */
.marquee-text {
  display: inline-block;
  padding-right: 50px; /* Space between the end and the beginning when it loops */
  animation: marquee 10s linear infinite;
}

/* Active marquee class - applied when text is overflowing */
.marquee-active {
  animation: marquee 10s linear infinite;
}

/* Non-active marquee won't animate */
.marquee-text:not(.marquee-active) {
  animation: none;
}

/* Adjust for small screens */
@media (max-width: 767px) {
  .marquee-text {
    animation-duration: 8s; /* Slightly faster on mobile */
  }
}

/* Make the track-details adapt to the marquee */
.track-details {
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
}

/* Style changes to the track-details h4 */
.track-details h4 {
  font-size: 14px;
  margin: 0 0 4px 0;
  font-weight: 600;
  /* Remove the overflow and text-overflow properties to let marquee work */
  overflow: visible;
  text-overflow: clip;
}

/* For fullscreen player, adjust the marquee timing */
.fullscreen-player .marquee-text {
  animation-duration: 15s;
}

/* Ensure all interactive elements are above the blobs */
.close-fullscreen,
.fullscreen-controls,
.fullscreen-top,
.fullscreen-progress {
  position: relative;
  z-index: 2;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}