:root {
  --bg: #111218;
  --panel: #191b24;
  --text: #e7e9ee;
  --muted: #a6adbb;
  --accent: #ff4081;
  --accent-2: #6a5acd;
  --glass-bg: rgba(30, 30, 30, 0.8);
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow-light: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(255, 64, 129, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  /*background-image: url('/public/default.png');
 background-color: #121212;
  color: #e0e0e0;*/
    background: linear-gradient(-45deg, #000000, #0a0a0a, #111, #000);
  background-size: 400% 400%;
  animation: blackShift 16s ease infinite;
  color: #f5f5f5;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  padding: 60px 0 90px 0;
}
@keyframes blackShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 20px;
  z-index: 1000;
  box-shadow: var(--shadow-light);
  border-bottom: 1px solid var(--glass-border);
}

.branding {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.logo:hover {
  transform: scale(1.1);
}

.brand-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  text-shadow: 
    -1px -1px 0 black,
     1px -1px 0 black,
    -1px  1px 0 black,
     1px  1px 0 black;
}

.switch-btn {
  background: linear-gradient(45deg, var(--accent-2), var(--accent));
  color: white;
  border-radius: 20px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 64, 129, 0.3);
  transition: all 0.2s ease;
  margin-left: auto;
  text-decoration: none;   /* 🔑 remove underline */
}


.switch-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 16px rgba(255, 64, 129, 0.4);
}

.sidebar-toggle {
  background: var(--panel);
  border: 1px solid var(--glass-border);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 10px;
  transition: all 0.2s ease;
}

.sidebar-toggle:hover {
  background: var(--accent);
  color: white;
  transform: scale(1.05);
}

.sidebar {
  position: fixed;
  left: 0;
  top: 60px;
  bottom: 90px;
  width: 220px;
  background: rgba(25, 27, 36, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1rem;
  overflow-y: auto;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.4);
  z-index: 1200; /* ensure sidebar overlays listen together */
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}


.sidebar.open {
  transform: translateX(0);
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
}

.sidebar li {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar li:hover {
  background: rgba(255, 64, 129, 0.1);
  color: var(--accent);
}

.glass-header {
  text-align: center;
  padding: 2rem 1rem 1.5rem 1rem;
  /*background: var(--glass-bg);*/
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  margin: 1rem auto;
  max-width: 90%;
  box-shadow: var(--shadow-light);
}

.glass-header h1 {
  font-size: 2.5rem;
  margin: 0;
  letter-spacing: 1px;
  background: linear-gradient(45deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass-header .subtitle {
  font-size: 1rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.search-container {
  width: 90%;
  max-width: 600px;
  margin: 1.5rem auto;
  display: flex;
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  border-radius: 25px;
  padding: 0.5rem;
  box-shadow: var(--shadow-light);
  transition: all 0.3s ease;
}

.search-container:focus-within {
  box-shadow: var(--shadow-glow);
  transform: scale(1.02);
}

.search-container input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  outline: none;
}

.search-container input::placeholder {
  color: var(--muted);
}

.search-container button {
  background: var(--accent);
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 20px;
  cursor: pointer;
  color: white;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(255, 64, 129, 0.2);
}

.search-container button:hover {
  background: #ff2a4a;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 42, 74, 0.3);
}

.song-container {
  max-width: 600px;
  align-items: center;
  justify-content: center;
  display: flex;
  flex-direction: column;
  margin: 1rem auto;
  padding-bottom: 100px;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.card {
  display: flex;
  align-items: center;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  padding: 12px;
  border-radius: 10px;
  width: 100%;
  min-height: 70px;
}


.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-glow);
  border-color: var(--accent);
}

.card img {
  border-radius: 8px;
  width: 50px;
  height: 50px;
  object-fit: cover;
}

.card-body {
  flex: 1;
  min-width: 0; /* 🔑 allows text to shrink with ellipsis */
  padding-left: 12px;
  overflow: hidden;
}

.play-down {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;   /* 🔑 buttons never shrink */
  flex-wrap: nowrap; /* 🔑 keep all in same row */
}


.play-btn, .playlist-btn, .queue-btn, .add-fav, .download-btn {
  border-radius: 6px;
  width: 20px;
  height: 20px;
  background: var(--accent);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.play-btn:hover, .playlist-btn:hover, .queue-btn:hover, .add-fav:hover, .download-btn:hover {
  background: #ff2a4a;
  transform: scale(1.1);
}

.add-fav.favorited {
  background: #ff2a4a;
}

.download-btn {
  background: var(--accent);
}

.download-btn:hover {
  background: #ff2a4a;
}

.song-name {
  color: var(--text);
  font-size: 14px;
  height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artist-name {
  color: var(--muted);
  font-size: 11px;
  height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/*
#song-list {
  width: 90%;
  max-width: 600px;
  margin: 1rem auto;
  animation: fadeIn 0.5s ease-out;
}
*/
#song-list {
  width: 90%;
  max-width: 600px;
  margin: 1rem auto;
  animation: fadeIn 0.5s ease-out;
  display: flex;
  flex-direction: column;
  align-items: center; /* centers the button with cards */
  gap: 12px; /* adds a nice space between cards and the button */
}

#song-list h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.5rem 0 0.5rem;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.25rem;
}

.back-btn {
  position: fixed;
  top: 49%;
  left: 291px;
  transform: translateY(-50%);
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(255, 64, 129, 0.2);
  display: none;
}

.back-btn:hover {
  background: #ff2a4a;
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 42, 74, 0.3);
}

.home-content {
  width: 90%;
  max-width: 1000px;
  margin: 1rem auto;
}

.home-section {
  margin-bottom: 2rem;
}

.home-section h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.25rem;
}

.section-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 0.5rem;
}

