/* Lokale Schriftarten statt Google Fonts für DSGVO-Konformität */
@import url('/static/css/local-fonts.css');

:root {
  --primary: #1DB954;
  --dark: #121212;
  --light: #282828;
  --text: #FFFFFF;
  --text-secondary: #B3B3B3;
  
  /* Dynamische Spacing-Variablen */
  --header-height: 80px;
  --search-section-height: 120px;
  --player-controls-height: 120px;
  --tab-navigation-height: 60px;
  --content-padding: 20px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--dark);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  position: relative;
}

body::before, .loading-screen::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  background-image:
    radial-gradient(2px 2px at 40px 60px, #fff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 20px 50px, #417690, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 30px 100px, #1DB954, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 40px 60px, #FF1E6F, rgba(0,0,0,0));
  background-size: 200px 200px, 170px 170px, 210px 210px, 220px 220px;
  background-repeat: repeat;
  animation: stars 100s linear infinite;
  opacity: 0.4;
  z-index: -1;
}

.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(220deg, #0B1A2E 0%, #1B2A4B 50%, #1A2E3A 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-content {
  text-align: center;
  color: white;
}

.galaxy-spinner {
  width: 100px;
  height: 100px;
  margin: 0 auto 20px;
  background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite, rotate 20s linear infinite;
  position: relative;
}

.loading-status {
  margin-top: 15px;
  font-size: 14px;
  opacity: 0.9;
  transition: all 0.3s ease;
}

.loading-status #loadingProgress {
  font-weight: bold;
  color: #5A9AB8;
  font-size: 16px;
  transition: color 0.3s ease;
}

