/* Pick A Song - Playful & Joyful Kids Party Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Quicksand:wght@500;600;700&display=swap');

:root {
  --primary-pink: #ff5e8e;
  --primary-blue: #38bdf8;
  --sunny-yellow: #fde047;
  --mint-green: #4ade80;
  --bubble-purple: #c084fc;
  --creamsicle-orange: #fb923c;
  --bg-gradient: linear-gradient(135deg, #fdfbf7 0%, #fef3c7 40%, #fed7aa 70%, #fbcfe8 100%);
  --card-bg: rgba(255, 255, 255, 0.94);
  --card-shadow: 0 10px 25px -5px rgba(251, 146, 60, 0.2), 0 8px 10px -6px rgba(251, 146, 60, 0.15);
  --border-radius-lg: 24px;
  --border-radius-md: 16px;
  --border-radius-sm: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Fredoka', 'Quicksand', system-ui, -apple-system, sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: #334155;
  min-height: 100vh;
  padding-bottom: 80px;
  overflow-x: hidden;
  position: relative;
}

/* Floating background particles */
.floating-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-item {
  position: absolute;
  font-size: 1.8rem;
  opacity: 0.35;
  user-select: none;
  animation: floatUp 16s linear infinite;
}

@keyframes floatUp {
  0% {
    transform: translateY(110vh) rotate(0deg) scale(0.8);
    opacity: 0;
  }
  15% {
    opacity: 0.45;
  }
  85% {
    opacity: 0.45;
  }
  100% {
    transform: translateY(-10vh) rotate(360deg) scale(1.1);
    opacity: 0;
  }
}

/* Container & Header */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
  position: relative;
  z-index: 1;
}

.party-header {
  text-align: center;
  margin-bottom: 24px;
  padding: 16px 12px;
}

.party-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 6px;
}