#greeting {
  font-size: 2.5rem;
  margin: 0;
  letter-spacing: 1px;
  background: linear-gradient(45deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.load-more-btn {
  display: block;
  padding: 0.75rem 2rem;
  margin: 1rem auto;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(255, 64, 129, 0.2);
}

.load-more-btn:hover {
  background: #ff2a4a;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 42, 74, 0.3);
}

#player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 90px;
  background: rgba(25, 27, 36, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  border-top: 1px solid var(--glass-border);
}

.player-info {
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 30%;
}

.player-info img {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  margin-right: 1rem;
  transition: transform 0.3s ease;
  animation: rotate 20s linear infinite paused;
}

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

.playing #album-art {
  animation-play-state: running;
}

.player-info .song-details {
  flex: 1;
}

.player-info #now-playing {
  font-weight: 500;
}

.player-info #artist-name {
  font-size: 0.8rem;
  color: var(--muted);
}

.player-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex: 1;
  max-width: 30%;
}

.player-controls button {
  background: var(--accent);
  border: none;
  color: white;
  font-size: 1.2rem;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-controls button:hover:not(.disabled) {
  background: #ff2a4a;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(255, 42, 74, 0.3);
}

.player-controls button.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#fav-btn.favorited {
  background: #ff2a4a;
}

.player-progress {
  position: relative;
  flex: 1;
  max-width: 40%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  cursor: pointer;
  margin: 0 1rem;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 3px;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px var(--accent);
}

.progress-circle {
  position: absolute;
  top: -3px;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
  transition: left 0.1s ease;
  box-shadow: 0 0 8px var(--accent);
}

.time-display {
  font-size: 0.8rem;
  color: var(--muted);
  min-width: 100px;
  text-align: center;
}

#volume-slider {
  width: 80px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  height: 6px;
  cursor: pointer;
}

#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
}

#volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
}

.queue-holder {
  position: fixed;
  right: 1rem;
  bottom: 90px;
  width: 300px;
  max-width: 90vw;
  z-index: 999;
}

.queue-open-btn {
  background: var(--accent);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  border: none;
  cursor: pointer;
  color: white;
  font-weight: bold;
  font-size: 1.2rem;
  box-shadow: 0 4px 15px rgba(255, 64, 129, 0.3);
  transition: all 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1001;
}
.chat-open-btn {
  margin-left: 50px;
  background: var(--accent-2);
   display: none;
}


.queue-open-btn:hover {
  background: #ff2a4a;
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(255, 42, 74, 0.4);
}

.queue-container {
  display: none;
  flex-direction: column;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 15px;
  padding: 1rem;
  box-shadow: var(--shadow-light);
  max-height: 400px;
  overflow: hidden;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
}


.queue-container.open {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.queue-header-holder {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--glass-border);
}

.queue-header-holder h3 {
  margin: 0;
  font-size: 1.1rem;
}

.queue-list {
  max-height: 300px;
  overflow-y: auto;
  flex: 1;
}

