/**
 * Grid Jukebox Module - Styles
 * Retrofuturistic synthwave design with Grid aesthetic
 * Version: 1.1.0 - Updated with GridStream notifications border
 */

:root {
  /* Grid colors */
  --grid-bg: #0a0a0a;
  --grid-red: #e63946;
  --grid-dark: #1a1a1a;
  --grid-border: #333;
  
  /* Synthwave colors */
  --synth-pink: #ff006e;
  --synth-purple: #8338ec;
  --synth-cyan: #06ffa5;
  --synth-orange: #fb5607;
  --synth-yellow: #ffbe0b;
  
  /* Gradients */
  --gradient-fire: linear-gradient(135deg, #e63946 0%, #fb5607 100%);
  --gradient-cyber: linear-gradient(135deg, #06ffa5 0%, #8338ec 100%);
  --gradient-sunset: linear-gradient(135deg, #ff006e 0%, #ffbe0b 100%);
  --gradient-rainbow: linear-gradient(90deg, 
    var(--synth-pink) 0%, 
    var(--grid-red) 20%, 
    var(--synth-orange) 40%, 
    var(--synth-yellow) 60%, 
    var(--synth-cyan) 80%, 
    var(--synth-purple) 100%);
}

/* ==========================================================================
   Main Container - Updated with notifications-style border
   ========================================================================== */

.mod-gridjukebox {
  width: 320px;
  max-width: 100%;
  background: linear-gradient(135deg, #1a0a0f 0%, #2a1520 100%);
  border: 2px solid transparent;
  border-image: linear-gradient(90deg, #e63946, #ff8a24) 1;
  border-radius: 20px 0 20px 0;
  padding: 16px;
  color: #fff;
  font-family: 'Courier New', monospace;
  position: relative;
  overflow: hidden;
}

/* Scanline effect */
.mod-gridjukebox::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
      0deg,
      rgba(230, 57, 70, 0.03) 0px,
      transparent 1px,
      transparent 2px,
      rgba(230, 57, 70, 0.03) 3px
  );
  pointer-events: none;
  z-index: 1;
}

.mod-gridjukebox > * {
  position: relative;
  z-index: 2;
}

.mod-gridjukebox--compact {
  padding: 12px;
}

/* ==========================================================================
   Source Mode Buttons
   ========================================================================== */

.jukebox-sources {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.source-btn {
  flex: 1;
  background: var(--grid-dark);
  border: 1px solid var(--grid-border);
  color: #999;
  padding: 10px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.source-icon {
  font-size: 16px;
  display: block;
}

.source-label {
  font-size: 9px;
  opacity: 0.7;
}

.source-btn:hover {
  border-color: var(--grid-red);
  color: #fff;
  transform: translateY(-2px);
}

.source-btn.active {
  background: var(--gradient-fire);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 20px rgba(230, 57, 70, 0.5);
}

.source-btn.active[data-source="youtube"] {
  background: var(--gradient-fire);
}

.source-btn.active[data-source="radio"] {
  background: var(--gradient-cyber);
  box-shadow: 0 0 20px rgba(6, 255, 165, 0.5);
}

.source-btn.active[data-source="spotify"] {
  background: linear-gradient(135deg, #e63946 0%, #fb5607 100%);
}

/* ==========================================================================
   Visualizer
   ========================================================================== */

.jukebox-visualizer {
  height: 80px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  margin-bottom: 16px;
  padding: 10px;
  background: rgba(26, 26, 26, 0.5);
  border: 1px solid var(--grid-border);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.visualizer-bar {
  flex: 1;
  min-width: 0;
  background: var(--gradient-rainbow);
  border-radius: 2px 2px 0 0;
  height: var(--bar-height, 20%);
  animation: visualizerPulse 0.8s ease-in-out infinite;
  animation-delay: calc(var(--bar-index) * 0.05s);
  filter: brightness(0.7);
  transition: height 0.1s ease, filter 0.3s ease;
}

.mod-gridjukebox.playing .visualizer-bar {
  animation: none;
    animation: none;  filter: brightness(1.2);
  box-shadow: 0 0 10px currentColor;
}

@keyframes visualizerPulse {
  0%, 100% { 
    height: 20%;
    opacity: 0.6;
  }
  50% { 
    height: calc(30% + (var(--bar-index) * 3%));
    opacity: 1;
  }
}

.visualizer-scanline {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-rainbow);
  opacity: 0.8;
  animation: scanlineMove 3s linear infinite;
  filter: blur(1px);
}

@keyframes scanlineMove {
  from { transform: translateY(0); }
  to { transform: translateY(80px); }
}

/* ==========================================================================
   Album Art
   ========================================================================== */

.jukebox-artwork {
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 16px;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--grid-border);
  background: var(--grid-dark);
}

.artwork-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.artwork-image.loaded {
  display: block;
}

.artwork-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, 
    rgba(230, 57, 70, 0.1) 0%, 
    rgba(131, 56, 236, 0.1) 100%);
  position: relative;
}

.artwork-placeholder::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 70%
  );
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.artwork-icon {
  font-size: 64px;
  opacity: 0.3;
  z-index: 1;
}

.mod-gridjukebox--compact .jukebox-artwork {
  aspect-ratio: 16/9;
}

/* ==========================================================================
   Track Info
   ========================================================================== */

.jukebox-info {
  margin-bottom: 16px;
  position: relative;
}

.track-title {
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  font-size: 12px;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--grid-red);
  color: #fff;
  font-size: 9px;
  padding: 3px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: bold;
}

.source-badge[data-source="spotify"] {
  background: linear-gradient(135deg, #1db954 0%, #1ed760 100%);
}

.source-badge[data-source="youtube"] {
  background: linear-gradient(135deg, #ff0000 0%, #ff4444 100%);
}

.source-badge[data-source="radio"] {
  background: var(--gradient-cyber);
}

/* ==========================================================================
   Progress Bar
   ========================================================================== */

.jukebox-progress {
  margin-bottom: 16px;
}

.progress-bar {
  height: 6px;
  background: var(--grid-dark);
  border: 1px solid var(--grid-border);
  border-radius: 3px;
  margin-bottom: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-fire);
  width: 0%;
  transition: width 0.1s linear;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
  animation: progressShine 1.5s ease-in-out infinite;
}

@keyframes progressShine {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

.progress-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 12px;
  height: 12px;
  background: #fff;
  border: 2px solid var(--grid-red);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(230, 57, 70, 0.8);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.progress-bar:hover .progress-handle {
  opacity: 1;
}

.progress-time {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #666;
  font-family: 'Courier New', monospace;
}

/* ==========================================================================
   Controls
   ========================================================================== */

.jukebox-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.control-btn {
  background: var(--grid-dark);
  border: 1px solid var(--grid-border);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-family: inherit;
  position: relative;
}

.control-btn--small {
  width: 40px;
  height: 40px;
  font-size: 16px;
}

.control-btn--large {
  width: 56px;
  height: 56px;
  font-size: 20px;
}

.control-btn:hover {
  border-color: var(--grid-red);
  background: rgba(230, 57, 70, 0.1);
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(230, 57, 70, 0.3);
}

.control-btn:active {
  transform: scale(0.95);
}

.control-btn.active {
  background: var(--gradient-fire);
  border-color: transparent;
  box-shadow: 0 0 20px rgba(230, 57, 70, 0.6);
}

.control-icon {
  display: block;
}

/* ==========================================================================
   Volume Control
   ========================================================================== */

.jukebox-volume {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.volume-icon {
  font-size: 18px;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.volume-icon:hover {
  opacity: 1;
}

.volume-slider {
  flex: 1;
  height: 6px;
  appearance: none;
  background: var(--grid-dark);
  border: 1px solid var(--grid-border);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  background: #fff;
  border: 2px solid var(--synth-cyan);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(6, 255, 165, 0.5);
  transition: all 0.3s ease;
}

.volume-slider:hover::-webkit-slider-thumb {
  transform: scale(1.2);
  box-shadow: 0 0 20px rgba(6, 255, 165, 0.8);
}

.volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #fff;
  border: 2px solid var(--synth-cyan);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(6, 255, 165, 0.5);
  transition: all 0.3s ease;
}

.volume-slider:hover::-moz-range-thumb {
  transform: scale(1.2);
  box-shadow: 0 0 20px rgba(6, 255, 165, 0.8);
}

/* Volume fill gradient */
.volume-slider::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, 
    var(--synth-cyan) 0%, 
    var(--synth-purple) 100%);
  height: 6px;
  border-radius: 3px;
}

/* ==========================================================================
   Status & Settings
   ========================================================================== */

.jukebox-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #666;
  transition: all 0.3s ease;
}

.mod-gridjukebox.connected .status-dot {
  background: #0f0;
  box-shadow: 0 0 10px #0f0;
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.settings-btn {
  background: transparent;
  border: 1px solid var(--grid-border);
  color: #999;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.settings-btn:hover {
  border-color: var(--grid-red);
  color: #fff;
  background: rgba(230, 57, 70, 0.1);
  transform: rotate(90deg);
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
  .mod-gridjukebox {
    width: 100%;
    max-width: 100%;
    border-radius: 10px;
  }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.control-btn:focus,
.source-btn:focus,
.settings-btn:focus,
.volume-slider:focus {
  outline: 2px solid var(--synth-cyan);
  outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .mod-gridjukebox,
  .source-btn,
  .control-btn,
  .settings-btn {
    transition: none;
  }

  .visualizer-bar,
  .visualizer-scanline,
  .progress-fill::after,
  .status-dot {
    animation: none;
  }
}

/* ==========================================================================
   Source Mode Buttons
   ========================================================================== */

.jukebox-sources {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.source-btn {
  flex: 1;
  background: var(--grid-dark);
  border: 1px solid var(--grid-border);
  color: #999;
  padding: 10px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.source-icon {
  font-size: 16px;
  display: block;
}

.source-label {
  font-size: 9px;
  opacity: 0.7;
}

.source-btn:hover {
  border-color: var(--grid-red);
  color: #fff;
  transform: translateY(-2px);
}

.source-btn.active {
  background: var(--gradient-fire);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 20px rgba(230, 57, 70, 0.5);
}

.source-btn.active[data-source="youtube"] {
  background: var(--gradient-fire);
}

.source-btn.active[data-source="radio"] {
  background: var(--gradient-cyber);
  box-shadow: 0 0 20px rgba(6, 255, 165, 0.5);
}

.source-btn.active[data-source="spotify"] {
  background: linear-gradient(135deg, #e63946 0%, #fb5607 100%);
}

/* ==========================================================================
   Visualizer
   ========================================================================== */

.jukebox-visualizer {
  height: 80px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  margin-bottom: 16px;
  padding: 10px;
  background: rgba(26, 26, 26, 0.5);
  border: 1px solid var(--grid-border);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.visualizer-bar {
  flex: 1;
  min-width: 0;
  background: var(--gradient-rainbow);
  border-radius: 2px 2px 0 0;
  height: var(--bar-height, 20%);
  animation: visualizerPulse 0.8s ease-in-out infinite;
  animation-delay: calc(var(--bar-index) * 0.05s);
  filter: brightness(0.7);
  transition: height 0.1s ease, filter 0.3s ease;
}

.mod-gridjukebox.playing .visualizer-bar {
  animation: none;
    animation: none;  filter: brightness(1.2);
  box-shadow: 0 0 10px currentColor;
}

@keyframes visualizerPulse {
  0%, 100% { 
    height: 20%;
    opacity: 0.6;
  }
  50% { 
    height: calc(30% + (var(--bar-index) * 3%));
    opacity: 1;
  }
}

.visualizer-scanline {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-rainbow);
  opacity: 0.8;
  animation: scanlineMove 3s linear infinite;
  filter: blur(1px);
}

@keyframes scanlineMove {
  from { transform: translateY(0); }
  to { transform: translateY(80px); }
}

/* ==========================================================================
   Album Art
   ========================================================================== */

.jukebox-artwork {
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 16px;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--grid-border);
  background: var(--grid-dark);
}

.artwork-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.artwork-image.loaded {
  display: block;
}

.artwork-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, 
    rgba(230, 57, 70, 0.1) 0%, 
    rgba(131, 56, 236, 0.1) 100%);
  position: relative;
}

.artwork-placeholder::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 70%
  );
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.artwork-icon {
  font-size: 64px;
  opacity: 0.3;
  z-index: 1;
}

.mod-gridjukebox--compact .jukebox-artwork {
  aspect-ratio: 16/9;
}

/* ==========================================================================
   Track Info
   ========================================================================== */

.jukebox-info {
  margin-bottom: 16px;
  position: relative;
}

.track-title {
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  font-size: 12px;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--grid-red);
  color: #fff;
  font-size: 9px;
  padding: 3px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: bold;
}

.source-badge[data-source="spotify"] {
  background: linear-gradient(135deg, #1db954 0%, #1ed760 100%);
}

.source-badge[data-source="youtube"] {
  background: linear-gradient(135deg, #ff0000 0%, #ff4444 100%);
}

.source-badge[data-source="radio"] {
  background: var(--gradient-cyber);
}

/* ==========================================================================
   Progress Bar
   ========================================================================== */

.jukebox-progress {
  margin-bottom: 16px;
}

.progress-bar {
  height: 6px;
  background: var(--grid-dark);
  border: 1px solid var(--grid-border);
  border-radius: 3px;
  margin-bottom: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-fire);
  width: 0%;
  transition: width 0.1s linear;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
  animation: progressShine 1.5s ease-in-out infinite;
}

@keyframes progressShine {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

.progress-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 12px;
  height: 12px;
  background: #fff;
  border: 2px solid var(--grid-red);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(230, 57, 70, 0.8);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.progress-bar:hover .progress-handle {
  opacity: 1;
}

.progress-time {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #666;
  font-family: 'Courier New', monospace;
}

/* ==========================================================================
   Controls
   ========================================================================== */

.jukebox-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.control-btn {
  background: var(--grid-dark);
  border: 1px solid var(--grid-border);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-family: inherit;
  position: relative;
}

.control-btn--small {
  width: 40px;
  height: 40px;
  font-size: 16px;
}

.control-btn--large {
  width: 56px;
  height: 56px;
  font-size: 20px;
}

.control-btn:hover {
  border-color: var(--grid-red);
  background: rgba(230, 57, 70, 0.1);
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(230, 57, 70, 0.3);
}

.control-btn:active {
  transform: scale(0.95);
}

.control-btn.active {
  background: var(--gradient-fire);
  border-color: transparent;
  box-shadow: 0 0 20px rgba(230, 57, 70, 0.6);
}

.control-icon {
  display: block;
}

/* ==========================================================================
   Volume Control
   ========================================================================== */

.jukebox-volume {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.volume-icon {
  font-size: 18px;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.volume-icon:hover {
  opacity: 1;
}

.volume-slider {
  flex: 1;
  height: 6px;
  appearance: none;
  background: var(--grid-dark);
  border: 1px solid var(--grid-border);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  background: #fff;
  border: 2px solid var(--synth-cyan);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(6, 255, 165, 0.5);
  transition: all 0.3s ease;
}

.volume-slider:hover::-webkit-slider-thumb {
  transform: scale(1.2);
  box-shadow: 0 0 20px rgba(6, 255, 165, 0.8);
}

.volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #fff;
  border: 2px solid var(--synth-cyan);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(6, 255, 165, 0.5);
  transition: all 0.3s ease;
}

.volume-slider:hover::-moz-range-thumb {
  transform: scale(1.2);
  box-shadow: 0 0 20px rgba(6, 255, 165, 0.8);
}

/* Volume fill gradient */
.volume-slider::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, 
    var(--synth-cyan) 0%, 
    var(--synth-purple) 100%);
  height: 6px;
  border-radius: 3px;
}

/* ==========================================================================
   Status & Settings
   ========================================================================== */

.jukebox-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #666;
  transition: all 0.3s ease;
}

.mod-gridjukebox.connected .status-dot {
  background: #0f0;
  box-shadow: 0 0 10px #0f0;
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.settings-btn {
  background: transparent;
  border: 1px solid var(--grid-border);
  color: #999;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.settings-btn:hover {
  border-color: var(--grid-red);
  color: #fff;
  background: rgba(230, 57, 70, 0.1);
  transform: rotate(90deg);
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
  .mod-gridjukebox {
    width: 100%;
    max-width: 100%;
  }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.control-btn:focus,
.source-btn:focus,
.settings-btn:focus,
.volume-slider:focus {
  outline: 2px solid var(--synth-cyan);
  outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}


/* ==========================================================================
   Settings Modal
   ========================================================================== */

.jukebox-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.jukebox-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.jukebox-modal-content {
  position: relative;
  background: linear-gradient(135deg, rgba(26, 26, 26, 0.98), rgba(15, 15, 25, 0.98));
  border: 2px solid var(--grid-border);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5),
              0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.jukebox-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--grid-border);
}

.jukebox-modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.jukebox-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 32px;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}

