/* ========================================
   Global Styles & Reset
   ======================================== */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #121212;
  color: #eee;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

/* ========================================
   Navigation
======================================== */

.nav {
  padding: 10px;
  border-radius: 20px;
  background-color: #1db954; /* Spotify-Grün */
  font-family: sans-serif;
  position: absolute;
  left: 89%;
  top: 2%;
  font-size: 15px;
}

.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Dropdown Struktur */
.dropdown-parent {
  position: relative;
  display: inline-block;
}

.dropdown-trigger {
  display: inline-block;
  cursor: pointer;
  font-weight: bold;
  color: white;
}

/* Dropdown Menü */
.dropdown {
  display: none;
  position: absolute;
  top: 220%;
  min-width: 160px;
  background-color: #1db954;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  border-radius: 20px;
}

.dropdown.show {
  display: block;
}

/* Dropdown Listenstruktur */
.dropdown li {
  display: block;
  padding: 5px 15px;
}

/* Links innerhalb Dropdowns */
.dropdown li a {
  position: relative;
  text-decoration: none;
  color: white;
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  overflow: hidden;
  z-index: 1;
  transition: color 0.3s ease;
  background-color: #1db954;
}

/* Glanz-Swipe von links */
.dropdown li a::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%
  );
  transform: skewX(-20deg);
  transition: left 0.4s ease;
  z-index: 2;
  border-radius: 10px;
}

/* Sanftes Hervorheben (Einfaden) */
.dropdown li a::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.08);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
  border-radius: 10px;
}

.dropdown li a:hover::before {
  left: 125%;
}

.dropdown li a:hover::after {
  opacity: 1;
}


/* Abschnittsüberschriften im Dropdown */
.meine-projekte,
.rechtliches {
  padding: 0;
  margin: 0;
}

.meine-projekte p,
.rechtliches p {
  font-weight: bold;
  margin: 0;
  padding: 0;
  color: white;
}

/* Tooltip */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltiptext {
  visibility: hidden;
  opacity: 0;
  background-color: black;
  color: white;
  text-align: center;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  position: absolute;
  top: 200%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* ========================================
   Haupt-Container: Last.fm Widget
   ======================================== */

#lastfm-widget {
  background: #1db954;
  border-radius: 14px;
  padding: 1.5rem 2rem;
  width: 440px;
  min-height: 420px;
  box-shadow: 0 12px 30px rgba(29, 185, 84, 0.4);
  user-select: none;
  text-align: left;
  position: relative;
}

/* ========================================
   Spotify User Info
   ======================================== */

.spotify-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 1rem;
  color: #fff;
}

.spotify-logo {
  width: 40px;
  height: 40px;
}

.copyable-username {
  position: relative;
  cursor: pointer;
  text-decoration: underline;
}

/* Tooltip-Text */
.copyable-username::after {
  content: "Meinen Spotifyname kopieren";
  position: absolute;
  bottom: 260%; /* Über dem Text */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 0.3rem 0.6rem;
  border-radius: 5px;
  white-space: nowrap;
  font-size: 0.8rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10;
}

/* Tooltip sichtbar beim Hover */
.copyable-username:hover::after,
.copyable-username:hover::before,
.copyable-username:focus::after,
.copyable-username:focus::before {
  opacity: 1;
  pointer-events: auto;
}

/* ========================================
   Now Playing Section
   ======================================== */

.now-playing {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-weight: 700;
  font-size: 1.3rem;
  padding: 0.8rem 1.2rem;
  background: rgba(255 255 255 / 0.15);
  border-radius: 30px;
  box-shadow: 0 0 8px rgba(255 255 255 / 0.2);
  color: #fff;
  margin-bottom: 1.5rem;
  transition: background-color 0.3s ease;
  gap: 0.5rem;
  cursor: default;
  user-select: none;
  min-height: 80px;
  width: 100%;
}

/* Cursor Pointer bei Hover auf pulsierendes now-playing */
.now-playing.animated:hover {
  cursor: pointer;
}

/* Animation */
.animated {
  animation: pulse-scale 2.5s ease-in-out infinite;
  box-shadow: 0 0 14px rgba(255 255 255 / 0.4);
}

.playing-icon {
  font-size: 1.7rem;
  color: #fff;
}

.now-playing-song,
.now-playing-artist {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.4;
}

/* ========================================
   Track History List
   ======================================== */

.history {
  margin-top: 30px;
}

.history h2 {
  margin-bottom: 0.5rem;
}

.track-list {
  list-style: none;
  padding-left: 0;
  max-height: 9.5em;  /* (wird durch folgende max-height überschrieben) */
  max-height: 245px;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  color: #f0f0f0;
}

.track-list::-webkit-scrollbar {
  width: 6px;
}

.track-list::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 6px;
}

.track-list li {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: rgba(255 255 255 / 0.1);
  margin-bottom: 0.5rem;
  font-weight: 600;
  cursor: default;
  transition: background-color 0.25s ease, transform 0.15s ease;
}

.track-list li:hover {
  background-color: rgba(255 255 255 / 0.25);
  box-shadow: 2px 0 8px rgba(255 255 255 / 0.3);
}

/* ========================================
   Copy Toast (Benachrichtigung beim Kopieren)
   ======================================== */

.copy-toast {
  position: absolute;
  bottom: -75px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: #1db954;
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 1000;
  user-select: none;
  white-space: nowrap;
}

.copy-toast.show {
  opacity: 1;
  pointer-events: auto;
}

/* ========================================
   Rechtliches also Datenschutz & Impressum
   ======================================== */

.rechtliches-unten {
  position: fixed;
  bottom: 10px;
  right: 10px;
  font-size: 14px;
  color: #aaa;
}

.rechtliches-unten a {
  color: #aaa;
  text-decoration: none;
  margin: 0 5px;
}

.rechtliches-unten a:hover {
  text-decoration: underline;
}

/* ========================================
   Animation Keyframes
   ======================================== */

@keyframes pulse-scale {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* ========================================
   Responsive Styles
   ======================================== */

@media (max-width: 600px) {
  body {
    padding: 1rem;
  }

  #lastfm-widget {
    width: 100%;
    padding: 1rem;
  }

  .track-list {
    max-height: 50vh;
  }

  .now-playing {
    font-size: 1rem;
  }

  .playing-icon {
    font-size: 1.2rem;
  }

  .track-list li {
    font-size: 0.9rem;
  }
}