.queue-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all 0.2s ease;
  animation: slideIn 0.3s ease-out;
}
@media (max-width: 768px) {
  .queue-btn {
    bottom: 1500rem; /* or more depending on how far up you want it */
  }
}
@media (max-width: 768px) {
  .queue-container {
    margin-top: 2vh; /* Push it up */
  }
}


.queue-item:hover {
  background: rgba(255, 64, 129, 0.1);
  border-radius: 8px;
}

.queue-item span {
  flex: 1;
  font-size: 0.85rem;
}

.queue-item button {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0 0.5rem;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.queue-item:hover button {
  opacity: 1;
}

.queue-item button:hover {
  color: var(--accent);
}

.queue-item .download-btn {
  background: var(--accent);
  padding: 6px;
  border-radius: 6px;
  opacity: 1;
}

.queue-item .download-btn:hover {
  background: #ff2a4a;
  transform: scale(1.1);
}

.queue-item .promote-btn,
.queue-item .remove-btn {
  background: var(--accent);
  padding: 6px;
  border-radius: 6px;
  opacity: 1;
  transition: all 0.2s ease;
}

.queue-item .promote-btn:hover {
  background: #00d084; /* greenish for up arrow hover */
  transform: scale(1.1);
}

.queue-item .remove-btn:hover {
  background: #ff2a4a; /* red for delete hover */
  transform: scale(1.1);
}


.auto-queue-hint {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  padding-top: 0.5rem;
  font-style: italic;
}

.empty-queue {
  padding: 10px 15px;
  background: var(--accent);
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.empty-queue:hover {
  background: #ff2a4a;
  transform: scale(1.05);
}

.queue-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.queue-buttons button {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-light, #fff);
  font-size: 14px;
  transition: color 0.2s ease;
}

.queue-buttons button:hover {
  color: #00d084;
}

.remove-btn:hover {
  color: #ff4d4d;
}

#library-view {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 15px;
  padding: 1rem;
  width: 90%;
  max-width: 600px;
  margin: 1rem auto;
  animation: fadeIn 0.5s ease-out;
}

#library-view h4 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--text);
}

#library-view h5 {
  margin: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--muted);
}

#library-view .playlist-item {
  padding: 0.75rem;
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#library-view .playlist-item:hover {
  background: rgba(255, 64, 129, 0.1);
  border-radius: 8px;
}

#library-view .playlist-item span {
  font-size: 0.85rem;
}

#library-view button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  margin: 0.5rem 0;
  cursor: pointer;
  border-radius: 10px;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

#library-view button:hover {
  background: #ff2a4a;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 42, 74, 0.3);
}

#library-view button:disabled {
  background: var(--muted);
  cursor: not-allowed;
  opacity: 0.6;
}

/* ---------- Modal & picker styling (for Add to Playlist / Song picker) ---------- */
.song-picker-modal .modal-content {
  background: var(--glass-bg, rgba(8, 8, 10, 0.95));
  padding: 18px;
  border-radius: 12px;
  width: 340px;
  max-height: 80vh;
  overflow-y: auto;
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.03);
}

.song-picker-modal .modal-content h4 { margin: 0 0 8px 0; font-size: 1.05rem; }

#playlist-picker-list, .song-picker-list {
  margin: 8px 0;
  max-height: 40vh;
  overflow-y: auto;
  padding-right: 6px;
}

.playlist-picker-item, .song-picker-item {
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  background: rgba(255,255,255,0.02);
  margin-bottom: 8px;
  transition: background .15s ease, transform .08s ease;
  font-size: 0.95rem;
  color: var(--text);
}

.playlist-picker-item:hover, .song-picker-item:hover {
  background: rgba(255,255,255,0.04);
  transform: translateY(-2px);
}

.modal-buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}

.modal-buttons button {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: white;
  font-weight: 600;
}

.modal-buttons button:nth-child(2) {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text);
}

/* small inline back button used in playlist view header */
.back-inline {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 4px 8px;
  border-radius: 8px;
}
.back-inline:hover { background: rgba(255,255,255,0.02); }


.playlist-song {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  margin-bottom: 10px;
  transition: background 0.3s ease;
}

.playlist-song:hover {
  background: rgba(255, 255, 255, 0.2);
}

.remove-fav, .remove-from-playlist {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  opacity: 0.7;
  cursor: pointer;
  transition: all 0.3s ease;
}

.remove-fav:hover, .remove-from-playlist:hover {
  opacity: 1;
  transform: scale(1.1);
}