.party-title {
  font-size: 2.3rem;
  font-weight: 700;
  background: linear-gradient(45deg, #e11d48, #d97706, #2563eb, #9333ea);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rainbowShift 8s ease infinite;
  letter-spacing: -0.5px;
}

@keyframes rainbowShift {
  0% { background-position: 0% 50% }
  50% { background-position: 100% 50% }
  100% { background-position: 0% 50% }
}

.party-subtitle {
  font-size: 1.1rem;
  font-weight: 600;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.top-bar-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* Playful Badges & Buttons */
.badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

.badge-btn:active {
  transform: scale(0.95);
}

.btn-admin {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

.btn-admin:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #16a34a;
  background: #dcfce7;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

/* Card Styles */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--card-shadow);
  border: 3px solid #ffffff;
  margin-bottom: 24px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Add Song Input Card */
.add-song-card {
  background: linear-gradient(135deg, #ffffff 0%, #fff7ed 100%);
  border: 3px solid #fbd38d;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.card-title {
  font-size: 1.35rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1e293b;
}

.input-group {
  display: flex;
  gap: 12px;
  position: relative;
  flex-direction: column;
}

@media (min-width: 640px) {
  .input-group {
    flex-direction: row;
  }
}

.fun-input {
  flex: 1;
  padding: 16px 20px;
  font-size: 1.05rem;
  font-family: inherit;
  font-weight: 600;
  border: 3px solid #fed7aa;
  border-radius: var(--border-radius-md);
  background: #ffffff;
  color: #1e293b;
  outline: none;
  transition: all 0.2s ease;
}

.fun-input:focus {
  border-color: #f97316;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.15);
}

.btn-bounce {
  padding: 14px 28px;
  font-size: 1.1rem;
  font-family: inherit;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #fb923c, #f43f5e);
  border: none;
  border-radius: var(--border-radius-md);
  box-shadow: 0 6px 0 #be123c, 0 10px 20px rgba(244, 63, 94, 0.3);
  cursor: pointer;
  transition: all 0.1s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.btn-bounce:hover {
  filter: brightness(1.05);
}

.btn-bounce:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #be123c, 0 4px 10px rgba(244, 63, 94, 0.2);
}

.btn-bounce:disabled {
  background: #cbd5e1;
  box-shadow: 0 4px 0 #94a3b8;
  cursor: not-allowed;
  transform: none;
}

.input-hint {
  font-size: 0.9rem;
  color: #ea580c;
  font-weight: 600;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Now Playing Hero */
.now-playing-card {
  background: linear-gradient(135deg, #eff6ff 0%, #fdf4ff 50%, #fff1f2 100%);
  border: 3px solid #bfdbfe;
  overflow: hidden;
}

.now-playing-badge {
  background: #3b82f6;
  color: white;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  animation: pulseBadge 2s infinite ease-in-out;
}

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

.now-playing-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  margin-top: 16px;
}

@media (min-width: 768px) {
  .now-playing-content {
    flex-direction: row;
    text-align: left;
    align-items: center;
  }
}

.album-art-wrapper {
  position: relative;
  width: 170px;
  height: 170px;
  flex-shrink: 0;
}

.album-art {
  width: 100%;
  height: 100%;
  border-radius: 20px;
  object-fit: cover;
  border: 4px solid #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 2;
}

.vinyl-record {
  position: absolute;
  top: 10px;
  right: -25px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, #333 15%, #111 16%, #222 50%, #111 80%, #000 100%);
  border: 3px solid #444;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.2), 0 5px 15px rgba(0,0,0,0.3);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s ease;
}

.vinyl-record.playing {
  animation: spinRecord 4s linear infinite;
  right: -40px;
}

@keyframes spinRecord {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.vinyl-center {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #f43f5e;
  border: 4px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.track-details {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.track-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
  line-height: 1.25;
  word-break: break-word;
}

.track-artist {
  font-size: 1.15rem;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 14px;
}

.track-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

@media (min-width: 768px) {
  .track-meta-row {
    justify-content: flex-start;
  }
}

.vote-chip {
  background: #fed7aa;
  color: #c2410c;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.duration-chip {
  background: #e2e8f0;
  color: #475569;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
}

/* Rainbow Equalizer */
.equalizer {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 28px;
}

.equalizer-bar {
  width: 6px;
  background: #cbd5e1;
  border-radius: 3px;
  height: 6px;
  transition: height 0.2s ease;
}

.equalizer.playing .equalizer-bar:nth-child(1) { background: #ff5e8e; animation: bounceBar 0.8s ease infinite alternate; }
.equalizer.playing .equalizer-bar:nth-child(2) { background: #fb923c; animation: bounceBar 0.9s 0.2s ease infinite alternate; }
.equalizer.playing .equalizer-bar:nth-child(3) { background: #facc15; animation: bounceBar 0.7s 0.1s ease infinite alternate; }
.equalizer.playing .equalizer-bar:nth-child(4) { background: #4ade80; animation: bounceBar 0.85s 0.3s ease infinite alternate; }
.equalizer.playing .equalizer-bar:nth-child(5) { background: #38bdf8; animation: bounceBar 0.75s 0.15s ease infinite alternate; }
.equalizer.playing .equalizer-bar:nth-child(6) { background: #c084fc; animation: bounceBar 0.95s 0.25s ease infinite alternate; }

@keyframes bounceBar {
  0% { height: 6px; }
  100% { height: 26px; }
}

/* Progress bar */
.progress-container {
  width: 100%;
  margin-top: 18px;
}

.progress-bar-bg {
  width: 100%;
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  cursor: pointer;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #ec4899);
  border-radius: 999px;
  transition: width 0.3s linear;
}

.progress-time-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  margin-top: 6px;
}

/* Previous Song Card */
.previous-song-card {
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: var(--border-radius-md);
  margin-bottom: 24px;
}

.previous-thumb {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid white;
}

.previous-info {
  flex: 1;
  min-width: 0;
}

.previous-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.previous-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Upcoming Playlist List */
.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.queue-item {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 2px solid #f1f5f9;
  border-radius: var(--border-radius-md);
  padding: 12px 16px;
  gap: 14px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.queue-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.08);
  border-color: #fbcfe8;
}

.queue-rank {
  font-size: 1.25rem;
  font-weight: 700;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #f1f5f9;
  color: #475569;
}

.queue-rank.rank-1 { background: #fef08a; color: #854d0e; font-size: 1.4rem; }
.queue-rank.rank-2 { background: #e2e8f0; color: #334155; }
.queue-rank.rank-3 { background: #fed7aa; color: #9a3412; }

.queue-thumb {
  width: 62px;
  height: 62px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #f8fafc;
}

.queue-details {
  flex: 1;
  min-width: 0;
}

.queue-song-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-song-artist {
  font-size: 0.88rem;
  color: #64748b;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Upvote Button */
.btn-upvote {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 700;
  color: #e11d48;
  background: #ffe4e6;
  border: 2px solid #fecdd3;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 0 #fda4af;
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-upvote:hover {
  background: #fecdd3;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #fda4af;
}

.btn-upvote:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #fda4af;
}

.btn-upvote.voted {
  background: #fef08a;
  color: #854d0e;
  border-color: #fde047;
  box-shadow: 0 3px 0 #eab308;
  cursor: default;
}

/* Downloading items banner */
.download-card {
  background: #fef3c7;
  border: 2px dashed #f59e0b;
  border-radius: var(--border-radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: pulseDownload 2s infinite ease-in-out;
}

@keyframes pulseDownload {
  0%, 100% { background: #fef3c7; }
  50% { background: #fef9c3; }
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #f59e0b;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Mascot Section */
.mascot-row {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 30px 0 10px 0;
  gap: 12px;
}

.dj-mascot {
  font-size: 3.5rem;
  cursor: pointer;
  user-select: none;
  animation: bobHead 1.6s ease-in-out infinite alternate;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dj-mascot:hover {
  transform: scale(1.2) rotate(10deg);
}

.dj-mascot:active {
  transform: scale(0.9) rotate(-15deg);
}

@keyframes bobHead {
  0% { transform: translateY(0) rotate(-4deg); }
  100% { transform: translateY(-10px) rotate(4deg); }
}

.mascot-bubble {
  background: #ffffff;
  padding: 8px 16px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #475569;
  border: 2px solid #e2e8f0;
  position: relative;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.mascot-bubble::after {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 6px 8px 6px 0;
  border-style: solid;
  border-color: transparent #ffffff transparent transparent;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 90vw;
}

.toast {
  pointer-events: auto;
  background: #ffffff;
  border-radius: 16px;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 6px solid #38bdf8;
  animation: slideInRight 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.success { border-left-color: #22c55e; }
.toast.error { border-left-color: #ef4444; }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Admin Styles */
.admin-card {
  background: #ffffff;
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--card-shadow);
  margin-bottom: 24px;
  border: 3px solid #e2e8f0;
}

.admin-deck {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: white;
  border-radius: var(--border-radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 20px 30px rgba(15, 23, 42, 0.3);
}

.dj-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.btn-dj {
  padding: 14px 24px;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-dj-primary {
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  color: white;
  box-shadow: 0 6px 0 #1d4ed8;
}

.btn-dj-secondary {
  background: #334155;
  color: white;
  box-shadow: 0 4px 0 #1e293b;
}

.btn-dj-danger {
  background: #ef4444;
  color: white;
  box-shadow: 0 4px 0 #b91c1c;
}

.btn-dj:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.5);
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 900px) {
  .admin-grid {
    grid-template-columns: 1.5fr 1fr;
  }
}

.badge-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
}
.badge-tag.ready { background: #dcfce7; color: #15803d; }
.badge-tag.playing { background: #dbeafe; color: #1d4ed8; }
.badge-tag.downloading { background: #fef3c7; color: #b45309; }

/* Responsive adjustments */
@media (max-width: 600px) {
  .party-title {
    font-size: 1.7rem;
  }
  .card {
    padding: 16px;
  }
  .album-art-wrapper {
    width: 130px;
    height: 130px;
  }
  .vinyl-record {
    display: none; /* Hide vinyl popout on small mobile to preserve layout */
  }
  .track-title {
    font-size: 1.3rem;
  }
  .btn-bounce {
    width: 100%;
  }
}
