/**
 * Music Browser Module Styles
 * Cyberpunk/Techno theme with black background and neon accents
 */

/* Base Music Browser Container */
.theo-music-browser {
  font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
  background: #000000;
  border: 1px solid #00ffff;
  border-radius: 0;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3), inset 0 0 20px rgba(0, 255, 255, 0.1);
  overflow: hidden;
  margin: 20px 0;
  max-width: 100%;
  position: relative;
}

.theo-music-browser::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(90deg, transparent 0%, rgba(0, 255, 255, 0.03) 50%, transparent 100%),
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 255, 255, 0.03) 2px, rgba(0, 255, 255, 0.03) 4px);
  pointer-events: none;
  z-index: 0;
}

.theo-music-browser > * {
  position: relative;
  z-index: 1;
}

/* Dark theme support */
.theme-dark .theo-music-browser,
body.theme-dark .theo-music-browser {
  background: #000000;
  border-color: #00ffff;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3), inset 0 0 20px rgba(0, 255, 255, 0.1);
}

/* Breadcrumb Navigation */
.music-browser-breadcrumb {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(180deg, #0a0a0a 0%, #000000 100%);
  border-bottom: 1px solid #00ffff;
  flex-wrap: wrap;
  gap: 4px;
  box-shadow: 0 2px 10px rgba(0, 255, 255, 0.2);
}

.theme-dark .music-browser-breadcrumb,
body.theme-dark .music-browser-breadcrumb {
  background: linear-gradient(180deg, #0a0a0a 0%, #000000 100%);
  border-bottom-color: #00ffff;
}

.breadcrumb-root {
  background: transparent;
  border: 1px solid #00ffff;
  padding: 6px 12px;
  cursor: pointer;
  color: #00ffff;
  font-size: 13px;
  font-weight: bold;
  transition: all 0.3s ease;
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.breadcrumb-root:hover {
  color: #000000;
  background: #00ffff;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.8), inset 0 0 10px rgba(0, 255, 255, 0.3);
  transform: translateY(-1px);
}

.breadcrumb-separator {
  color: #00ffff;
  margin: 0 8px;
  font-size: 16px;
  text-shadow: 0 0 5px rgba(0, 255, 255, 0.8);
}

.breadcrumb-path {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.breadcrumb-part {
  background: transparent;
  border: 1px solid #00ffff;
  padding: 6px 12px;
  cursor: pointer;
  color: #00ffff;
  font-size: 13px;
  transition: all 0.3s ease;
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.breadcrumb-part:hover {
  color: #000000;
  background: #00ffff;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.8), inset 0 0 10px rgba(0, 255, 255, 0.3);
  transform: translateY(-1px);
}

.breadcrumb-part.current {
  color: #00ffff;
  cursor: default;
  font-weight: bold;
  background: rgba(0, 255, 255, 0.1);
  box-shadow: inset 0 0 10px rgba(0, 255, 255, 0.3);
}

/* Loading, Error, and Empty States */
.music-browser-loading,
.music-browser-error,
.music-browser-content {
  padding: 40px 20px;
  background: #000000;
}

.music-browser-loading {
  text-align: center;
  color: #00ffff;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(0, 255, 255, 0.2);
  border-top-color: #00ffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.music-browser-error {
  text-align: center;
  color: #ff00ff;
}

.error-icon {
  font-size: 48px;
  margin-bottom: 16px;
  text-shadow: 0 0 10px rgba(255, 0, 255, 0.8);
}

.error-message {
  margin: 16px 0;
  font-size: 16px;
  color: #ff00ff;
  text-shadow: 0 0 5px rgba(255, 0, 255, 0.5);
}

.music-browser-retry {
  background: #000000;
  color: #00ffff;
  border: 2px solid #00ffff;
  padding: 12px 24px;
  border-radius: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.3s ease;
  margin-top: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
}

.music-browser-retry:hover {
  background: #00ffff;
  color: #000000;
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.8), inset 0 0 10px rgba(0, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* Folders Section */
.music-browser-folders-section {
  padding: 20px;
  border-bottom: 1px solid #00ffff;
  background: #000000;
  box-shadow: 0 2px 10px rgba(0, 255, 255, 0.1);
}

.folders-title {
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: bold;
  color: #00ffff;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
  font-family: 'Courier New', monospace;
}

.folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .folders-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
  }
}

@media (max-width: 480px) {
  .folders-grid {
    grid-template-columns: 1fr;
  }
}

.folder-card {
  background: linear-gradient(135deg, #0a0a0a 0%, #000000 100%);
  border: 2px solid #00ffff;
  border-radius: 0;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 140px;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.folder-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(0, 255, 255, 0.1), transparent);
  transform: rotate(45deg);
  transition: all 0.5s ease;
  opacity: 0;
}

.folder-card:hover::before {
  opacity: 1;
  animation: scan 2s linear infinite;
}

@keyframes scan {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.folder-card:hover {
  background: linear-gradient(135deg, #001a1a 0%, #000000 100%);
  border-color: #00ffff;
  transform: translateY(-5px);
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.8), inset 0 0 20px rgba(0, 255, 255, 0.2);
}

.folder-icon {
  font-size: 48px;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 10px rgba(0, 255, 255, 0.8));
  transition: all 0.3s ease;
}

.folder-card:hover .folder-icon {
  transform: scale(1.1);
  filter: drop-shadow(0 0 15px rgba(0, 255, 255, 1));
}

.folder-info {
  width: 100%;
}

.folder-name {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 10px;
  color: #00ffff;
  word-break: break-word;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
  font-family: 'Courier New', monospace;
}

.folder-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  color: #00ffff;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
}

.folder-song-count,
.folder-plays-count {
  display: block;
  opacity: 0.8;
  text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

.folders-empty,
.songs-empty {
  text-align: center;
  padding: 40px 20px;
  color: #00ffff;
  opacity: 0.6;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 10px rgba(0, 255, 255, 0.5));
}

/* Songs Section */
.music-browser-songs-section {
  padding: 20px;
  background: #000000;
}

.songs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
  position: relative;
}

.songs-title {
  margin: 0;
  font-size: 18px;
  font-weight: bold;
  color: #00ffff;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
  font-family: 'Courier New', monospace;
}

.songs-sort-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  position: absolute;
  top: 0;
  right: 0;
}

.sort-label {
  color: #00ffff;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
  opacity: 0.8;
  text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
  white-space: nowrap;
}

.sort-select {
  background: #000000;
  border: 1px solid #00ffff;
  color: #00ffff;
  padding: 6px 10px;
  font-size: 11px;
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300ffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 10px;
  padding-right: 28px;
  min-width: 100px;
}

.sort-select:hover {
  border-color: #00ffff;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
  background-color: rgba(0, 255, 255, 0.05);
}

.sort-select:focus {
  outline: none;
  border-color: #00ffff;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.7), inset 0 0 10px rgba(0, 255, 255, 0.1);
  background-color: rgba(0, 255, 255, 0.1);
}

.sort-select option {
  background: #000000;
  color: #00ffff;
  padding: 8px;
}

.sort-reverse-btn {
  background: #000000;
  border: 1px solid #00ffff;
  color: #00ffff;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
  padding: 0;
  font-size: 16px;
  line-height: 1;
  font-family: 'Courier New', monospace;
}

.sort-reverse-btn:hover {
  border-color: #00ffff;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
  background-color: rgba(0, 255, 255, 0.1);
}

.sort-reverse-btn:active {
  transform: scale(0.95);
}

.sort-reverse-btn.active {
  background: rgba(0, 255, 255, 0.2);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.7), inset 0 0 10px rgba(0, 255, 255, 0.2);
  border-color: #00ffff;
}