.delete-playlist, .playlist-download-btn, .favorites-download-btn {
  padding: 10px 15px;
  background: var(--accent);
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: 10px;
}

.delete-playlist:hover, .playlist-download-btn:hover, .favorites-download-btn:hover {
  background: #ff2a4a;
  transform: scale(1.05);
}

.song-picker-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.listen-wrapper {
  position: fixed;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* Give the share-code box some bottom margin so Transfer Host isn't overlapped */
#session-code-display {
  margin-top: 12px;     /* small gap from Listen Together button */
  margin-bottom: 12px;  /* add space below it */
  z-index: 10;          /* keep it above background but below modal */
}


#category-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.category-btn {
  background: #1a1a1a;
  color: #ccc;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.category-btn:hover {
  background: #333;
  color: #fff;
}

.category-btn.active {
  background: #444;
  color: #fff;
}

.results-section.hidden {
  display: none;
}

/* Make sure Transfer Host is always on top of that area *//*
#transfer-host-btn {
  position: relative;
  z-index: 20;
}
#fun-fact {
  padding: 1rem;
  background-color: #222;
  border-radius: 10px;
  margin-bottom: 2rem;
  color: #eee;
}
#fun-fact h3 {
  margin-bottom: 1rem;
  font-weight: 700;
}
#fact-content p {
  margin: 0;
}
*/
#fun-fact h3 {
  margin-bottom: 1rem;
  font-weight: 700;
}
#transfer-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--glass-bg, rgba(0,0,0,0.85));
  border: 1px solid #555;
  border-radius: 12px;
  padding: 1rem;
  width: 280px;
  max-height: 60vh;
  overflow-y: auto;
  z-index: 4000;   /* higher than queue & listen-wrapper */
}
.hidden { display: none !important; }


.listen-btn {
  background: linear-gradient(45deg, var(--accent), var(--accent-2));
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-glow);
  animation: pulse 2s infinite;
  border: none;
  cursor: pointer;
}

.listen-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 64, 129, 0.4);
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 64, 129, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(255, 64, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 64, 129, 0); }
}

.listen-modal {
  position: fixed;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  z-index: 1001;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 15px;
  padding: 1.5rem;
  width: 200px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-glow);
  animation: slideInLeft 0.3s ease-out;
}

.listen-modal.hidden {
  display: none;
}

.modal-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.modal-content h2 {
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  text-align: center;
}

.modal-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.modal-btn:hover {
  background: #ff2a4a;
  transform: scale(1.05);
}

.host-btn {
  background: #28a745;
}

.host-btn:hover {
  background: #218838;
}

.join-btn {
  background: #007bff;
}

.join-btn:hover {
  background: #0056b3;
}

.cancel-btn{
  background: hsl(354, 70%, 54%);
}
leave-btn {
  display: none; /* Hidden unless in a session */
  background: #dc3545;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.leave-btn:hover {
  background: #c82333;
}

.cancel-btn:hover {
  background: #c82333;
}
.in-session .leave-btn {
  display: flex; /* Show when in-session class is applied */
}
.modal-input, .modal-participants {
  margin-top: 0.5rem;
  text-align: center;
}
.modal-options {
  display: flex;
  flex-direction: column; /* stack vertically */
  align-items: center;    /* center horizontally */
  gap: 12px;              /* space between buttons */
  margin-top: 1rem;
}


.modal-input input {
  padding: 0.5rem;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text);
  border-radius: 8px;
  width: 80%;
  margin: 0.5rem auto;
  font-size: 0.8rem;
}

.modal-input input::placeholder {
  color: var(--muted);
}

.modal-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.close {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1rem;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease;
}

.close:hover {
  color: var(--accent);
}

.session-code {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 0.5rem;
  text-align: center;
  position: fixed; /* Ensure it stays fixed */
  top: calc(50% + 60px); /* Position below listen-btn */
  left: 10px; /* Consistent with listen-wrapper */
  width: 200px;
  z-index: 1002; /* Higher than other elements */
  transform: translateY(-50%);
}

.session-code p {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}
.session-code.hidden {
  display: none !important;
}
.participants-container {
  position: fixed;
  top: 50%;
  left: 10px; /* Adjusted for edge screens */
  transform: translateY(-50%);
  width: 200px;
  max-height: 200px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 15px;
  padding: 1rem;
  box-shadow: var(--shadow-light);
  z-index: 1000;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform: translateX(-100%); /* Hidden by default */
  opacity: 0;
}

