/* --- Mitster — Dark Theme --- */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0a0a0a;
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hidden {
  display: none !important;
}

/* --- Login View --- */
.view {
  text-align: center;
  width: 100%;
  max-width: 500px;
  padding: 2rem;
}

.logo {
  font-size: 5rem;
  margin-bottom: 1rem;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

h1 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #1DB954, #1ed760);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: #888;
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.9rem 2.5rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.btn:active {
  transform: translateY(0);
}

.btn-spotify {
  background: #1DB954;
  color: #000;
}

.btn-spotify:hover {
  background: #1ed760;
}

.btn-cards {
  background: rgba(255, 255, 255, 0.08);
  color: #e0e0e0;
  border: 1px solid #333;
  margin-top: 0.75rem;
  font-size: 0.95rem;
}

.btn-cards:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #555;
}

/* --- Player View --- */
#player-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  justify-content: center;
  padding-bottom: 5rem;
}

.player-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
  max-width: 360px;
}

/* Cover Placeholder */
.now-playing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.cover-placeholder {
  width: 200px;
  height: 200px;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border-radius: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.music-icon {
  font-size: 5rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.status {
  font-size: 1.2rem;
  color: #aaa;
  font-weight: 500;
}

/* --- Controls --- */
.controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.btn-control {
  background: none;
  border: none;
  color: #e0e0e0;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-control:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.btn-play {
  font-size: 2rem;
  width: 64px;
  height: 64px;
  background: #1DB954;
  color: #000;
  border-radius: 50%;
}

.btn-play:hover {
  background: #1ed760;
  color: #000;
}

/* --- Progress Bar --- */
.progress-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.time {
  font-size: 0.8rem;
  color: #888;
  min-width: 40px;
  text-align: center;
}

.progress-bar,
.volume-bar {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: #333;
  outline: none;
  cursor: pointer;
}

.progress-bar::-webkit-slider-thumb,
.volume-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #1DB954;
  cursor: pointer;
  transition: transform 0.1s;
}

.progress-bar::-webkit-slider-thumb:hover,
.volume-bar::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

/* --- Volume & Timer Settings Row --- */
.player-bottom {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.volume-icon {
  font-size: 1rem;
}

.timer-setting {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.timer-label {
  font-size: 1rem;
  color: #aaa;
  flex-shrink: 0;
}

.timer-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1DB954;
  min-width: 30px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.timer-slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 0;
  height: 4px;
  border-radius: 2px;
  background: #333;
  outline: none;
  cursor: pointer;
}

.timer-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #1DB954;
  cursor: pointer;
  transition: transform 0.1s;
}

.timer-slider::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

/* --- Timer Countdown --- */
.timer-display {
  background: rgba(29, 185, 84, 0.08);
  border: 1px solid rgba(29, 185, 84, 0.2);
  border-radius: 8px;
  padding: 0.4rem 1.2rem;
  text-align: center;
}

.timer-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1DB954;
  font-variant-numeric: tabular-nums;
}

.timer-text.timer-warning {
  color: #ff4444;
  animation: timerPulse 0.5s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* --- Scan Button --- */
.btn-scan {
  background: linear-gradient(135deg, rgba(29, 185, 84, 0.2), rgba(29, 185, 84, 0.05));
  color: #1DB954;
  border: 1px solid rgba(29, 185, 84, 0.4);
  font-size: 1.1rem;
  padding: 0.8rem 1.5rem;
  width: 100%;
}

.btn-scan:hover {
  background: rgba(29, 185, 84, 0.25);
  border-color: #1DB954;
}

/* --- Scanner Overlay --- */
.scanner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
}

.scanner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 500px;
  margin-bottom: 1rem;
}

.scanner-header h3 {
  color: #1DB954;
  font-size: 1.2rem;
}

.btn-close-scanner {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
}

.btn-close-scanner:hover {
  background: rgba(255, 255, 255, 0.2);
}

#qr-reader {
  width: 100%;
  max-width: 500px;
  border-radius: 12px;
  overflow: hidden;
}

.scanner-hint {
  color: #888;
  margin-top: 1rem;
  font-size: 0.9rem;
}

/* --- Reveal Button --- */
.btn-reveal {
  background: rgba(255, 255, 255, 0.08);
  color: #1DB954;
  border: 1px solid rgba(29, 185, 84, 0.3);
  font-size: 0.95rem;
}

.btn-reveal:hover {
  background: rgba(29, 185, 84, 0.15);
  border-color: #1DB954;
}

/* --- Revealed Song Info --- */
.reveal-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal-cover {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
}

.reveal-text {
  text-align: left;
}

.reveal-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
}

.reveal-artist {
  color: #aaa;
  font-size: 0.95rem;
  margin-top: 0.2rem;
}

.reveal-year {
  color: #1DB954;
  font-weight: 700;
  font-size: 1.2rem;
  margin-top: 0.3rem;
}

/* --- Footer --- */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, #0a0a0a 30%);
  padding: 1.5rem 1rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.footer-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.footer-buttons .btn {
  margin-top: 0;
}

.device-status {
  font-size: 0.8rem;
  color: #666;
}

.btn-small {
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
}

/* --- Mobile First (Smartphone Player) --- */
@media (max-width: 480px) {
  body {
    align-items: flex-start;
  }

  .view {
    padding: 1rem;
  }

  #player-view {
    padding-bottom: 4.5rem;
    justify-content: flex-start;
    padding-top: 1rem;
  }

  .player-container {
    gap: 1rem;
    max-width: 100%;
  }

  .cover-placeholder {
    width: 140px;
    height: 140px;
    border-radius: 12px;
  }

  .music-icon {
    font-size: 3.5rem;
  }

  .now-playing {
    gap: 0.75rem;
  }

  .status {
    font-size: 1rem;
  }

  .logo {
    font-size: 3.5rem;
  }

  h1 {
    font-size: 2.2rem;
  }

  .controls {
    gap: 1rem;
  }

  .btn-control {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }

  .btn-play {
    width: 56px;
    height: 56px;
    font-size: 1.7rem;
  }

  /* Größere Touch-Targets für Slider */
  .progress-bar::-webkit-slider-thumb,
  .volume-bar::-webkit-slider-thumb,
  .timer-slider::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
  }

  .progress-bar,
  .volume-bar,
  .timer-slider {
    height: 6px;
  }

  /* Volume + Timer untereinander auf kleinen Screens */
  .player-bottom {
    flex-direction: column;
    gap: 0.75rem;
  }

  .volume-container,
  .timer-setting {
    width: 100%;
  }

  .timer-display {
    padding: 0.3rem 1rem;
  }

  .timer-text {
    font-size: 1rem;
  }

  .reveal-cover {
    width: 52px;
    height: 52px;
  }

  .reveal-title { font-size: 1rem; }
  .reveal-artist { font-size: 0.85rem; }
  .reveal-year { font-size: 1rem; }

  .footer {
    padding: 0.75rem 0.75rem 0.6rem;
    background: linear-gradient(transparent, #0a0a0a 20%);
  }

  .footer-buttons { gap: 0.4rem; }

  .footer-buttons .btn {
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
  }

  .device-status { font-size: 0.7rem; }
}

/* Sehr kleine Screens (SE, Mini) */
@media (max-width: 360px) {
  .cover-placeholder {
    width: 120px;
    height: 120px;
  }

  h1 { font-size: 1.8rem; }

  .btn {
    padding: 0.7rem 1.8rem;
    font-size: 0.9rem;
  }
}