.sort-reverse-btn.active .sort-reverse-icon {
  color: #00ffff;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

.sort-reverse-icon {
  display: inline-block;
  transition: transform 0.3s ease;
  color: #00ffff;
  opacity: 0.8;
}

.sort-reverse-btn.active .sort-reverse-icon {
  opacity: 1;
  transform: rotate(180deg);
}

.songs-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.song-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(90deg, #0a0a0a 0%, #000000 100%);
  border: 2px solid #00ffff;
  border-radius: 0;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
  min-height: 120px;
}

.song-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #00ffff;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.song-item:hover {
  background: linear-gradient(90deg, #001a1a 0%, #000000 100%);
  border-color: #00ffff;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.5), inset 0 0 10px rgba(0, 255, 255, 0.1);
  transform: translateX(5px);
}

.song-item:hover::before {
  transform: scaleY(1);
}

.song-item.playing {
  background: linear-gradient(90deg, rgba(0, 255, 255, 0.15) 0%, #000000 100%);
  border-color: #00ffff;
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.6), inset 0 0 15px rgba(0, 255, 255, 0.2);
}

.song-item.playing::before {
  transform: scaleY(1);
  background: #00ffff;
  box-shadow: 0 0 15px rgba(0, 255, 255, 1);
}

.song-controls {
  flex-shrink: 0;
}

.song-play-btn {
  width: 80px;
  height: 80px;
  border-radius: 0;
  border: 2px solid #00ffff;
  background: #000000;
  color: #00ffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 24px;
  padding: 0;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.song-play-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  transition: all 0.3s ease;
  z-index: 1;
}

.song-play-btn:hover::before {
  background: rgba(0, 0, 0, 0.3);
}

.song-play-btn .play-icon,
.song-play-btn .pause-icon,
.song-play-btn .loading-icon {
  position: relative;
  z-index: 2;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

.song-play-btn:hover {
  background: #00ffff;
  color: #000000;
  transform: scale(1.1);
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.8), inset 0 0 10px rgba(0, 255, 255, 0.3);
}

.song-play-btn.playing {
  background: #ff00ff;
  border-color: #ff00ff;
  color: #000000;
  box-shadow: 0 0 25px rgba(255, 0, 255, 0.8), inset 0 0 10px rgba(255, 0, 255, 0.3);
}

.song-play-btn.playing:hover {
  background: #ff00ff;
  box-shadow: 0 0 35px rgba(255, 0, 255, 1), inset 0 0 15px rgba(255, 0, 255, 0.4);
}

.song-play-btn.paused {
  background: #000000;
  border-color: #00ffff;
  color: #00ffff;
  animation: pulsePaused 2s ease-in-out infinite;
}

.song-play-btn.paused:hover {
  background: rgba(0, 255, 255, 0.1);
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.8), inset 0 0 15px rgba(0, 255, 255, 0.2);
}