.participants-container.open {
  display: block; /* Ensure visible when open */
  transform: translateY(-50%) translateX(0);
  opacity: 1;
}

.participants-container.hidden {
  transform: translateY(-50%) translateX(-100%);
  opacity: 0;
}
#emoji-btn {
  font-size: 1.6rem;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease;
}
#emoji-btn:hover {
  transform: scale(1.2);
}

#participants-ul, #participants-modal-ul {
  max-height: 150px;
  overflow-y: auto;
  margin-bottom: 0.5rem;
}

#participants-ul li, #participants-modal-ul li {
  padding: 0.5rem;
  font-size: 0.85rem;
  color: var(--text);
  border-bottom: 1px solid var(--glass-border);
}

#chat-container {
  position: fixed;
  right: 1rem;
  bottom: 160px;        /* keep it above the player bar */
  width: 300px;
  max-height: 400px;
  background: rgba(0,0,0,0.85);
  border: 1px solid #555;
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  z-index: 2001;        /* higher than the queue’s 1000 */
}
.disabled-session {
  pointer-events: none;       /* actually blocks clicks */
  opacity: 0.5;               /* dim to show it's disabled */
  cursor: default;
}



#chat-container.open {
  display: flex;
}


#chat-container.hidden {
  display: none !important;
}
.hidden {
  display: none !important;
}

.toggle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--glass-border);
}

.toggle-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text);
}

#chat-messages {
  max-height: 250px;
  overflow-y: auto;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  border-radius: 8px;
  color: var(--text);
}

#chat-messages div {
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  animation: fadeIn 0.3s ease-out;
}
#chat-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid #333;
  background: #121212;
  box-sizing: border-box;
  width: 100%;
}

#chat-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #444;
  border-radius: 8px;
  background: #1e1e1e;
  color: #fff;
  font-size: 14px;
  outline: none;
  min-width: 0; /* prevents overflow that pushes send btn out */
}

.chat-media {
  max-width: 100%;
  border-radius: 8px;
  margin-top: 6px;
}

.media-message {
  margin-bottom: 10px;
}

#media-label {
  cursor: pointer;
  font-size: 1.2rem;
  margin-right: 8px;
}

.chat-media-link {
  color: #4da3ff;
  text-decoration: none;
}

#send-chat-btn {
  background: #28a745;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
} 

#send-chat-btn:hover {
  background: #34c759;
}

.toggle-btn {
  background: var(--accent);
  border: none;
  color: white;
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-btn i {
  transition: transform 0.3s ease;
}

.toggle-btn.open i {
  transform: rotate(180deg);
}

#chat-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 0.7rem;
}

.notification {
  position: fixed;
  top: 80px;
  right: 1rem;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 0.75rem 1.5rem;
  color: var(--text);
  font-size: 0.9rem;
  box-shadow: var(--shadow-light);
  animation: slideIn 0.3s ease-out, fadeOut 0.3s ease-out 4.7s;
}

.notification.success {
  border-color: #28a745;
  background: rgba(40, 167, 69, 0.1);
}

.notification.error {
  border-color: #dc3545;
  background: rgba(220, 53, 69, 0.1);
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateY(-50%) translateX(-20px); }
  to { opacity: 1; transform: translateY(-50%) translateX(0); }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(-10px); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media screen and (max-width: 768px) {
  body {
    padding-bottom: 120px;
  }

  .song-container, #song-list, #library-view {
    width: 95%;
    max-width: 400px;
  }

  .queue-container {
    width: 100%;
    max-width: none;
  }

  .queue-open-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  #player-bar {
    flex-direction: column;
    height: auto;
    padding: 1rem;
    gap: 0.5rem;
  }

  .player-info {
    max-width: none;
    justify-content: center;
  }

  .player-progress {
    max-width: none;
    margin: 0;
    order: -1;
    width: 100%;
  }

  .time-display {
    order: 1;
  }

  .player-controls {
    max-width: none;
    order: 2;
  }

  .search-container {
    width: 95%;
  }

  .glass-header h1 {
    font-size: 2rem;
  }

  .sidebar-toggle {
    padding: 0.5rem;
    margin-left: 5px;
  }

  .switch-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .play-down {
    gap: 8px;
  }

  .play-btn, .playlist-btn, .queue-btn, .add-fav, .download-btn {
    width: 18px;
    height: 18px;
    padding: 5px;
  }

  .playlist-download-btn, .favorites-download-btn {
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .load-more-btn {
    padding: 0.6rem 1.5rem;
    font-size: 0.8rem;
  }

  .back-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  .listen-modal {
    width: 95%;
    left: 2.5%;
  }

.participants-container {
    width: 95%;
    left: 2.5%;
  }

  .session-code {
    width: 95%;
    left: 2.5%;
  }

}