.jukebox-modal-close:hover {
  color: var(--accent-primary);
  transform: rotate(90deg);
}

.jukebox-modal-body {
  padding: 24px;
}

.settings-section {
  margin-bottom: 24px;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.settings-description {
  margin: 0 0 16px 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.spotify-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
}

.spotify-status--linked {
  background: rgba(30, 215, 96, 0.1);
  border: 1px solid rgba(30, 215, 96, 0.3);
  color: #1ed760;
}

.spotify-status--unlinked {
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
  color: #ffc107;
}

.status-icon {
  font-size: 18px;
}

.btn-spotify {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 24px;
  background: #1ed760;
  color: #000;
  border: none;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(30, 215, 96, 0.3);
}

.btn-spotify:hover {
  background: #1fdf64;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30, 215, 96, 0.4);
}

.btn-spotify:active {
  transform: translateY(0);
}

.btn-spotify--unlink {
  background: #dc3545;
  box-shadow: 0 4px 16px rgba(220, 53, 69, 0.3);
}

.btn-spotify--unlink:hover {
  background: #c82333;
  box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.spotify-icon {
  flex-shrink: 0;
}

.settings-note {
  margin: 16px 0 0 0;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.settings-note strong {
  color: var(--accent-primary);
}

/* ===================================
   Clickable Artwork
   =================================== */

.artwork-image {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.artwork-image[style*="cursor: pointer"]:hover {
  transform: scale(1.05);
  opacity: 0.9;
}