@keyframes pulsePaused {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.8);
    opacity: 0.9;
  }
}

.song-item.paused .song-play-btn .play-icon {
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

.song-play-btn.loading {
  background: #000000;
  border-color: #00ffff;
  color: #00ffff;
  cursor: wait;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 15px rgba(0, 255, 255, 0.4); }
  50% { box-shadow: 0 0 25px rgba(0, 255, 255, 0.8); }
}

.play-icon,
.pause-icon,
.loading-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.loading-icon {
  animation: spin 1s linear infinite;
}

.song-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.song-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.song-waveform-container {
  position: relative;
  width: 100%;
  height: 60px;
  margin-top: 8px;
  border: 1px solid rgba(0, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.5);
  overflow: hidden;
  cursor: pointer;
}

.song-waveform {
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.9;
  filter: brightness(0.8);
}

.song-item.playing .song-waveform {
  filter: brightness(1.2);
  opacity: 1;
}

.song-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, 
    rgba(0, 255, 255, 0.6) 0%, 
    rgba(0, 255, 255, 0.4) 50%,
    rgba(255, 0, 255, 0.4) 100%);
  pointer-events: none;
  transition: width 0.1s linear;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.6), inset 0 0 10px rgba(0, 255, 255, 0.3);
  mix-blend-mode: screen;
  z-index: 1;
}

.song-item.playing .song-progress {
  background: linear-gradient(90deg, 
    rgba(255, 0, 255, 0.7) 0%, 
    rgba(255, 0, 255, 0.5) 50%,
    rgba(0, 255, 255, 0.5) 100%);
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.7), inset 0 0 15px rgba(255, 0, 255, 0.4);
}

.song-seek-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  cursor: pointer;
  z-index: 2;
}

.song-hover-indicator {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #00ffff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
  z-index: 3;
}

.song-title {
  font-size: 14px;
  font-weight: bold;
  color: #00ffff;
  word-break: break-word;
  flex: 1;
  min-width: 0;
  text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.song-play-count {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #00ffff;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
  opacity: 0.8;
}

.play-count-number {
  font-weight: bold;
  color: #00ffff;
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.8);
  font-size: 13px;
}

.play-count-label {
  text-transform: lowercase;
  opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
  .theo-music-browser {
    margin: 10px 0;
  }
  
  .music-browser-breadcrumb {
    padding: 12px 16px;
    font-size: 12px;
  }
  
  .music-browser-folders-section,
  .music-browser-songs-section {
    padding: 16px;
  }
  
  .folders-title,
  .songs-title {
    font-size: 16px;
  }
  
  .songs-header {
    position: relative;
  }
  
  .songs-sort-controls {
    position: static;
    width: 100%;
    justify-content: flex-end;
    margin-top: 8px;
  }
  
  .sort-select {
    flex: 1;
    min-width: auto;
  }
  
  .folder-card {
    padding: 16px;
    min-height: 120px;
  }
  
  .folder-icon {
    font-size: 40px;
  }
  
  .song-item {
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .breadcrumb-path {
    font-size: 11px;
  }
  
  .folder-card {
    min-height: 100px;
  }
  
  .folder-icon {
    font-size: 36px;
  }
  
  .song-info {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .song-play-count {
    align-self: flex-end;
  }
}