@media screen and (max-width: 500px) {
  .card {
    flex-direction: column;
    padding: 15px;
    height: auto;
    max-width: 300px;
    align-items: center;
    text-align: center;
  }

  .card img {
    width: 60px;
    height: 60px;
  }

  .card-body {
    padding: 10px 0 0;
    align-items: center;
  }

  .play-down {
    padding-top: 10px;
    justify-content: center;
    gap: 6px;
    flex-direction: row;
  }

.song-name, .artist-name {
  color: var(--text);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}
.song-name.marquee, .artist-name.marquee {
  animation: scroll-text 8s linear infinite;
}

@keyframes scroll-text {
  0%   { transform: translateX(0%); }
  100% { transform: translateX(-100%); }
}

  .play-btn, .playlist-btn, .queue-btn, .add-fav, .download-btn {
    width: 16px;
    height: 16px;
    padding: 4px;
  }

  .playlist-download-btn, .favorites-download-btn {
    padding: 6px 10px;
    font-size: 0.7rem;
    margin-left: 5px;
  }
.player-progress::-webkit-slider-thumb {
  appearance: none;
  width: 15px;
  height: 15px;
  background: #4caf50;
  border-radius: 50%;
}

  .load-more-btn {
    padding: 0.5rem 1.2rem;
    font-size: 0.7rem;
  }
  .listen-wrapper {
  margin-top: -10rem;
  margin-left: 15rem;
  size:3rem;
  /*width: 8rem;*/

}

  .cards {
  gap: -1rem;
  size: 15rem;
  /*width: 30rem;
  //height: 30rem;*/
}

  .back-btn {
    padding: 0.3rem 0.7rem;
    font-size: 0.7rem;
  }
  .chat-open-btn {
  margin-left: 10rem;
  margin-bottom:12rem;
}
 .chat-container {
  margin-bottom:20rem;
 }
  .queue-open-btn {
    margin-bottom: 9rem; /* add some space below (pushes it up if layout allows) */
    margin-left:12rem;
  }/*
  .queue-header-holder {
    margin-bottom: 10rem;;
  }*/
.queue-container {

 margin-bottom: 10rem;;
  }

.participants-container {
    width: 90%;
    left: 5%;
  }

  .session-code {
    width: 90%;
    left: 5%;
  }
  #player-bar {
    flex-direction: column;
    height: auto;
    padding: 1rem;
    gap: 0.5rem;

  }
.progress-circle {
  margin-top: auto;
}
}
/* --- Right Floating Ad (Normal Player) --- */
.right-ad-normal {
  position: fixed;
  right: 1.5rem;
  top: 380px;
  width: 270px;
  padding: 14px;
  background: rgba(25, 27, 36, 0.95);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  box-shadow: 0 0 25px rgba(0,0,0,0.4);
  z-index: 500; /* Queue will still stay on top (999) */
}

.right-ad-title {
  display: block;
  color: #ff79c6;
  font-size: 0.8rem;
  margin-bottom: 6px;
  text-align: center;
  letter-spacing: 1px;
}

.right-ad-box {
  border-radius: 14px;
  overflow: hidden;
}

/* If queue opens, push ad down */
.queue-container.open ~ .right-ad-normal {
  top: 520px;
}

/* Hide on mobile (Adsterra rules) */
@media (max-width: 992px) {
  .right-ad-normal {
    display: none !important;
  }
}
/* --- Right Floating Ad (Normal Player) --- */
.right-ad-normal {
  position: fixed;
  right: 1.5rem;
  top: 250px;
  width: 270px;
  padding: 14px;
  background: rgba(25, 27, 36, 0.95);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  box-shadow: 0 0 25px rgba(0,0,0,0.4);
  z-index: 1200; /* ABOVE listen-together and sidebar */
}
/* Push the ad DOWN when queue opens */
.queue-container.open + .right-ad-normal {
  top: 590px !important;
}
/* Make the ad stay BEHIND queue but below chat */
.right-ad-normal {
  z-index: 250 !important;
}

/* Queue must be above ad */
.queue-holder,
.queue-open-btn,
.queue-container {
  z-index: 999 !important;
}