/* Player Container Animations */
.player-container {
  transition: opacity 0.8s ease-in;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.sort-order-btn {
  margin-top: 0.5rem;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.sort-order-btn {
  margin-top: 0.8rem;
  padding: 10px 20px;
  background: rgba(65, 118, 144, 0.2);
  border: 1px solid rgba(65, 118, 144, 0.3);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.sort-order-btn:hover {
  background: rgba(65, 118, 144, 0.3);
  border-color: rgba(65, 118, 144, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(65, 118, 144, 0.2);
}

.sort-order-btn i {
  font-size: 16px;
  color: #417690;
  transition: transform 0.3s ease;
}

.sort-order-btn span {
  font-weight: 500;
  background: linear-gradient(90deg, #fff, #417690);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sort-order-btn.reversed i {
  transform: rotate(180deg);
}

.sort-order-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(65, 118, 144, 0.1);
}

.fancy-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: linear-gradient(90deg, #417690 0%, #1db954 100%);
    border: none;
    border-radius: 30px;
    padding: 0 24px;
    height: 44px;
    color: #fff;
    font-weight: bold;
    font-size: 1.05rem;
    cursor: pointer;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    box-shadow: 0 4px 18px rgba(65,118,144,0.18);
    margin-bottom: 2px;
    margin-left: 0;
    margin-top: 0;
    margin-right: 0;
    gap: 0;
}
.fancy-toggle:active {
    transform: scale(0.97);
}
.fancy-toggle .toggle-bg {
    position: absolute;
    left: 10px;
    top: 10px;
    width: 26px;
    height: 26px;
    background: #fff2;
    border-radius: 50%;
    transition: background 0.3s;
}
.fancy-toggle.active .toggle-bg {
    background: #fff8;
}
.fancy-toggle .toggle-knob {
    position: absolute;
    left: 13px;
    top: 13px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px #0002;
    transition: left 0.3s, background 0.3s;
}
.fancy-toggle.active .toggle-knob {
    left: 35px;
    background: #1db954;
}
.fancy-toggle .toggle-label {
    margin-left: 0;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
    transition: color 0.3s;
}

.fancy-toggle.active .toggle-label {
    color: #1db954;
}

.player-container {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  width: 100%;
}

.main-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  margin-bottom: 110px;
}

.space-objects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

#ufo-animation {
  position: absolute;
  width: 200px;
  height: 200px;
  opacity: 0.8;
  animation: randomUfoMove 20s linear infinite;
}

@keyframes randomUfoMove {
  0% {
      left: -200px;
      top: var(--start-y);
      transform: translateY(0) rotate(var(--rotation));
  }
  25% {
      left: 25%;
      top: calc(var(--start-y) + var(--wave-height));
      transform: translateY(20px) rotate(calc(var(--rotation) + 5deg));
  }
  50% {
      left: 50%;
      top: var(--start-y);
      transform: translateY(0) rotate(var(--rotation));
  }
  75% {
      left: 75%;
      top: calc(var(--start-y) - var(--wave-height));
      transform: translateY(-20px) rotate(calc(var(--rotation) - 5deg));
  }
  100% {
      left: 100%;
      top: var(--start-y);
      transform: translateY(0) rotate(var(--rotation));
  }
}

/* UFO Animationen */
.ufo-container {
  position: fixed;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.ufo-spawner {
  position: absolute;
  width: 100%;
  height: 100%;
}

.ufo-instance {
  position: absolute;
  width: 150px;
  height: 150px;
  opacity: 0;
  animation: 
    randomSpawn 1s ease-in-out forwards,
    randomFloat 20s linear infinite;
}

@keyframes randomSpawn {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes randomFloat {
  0% {
    left: -150px;
    top: var(--random-y);
    transform: rotate(var(--random-rotate));
  }
  100% {
    left: calc(100% + 150px);
    top: var(--random-y);
    transform: rotate(var(--random-rotate));
  }
}

/* Planeten Container */
.planets {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

/* Planeten Styling */
.planet {
  position: absolute;
  border-radius: 50%;
  opacity: 0.4;
  filter: blur(4px);
  animation: orbit linear infinite;
}

/* Verschiedene Planeten */
.planet-1 {
  width: 100px;
  height: 100px;
  background: radial-gradient(circle at 30% 30%, #FF1E6F, #1B2A4B);
  animation-duration: 30s;
  left: -50px;
  top: 20%;
}

.planet-2 {
  width: 150px;
  height: 150px;
  background: radial-gradient(circle at 40% 40%, #417690, #0B1A2E);
  animation-duration: 45s;
  right: -75px;
  top: 60%;
}

.planet-3 {
  width: 80px;
  height: 80px;
  background: radial-gradient(circle at 35% 35%, #1DB954, #1A2E3A);
  animation-duration: 25s;
  left: 30%;
  bottom: -40px;
}

/* Orbit Animation */
@keyframes orbit {
  from {
    transform: rotate(0deg) translateX(100px) rotate(0deg);
  }
  to {
    transform: rotate(360deg) translateX(100px) rotate(-360deg);
  }
}

.stars {
  position: fixed;
  top: 0; left: 0; width: 200vw; height: 200vh; /* Vergrößert, damit die Bewegung nicht zu Lücken führt */
  pointer-events: none;
  z-index: -2;
  background-repeat: repeat;
  opacity: 0.3;
  will-change: transform; /* Performance-Optimierung */
}

.stars1 {
  animation: moveStars1 180s linear infinite;
}
.stars2 {
  animation: moveStars2 240s linear infinite;
}
.stars3 {
  animation: moveStars3 300s linear infinite;
}

@keyframes moveStars1 {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(250px, 100px) rotate(15deg); }
  50% { transform: translate(500px, -50px) rotate(45deg); }
  75% { transform: translate(750px, 120px) rotate(30deg); }
  100% { transform: translate(1000px, 0) rotate(60deg); }
}

@keyframes moveStars2 {
  0% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(-300px, 80px) rotate(-20deg); }
  66% { transform: translate(-700px, -120px) rotate(-40deg); }
  100% { transform: translate(-1000px, 0) rotate(-60deg); }
}

@keyframes moveStars3 {
  0% { transform: translate(0, 0) rotate(0deg); }
  20% { transform: translate(120px, 200px) rotate(10deg); }
  40% { transform: translate(-80px, 400px) rotate(25deg); }
  60% { transform: translate(100px, 600px) rotate(40deg); }
  80% { transform: translate(-50px, 800px) rotate(55deg); }
  100% { transform: translate(0, 1000px) rotate(70deg); }
}

/* Überarbeitete Partikel-Animation für Schwerelosigkeit */
@keyframes float {
  0% { 
    transform: translateY(0) translateX(0) scale(1) rotate(0deg); 
    opacity: 0.7;
  }
  25% { 
    transform: translateY(-15px) translateX(10px) scale(1.1) rotate(5deg); 
    opacity: 0.9;
  }
  50% { 
    transform: translateY(-25px) translateX(-15px) scale(1.15) rotate(10deg); 
    opacity: 0.7;
  }
  75% { 
    transform: translateY(-10px) translateX(5px) scale(1.05) rotate(5deg); 
    opacity: 0.8;
  }
  100% { 
    transform: translateY(0) translateX(0) scale(1) rotate(0deg); 
    opacity: 0.7;
  }
}

/* Partikel-Eigenschaften anpassen */
.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.7;
  filter: blur(1px);
  animation: float 15s ease-in-out infinite;
  box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.3); /* Leuchten hinzufügen */
}

/* Unterschiedliche Animations-Parameter für die Partikel */
.p1 { width: 10px; height: 10px; background: #fff; left: 20vw; top: 30vh; animation-delay: 0s; animation-duration: 18s; }
.p2 { width: 16px; height: 16px; background: #417690; left: 60vw; top: 80vh; animation-delay: 2s; animation-duration: 22s; }
.p3 { width: 8px; height: 8px; background: #1DB954; left: 80vw; top: 40vh; animation-delay: 4s; animation-duration: 16s; }
.p4 { width: 12px; height: 12px; background: #FF1E6F; left: 10vw; top: 70vh; animation-delay: 1s; animation-duration: 20s; }
.p5 { width: 18px; height: 18px; background: #fff; left: 50vw; top: 10vh; animation-delay: 3s; animation-duration: 24s; }

.logo {
  width: 100%;
  text-align: center;
  margin-bottom: 1rem;
}

.logo::before {
  display: none;
}

.home-link {
  color: var(--text);
  text-decoration: none;
  font-size: 28px;
  display: inline-block;
}

.home-link span {
  font-family: 'Orbitron', sans-serif;
  background: linear-gradient(90deg, #fff, #417690, #fff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

.home-link i {
  font-size: 24px;
  background: linear-gradient(45deg, #FF1E6F, #FF9A44);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  flex-shrink: 0;
}

@keyframes shine {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

.content {
  padding: 24px;
  overflow-y: auto;
  background: linear-gradient(to bottom, #303030, var(--dark));
}

/* Category Tabs Styling */
.category-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 16px;
  padding: 0 16px;
  position: relative;
  height: var(--tab-navigation-height); /* Dynamische Tab-Höhe */
}

.category-tab {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 12px 12px 0 0;
  color: var(--text-secondary);
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  flex: 1;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.category-tab i {
  font-size: 18px;
  margin-right: 4px;
  opacity: 0.8;
}

/* Aktiver Tab */
.category-tab.active {
  background: rgba(29, 185, 84, 0.15);
  color: var(--text);
  box-shadow: 0 -4px 12px rgba(29, 185, 84, 0.2);
}

/* Animation für aktiven Tab */
.category-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #1db954, #417690);
  animation: glowPulse 2s infinite alternate;
}

.category-tab:not(.active):hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

/* Glüheffekt Animation */
@keyframes glowPulse {
  0% { box-shadow: 0 0 5px rgba(29, 185, 84, 0.7); }
  100% { box-shadow: 0 0 15px rgba(65, 118, 144, 0.9); }
}

/* Räumliche Änderung der Suchbox für bessere Ausrichtung */
.search-container {
  margin-top: 4px;
  margin-bottom: 16px;
}

.search-box {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px 15px;
  border-radius: 8px;
  gap: 10px;
}

.search-box i {
  color: var(--text-secondary);
}

.search-box input {
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  width: 100%;
  outline: none;
}

.search-box input::placeholder {
  color: var(--text-secondary);
}

.search-box:focus-within {
  background: rgba(255, 255, 255, 0.15);
}

.song-list {
  min-height: 0;
  margin-bottom: 0.5rem;
  padding-bottom: 0;
  flex: 1; /* Song-Liste nimmt verfügbaren Platz ein */
  overflow: hidden; /* Verhindert Überlauf auf Container-Ebene */
  margin-top: var(--content-padding); /* Dynamischer Abstand zur Suchbox */
}

/* Songs Container neu gestalten */
.songs-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding: 16px;
  max-height: calc(100vh - var(--header-height) - var(--search-section-height) - var(--player-controls-height) - var(--tab-navigation-height) - (var(--content-padding) * 2));
  min-height: 200px; /* Mindesthöhe für immer sichtbare Songs */
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
  transition: opacity 0.3s ease;
  /* Besseres Scroll-Verhalten für neueste Songs */
  padding-top: var(--content-padding);
  padding-bottom: calc(var(--player-controls-height) + var(--content-padding));
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  margin-bottom: var(--content-padding);
  margin-top: calc(var(--content-padding) / 2);
}

/* Favoriten-Tab spezifische Anpassungen */
#favorites-section .songs-container.favorites-songs {
  max-height: calc(100vh - var(--header-height) - var(--player-controls-height) - var(--tab-navigation-height) - (var(--content-padding) * 2)); /* Weniger Header-Platz im Favoriten-Tab */
  padding-top: calc(var(--content-padding) / 2); /* Weniger Abstand oben */
  padding-bottom: calc(var(--player-controls-height) + var(--content-padding)); /* Dynamischer Abstand unten */
  margin-top: calc(var(--content-padding) / 2); /* Weniger Abstand zum Header */
}

/* Suchleiste, Genre-Filter und Song-List NUR im Favoriten-Tab ausblenden */
body.favorites-tab-active .search-container,
body.favorites-tab-active .search-box,
body.favorites-tab-active .genre-filter-container,
body.favorites-tab-active #genreFilterContainer,
body.favorites-tab-active .song-list {
  display: none !important;
}

/* Favoriten-Sektion direkt unter Tabs positionieren */
#favorites-section {
  margin-top: 0 !important; /* Kein Abstand zu den Tabs */
}

/* Favoriten-Header kompakter machen und näher an Tabs */
#favorites-section .favorites-header {
  padding: 12px 20px !important; /* Weniger Padding */
  margin-top: 0 !important; /* Direkt unter den Tabs */
  margin-bottom: 0 !important; /* Kein Abstand nach unten */
}

#favorites-section .favorites-hint {
  padding: 8px 15px !important; /* Weniger Padding */
  margin-top: 0 !important; /* Kein Abstand nach oben */
}

#favorites-section .favorites-input {
  margin-top: 8px !important; /* Weniger Abstand */
  margin-bottom: 5px !important; /* Weniger Abstand nach unten */
}

.songs-container.main-songs,
.songs-container.story-songs {
  will-change: opacity, transform;
}

/* Einzelne Song-Kacheln */
.song-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  background: rgba(65, 118, 144, 0.1);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(65, 118, 144, 0.2);
  transition: all 0.3s ease;
  cursor: pointer;
  overflow: hidden;
}

.song-item:hover {
  transform: translateY(-5px);
  background: rgba(65, 118, 144, 0.2);
  border-color: rgba(65, 118, 144, 0.4);
  box-shadow: 0 8px 20px rgba(65, 118, 144, 0.2);
}

.song-info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
}

.song-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

.song-play-icon {
  font-size: 48px;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
  margin-bottom: 12px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.song-item:hover .song-play-icon {
  opacity: 1;
  transform: scale(1);
}

.song-number {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0,0,0,0.6);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.song-title {
  font-size: 16px;
  font-weight: 600;
  margin-top: auto;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.song-details {
  width: 100%;
  text-align: center;
  margin-top: 8px;
}

.duration {
  font-size: 12px;
  color: var(--text-secondary);
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Abstand nach oben für den Story/Main-Songs Button */
#sourceFilterBtn.fancy-toggle {
    margin-top: 5px;
}

/* Mobile Anpassungen */
@media (max-width: 768px) {
  .songs-container {
      grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
      gap: 12px;
      padding: 12px;
      max-height: calc(100vh - 150px); /* Noch weniger Abzug für mobile */
      min-height: 150px; /* Mindesthöhe für mobile */
      padding-bottom: 280px; /* Viel mehr Platz für mobile Player Controls */
      /* Mobile optimiertes Scrolling */
      -webkit-overflow-scrolling: touch;
      scroll-behavior: smooth;
      /* Touch-Optimierung für bessere Performance */
      will-change: scroll-position;
      /* Zusätzliche Sicherheit gegen Verdeckung */
      margin-bottom: 50px;
  }
}

.song-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.song-title {
  font-size: 15px;
  font-weight: 500;
}

.song-artist {
  font-size: 14px;
  color: var(--text-secondary);
}

.player-controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--player-controls-height); /* Dynamische Höhe */
  background: linear-gradient(180deg, rgba(18,18,18,0.85) 0%, rgba(27,42,75,0.95) 100%);
  padding: 1.2rem 2rem;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  border-top: 1px solid rgba(65, 118, 144, 0.2);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 -5px 20px rgba(0,0,0,0.3);
  z-index: 100;
  height: auto;
  min-height: 100px;
  transition: all 0.3s ease;
}

/* Verbesserter Now Playing Bereich */
.now-playing {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 10px;
  max-width: 300px;
}

#currentCover {
  width: 62px;
  height: 62px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  object-fit: cover;
}

#currentCover:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 15px rgba(65, 118, 144, 0.4);
}

.track-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}

.track-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.track-artist {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Verbesserte Control Buttons */
.control-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 8px;
  width: 100%;
}

.control-buttons-left,
.control-buttons-center,
.control-buttons-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.control-buttons-left {
  justify-content: flex-start;
  flex: 1;
}

.control-buttons-center {
  justify-content: center;
  flex: 0 0 auto;
}

.control-buttons-right {
  justify-content: flex-end;
  flex: 1;
}

.control-btn {
  background: linear-gradient(135deg, rgba(65, 118, 144, 0.15), rgba(90, 154, 184, 0.25));
  border: 1px solid rgba(65, 118, 144, 0.3);
  border-radius: 12px;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.17, 0.67, 0.83, 0.67);
  opacity: 0.9;
  padding: 12px 16px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.control-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(65, 118, 144, 0.2) 0%, rgba(0,0,0,0) 70%);
  border-radius: 12px;
  opacity: 0;
  transform: scale(0);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.control-btn:hover::before {
  opacity: 1;
  transform: scale(1);
}

.control-btn.prev,
.control-btn.next {
  font-size: 18px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-btn:hover {
  opacity: 1;
  transform: translateY(-2px);
  color: #fff;
  background: linear-gradient(135deg, rgba(65, 118, 144, 0.25), rgba(90, 154, 184, 0.4));
  border-color: rgba(65, 118, 144, 0.5);
  box-shadow: 0 4px 15px rgba(65, 118, 144, 0.3);
}

.control-btn:active {
  transform: translateY(0) scale(0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.control-btn.play {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #417690, #5A9AB8);
  color: #fff;
  font-size: 24px;
  opacity: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  position: relative;
  box-shadow: 0 4px 20px rgba(65, 118, 144, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.control-btn.play i {
  position: relative;
  left: 2px; /* Zentriert das Play-Icon besser */
}

.control-btn.play.playing i {
  left: 0;
}

.control-btn.play:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(65, 118, 144, 0.6);
  background: linear-gradient(135deg, #4d8ba3, #6bb3d6);
  border-color: rgba(255, 255, 255, 0.2);
}

.control-btn.play:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: 0 4px 15px rgba(65, 118, 144, 0.5);
}

.control-btn.play.playing {
  animation: playPulse 2.5s infinite;
  background: linear-gradient(135deg, #1DB954, #5A9AB8);
}

@keyframes playPulse {
  0% { box-shadow: 0 0 0 0 rgba(65, 118, 144, 0.6); }
  70% { box-shadow: 0 0 0 15px rgba(65, 118, 144, 0); }
  100% { box-shadow: 0 0 0 0 rgba(65, 118, 144, 0); }
}

.control-btn.playmode {
  margin-left: 6px;
  font-size: 16px;
  position: relative;
  background: linear-gradient(135deg, rgba(65, 118, 144, 0.2), rgba(90, 154, 184, 0.3));
  border: 1px solid rgba(65, 118, 144, 0.4);
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.control-btn.playmode:hover {
  background: linear-gradient(135deg, rgba(65, 118, 144, 0.35), rgba(90, 154, 184, 0.5));
  border-color: rgba(65, 118, 144, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(65, 118, 144, 0.3);
}

.control-btn.playmode.shuffle {
  background: linear-gradient(135deg, rgba(29, 185, 84, 0.25), rgba(90, 154, 184, 0.3));
  border-color: rgba(29, 185, 84, 0.5);
  color: #1DB954;
}

.control-btn.playmode.shuffle:hover {
  background: linear-gradient(135deg, rgba(29, 185, 84, 0.4), rgba(90, 154, 184, 0.5));
  border-color: rgba(29, 185, 84, 0.7);
  box-shadow: 0 4px 15px rgba(29, 185, 84, 0.3);
}

.control-btn.playmode.loop {
  background: linear-gradient(135deg, rgba(65, 118, 144, 0.25), rgba(255, 30, 111, 0.2));
  border-color: rgba(65, 118, 144, 0.5);
  color: #417690;
}

.control-btn.playmode.loop:hover {
  background: linear-gradient(135deg, rgba(65, 118, 144, 0.4), rgba(255, 30, 111, 0.3));
  border-color: rgba(65, 118, 144, 0.7);
  box-shadow: 0 4px 15px rgba(65, 118, 144, 0.4);
}

/* Verbesserte Fortschrittsleiste */
.progress {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px;
}

.progress-bar {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.progress-current {
  height: 100%;
  background: linear-gradient(90deg, #1DB954, #417690);
  border-radius: 3px;
  position: relative;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px rgba(29, 185, 84, 0.4);
}

.progress-handle {
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: all 0.2s ease;
  cursor: grab;
  box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

.progress-handle.active,
.progress-bar:hover .progress-handle {
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}

.progress-bar:active .progress-handle {
  cursor: grabbing;
  transform: translateY(-50%) scale(1.3);
  box-shadow: 0 0 10px rgba(255,255,255,0.5);
}

/* ...existing code... */

.current-time, .total-time {
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 40px;
  font-variant-numeric: tabular-nums;
}

/* Verbesserte Lautstärkekontrolle */
.volume-control {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}

.volume-control i {
  font-size: 18px;
  opacity: 0.8;
  transition: opacity 0.2s ease;
  cursor: pointer;
}

.volume-control i:hover {
  opacity: 1;
}

.volume-slider {
  width: 100px;
  position: relative;
}

.volume-bar {
  position: relative;
  width: 85px;
  height: 5px;
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
  cursor: pointer;
  overflow: hidden;
}

.volume-current {
  position: absolute;
  height: 100%;
  background: linear-gradient(90deg, #417690, #1DB954);
  border-radius: 3px;
  transition: width 0.15s ease;
  min-width: 2px;
  opacity: 1;
  width: 70%;
}

.volume-handle {
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  left: 70%;
  top: 50%;
  transform: translate(-50%, -50%);
  cursor: grab;
  box-shadow: 0 0 5px rgba(0,0,0,0.3);
  transition: all 0.2s ease;
  opacity: 0.7;
}

.volume-handle.active,
.volume-bar:hover .volume-handle {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

.volume-handle:active {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.3);
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
  .player-controls {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    padding: 1rem;
    gap: 16px;
  }
  
  .center-controls {
    order: 1;
    margin-bottom: 0;
  }
  
  .now-playing {
    order: 0;
    max-width: 100%;
    justify-content: center;
  }
  
  .volume-control {
    order: 2;
    justify-content: center;
    width: 100%;
  }
  
  .volume-slider {
    width: 60%;
    max-width: 200px;
  }
  
  .control-buttons {
    margin-bottom: 12px;
  }
  
  /* Größere Buttons auf Mobilgeräten */
  .control-btn.play {
    width: 60px;
    height: 60px;
  }
  
  .control-btn.prev,
  .control-btn.next {
    font-size: 20px;
  }
}

/* Für größere Touchbereiche auf mobilen Geräten */
@media (pointer: coarse) {
  .volume-handle, .progress-handle {
    width: 20px;
    height: 20px;
  }
  
  .progress-bar, .volume-bar {
    height: 8px;
  }
  
  .control-buttons {
    gap: 24px;
  }
}

/* Performance-Button Styling */
.performance-toggle {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
  padding-right: 16px;
}

.performance-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 20px;
  color: var(--text);
  padding: 8px 14px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.performance-btn:hover {
  background: rgba(29, 185, 84, 0.2);
  transform: translateY(-2px);
}

.performance-btn.active {
  background: rgba(29, 185, 84, 0.3);
  box-shadow: 0 0 10px rgba(29, 185, 84, 0.4);
}

.performance-btn.active .performance-label {
  color: var(--primary);
}

/* Performance-Modus CSS-Klassen */
body.performance-mode .stars,
body.performance-mode .particles,
body.performance-mode .particle,
body.performance_mode .galaxy-particles,
body.performance_mode .planet,
body.performance_mode .space-animation-container,
body.performance_mode .ufo-container {
  display: none !important;
}

body.performance-mode .progress-current {
  box-shadow: none;
}

body.performance-mode .control-btn.play {
  animation: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

body.performance-mode .volume-current,
body.performance-mode .category-tab.active::after {
  background: var(--primary);
  animation: none;
}

body.performance-mode .song-item {
  backdrop-filter: none;
  transition: none;
}

body.performance-mode .song-item:hover {
  transform: none;
}

body.performance-mode .player-controls {
  backdrop-filter: none;
  background: rgba(18,18,18,0.95);
}

/* Mobile Optimierungen im Performance-Modus */
@media (max-width: 768px) {
  .performance-label {
    display: none;
  }
  
  .performance-btn {
    padding: 8px;
  }
}

/* Toast Notifications */
.toast-notification {
  position: fixed;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: rgba(29, 185, 84, 0.9);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  z-index: 1000;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  font-size: 14px;
  text-align: center;
  max-width: 80%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.toast-notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Share-Button Styling */
.control-btn.share {
  margin-left: 8px;
  font-size: 16px;
  background: linear-gradient(135deg, rgba(65, 118, 144, 0.2), rgba(90, 154, 184, 0.3));
  border: 1px solid rgba(65, 118, 144, 0.4);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.control-btn.share:hover {
  background: linear-gradient(135deg, rgba(29, 185, 84, 0.3), rgba(90, 154, 184, 0.4));
  border-color: rgba(29, 185, 84, 0.5);
  color: #1DB954;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(29, 185, 84, 0.3);
}

.control-btn.share:active {
  background: linear-gradient(135deg, rgba(29, 185, 84, 0.4), rgba(90, 154, 184, 0.5));
  transform: translateY(0) scale(0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Share-Modal Styling */
.share-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  backdrop-filter: blur(5px);
}

.share-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(145deg, #1e1e1e, #2a2a2a);
  border-radius: 16px;
  padding: 0;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(65, 118, 144, 0.3);
}

.share-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.share-modal-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  background: linear-gradient(90deg, #fff, #417690);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.share-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.share-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.share-modal-body {
  padding: 20px;
}

.current-song-info {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}

.share-song-cover {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
}

.share-song-details h4 {
  margin: 0 0 8px 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.share-song-details p {
  margin: 4px 0;
  color: var(--text-secondary);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.share-song-details p i {
  font-size: 12px;
  opacity: 0.7;
}

.share-song-artist {
  color: var(--text);
  font-weight: 500;
}

.share-song-meta {
  color: var(--text-secondary);
  font-size: 12px;
}

.share-link-container {
  margin-bottom: 24px;
}

.share-link-container label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 500;
}

.share-link-input-group {
  display: flex;
  gap: 8px;
}

.share-link-input-group input {
  flex: 1;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
}

.share-link-input-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(29, 185, 84, 0.2);
}

.copy-btn {
  padding: 12px 16px;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.copy-btn:hover {
  background: #1aa84a;
  transform: translateY(-1px);
}

.share-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.share-action-btn {
  flex: 1;
  min-width: 120px;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.share-action-btn.primary {
  background: linear-gradient(45deg, #417690, #1DB954);
  color: white;
}

.share-action-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(65, 118, 144, 0.3);
}

.share-action-btn.whatsapp {
  background: #25D366;
  color: white;
}

.share-action-btn.whatsapp:hover {
  background: #20b954;
  transform: translateY(-2px);
}

.share-action-btn.email {
  background: #EA4335;
  color: white;
}

.share-action-btn.email:hover {
  background: #d23527;
  transform: translateY(-2px);
}

/* Performance-Modus: Share-Modal vereinfachen */
body.performance-mode .share-modal-content {
  backdrop-filter: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

body.performance-mode .share-action-btn {
  transition: none;
}

body.performance-mode .share-action-btn:hover {
  transform: none;
}

/* Mobile Anpassungen */
@media (max-width: 768px) {
  .control-btn.share {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  
  .share-modal-content {
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .current-song-info {
    flex-direction: column;
    text-align: center;
  }
  
  .share-actions {
    flex-direction: column;
  }
  
  .share-link-input-group {
    flex-direction: column;
  }
}

/* Neu-Markierung für Songs */
.song-item.new::before {
  content: 'NEU';
  position: absolute;
  top: 6px;
  right: 6px;
  background: linear-gradient(45deg, #FF1E6F, #FF6B35);
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  box-shadow: 0 3px 8px rgba(255, 30, 111, 0.5), 0 0 0 2px rgba(255, 255, 255, 0.3);
  animation: newSongPulse 2s ease-in-out infinite;
  z-index: 20;
  letter-spacing: 0.5px;
}

@keyframes newSongPulse {
  0%, 100% { 
    opacity: 1; 
    transform: scale(1);
  }
  50% { 
    opacity: 0.8; 
    transform: scale(1.05);
  }
}

.song-item {
  position: relative;
}

/* Genre Filter Styling */
.genre-filter-container {
  background: rgba(40, 40, 40, 0.8);
  border-radius: 12px;
  padding: 16px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.genre-filter-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9em;
}

.genre-filter-header i {
  color: var(--primary);
}

.genre-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.genre-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(65, 118, 144, 0.1);
  border: 1px solid rgba(65, 118, 144, 0.3);
  border-radius: 20px;
  color: var(--text);
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.genre-btn:hover {
  background: rgba(65, 118, 144, 0.2);
  border-color: rgba(65, 118, 144, 0.5);
  transform: translateY(-2px);
}

.genre-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(29, 185, 84, 0.3);
}

.genre-count {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 0.8em;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.genre-btn.active .genre-count {
  background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
  .genre-buttons {
    gap: 6px;
  }
  
  .genre-btn {
    padding: 6px 10px;
    font-size: 0.8em;
  }
}

/* Song Genre Tags */
.song-genre-tag {
  display: inline-block;
  background: rgba(29, 185, 84, 0.2);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 0.7em;
  font-weight: 500;
  margin-top: 4px;
  border: 1px solid rgba(29, 185, 84, 0.3);
}

.song-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.song-artist {
  font-size: 0.8em;
  color: var(--text-secondary);
}

/* Playing State für Song Items - sowohl .playing als auch .active */
.song-item.playing,
.song-item.active {
  background: rgba(29, 185, 84, 0.2);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(29, 185, 84, 0.2);
  transform: scale(1.05);
}

.song-item.playing .play-icon,
.song-item.active .play-icon,
.song-item.playing .song-play-icon,
.song-item.active .song-play-icon {
  opacity: 1;
  color: var(--primary);
  transform: scale(1);
}

.song-item.playing .song-title,
.song-item.active .song-title {
  color: var(--primary);
  font-weight: 600;
}