/* ==============================
   PROFILE: STATISTICS TAB
============================== */
.music-stats {
  background: #0f0f0f;
  border: 1px solid rgba(255,105,180,0.2);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 0 12px rgba(255,105,180,0.12);
}

.music-stats-bar {
  height: 10px;
  background: #222;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  margin-bottom: 14px;
}

.music-stats-bar .seg.listened {
  background: linear-gradient(90deg, #ff69b4, #ff00ff);
  box-shadow: 0 0 10px rgba(255,0,255,0.25);
}

.music-stats-bar .seg.plan {
  background: rgba(77,210,255,0.9);
  box-shadow: 0 0 10px rgba(77,210,255,0.2);
}

.music-stats-bar .seg {
  flex: var(--flex-val, 0);
  transition: flex 1s ease-in-out;
}


.music-stats-grid {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 12px;
}

.music-stat {
  flex: 1 1 0;
  max-width: 200px;
  min-width: 0;
  background: #111;
  border-radius: 10px;
  padding: 12px;
  border: 1px solid rgba(255,105,180,0.12);
}

.music-stat .label {
  color: #aaa;
  font-size: 0.85rem;
}

.music-stat .value {
  color: var(--color-accent);
  font-weight: 700;
  font-size: 1.3rem;
  margin-top: 4px;
  text-shadow: 0 0 8px rgba(255,0,255,0.25);
}

/* ---- Song page action buttons — shared base ---- */
.save-rating-btn,
.plan-btn,
.playlist-btn,
.delete-rating-btn {
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

/* Save Rating — solid pink (primary action) */
.save-rating-btn {
  background: var(--color-accent);
  color: #000;
  border: 1px solid var(--color-accent);
}
.save-rating-btn:hover:not(:disabled) {
  box-shadow: 0 0 12px rgba(255,105,180,0.7);
}

/* Plan to Listen — outlined pink */
.plan-btn {
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
}
.plan-btn:hover:not(.is-disabled) {
  background: var(--color-accent);
  color: #000;
  box-shadow: 0 0 12px rgba(255,105,180,0.7);
}
.plan-btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Add to Playlist — outlined purple */
.playlist-btn {
  background: transparent;
  color: #8b00ff;
  border: 1px solid #8b00ff;
}
.playlist-btn:hover {
  background: #8b00ff;
  color: #fff;
  box-shadow: 0 0 12px rgba(139,0,255,0.6);
}

/* Remove Rating — outlined red */
.delete-rating-btn {
  background: transparent;
  color: #ff4d4f;
  border: 1px solid #ff4d4f;
}
.delete-rating-btn:hover {
  background: #ff4d4f;
  color: #fff;
  box-shadow: 0 0 12px rgba(255,77,79,0.6);
}


/* ================= USER TAB ================= */

.user-profile-container {
  position: relative;
  display: flex;
  align-items: center;
}

/* Outer pill */
.user-profile {
  position: relative;
  border-radius: 999px;
  background: rgba(255, 105, 180, 0.08);
  overflow: hidden;
  transition: all 0.25s ease;
}

/* Link inside pill */
.user-profile-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

/* Glow + lift */
.user-profile:hover {
  box-shadow:
    0 0 10px rgba(255, 105, 180, 0.6),
    0 0 25px rgba(139, 0, 255, 0.4);
  transform: translateY(-1px) scale(1.04);
}

/* Light sweep effect */
.user-profile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255, 105, 180, 0.35),
    transparent
  );
  transform: translateX(-100%);
  transition: transform 0.4s ease;
  z-index: 0;
}

.user-profile:hover::before {
  transform: translateX(100%);
}

.user-profile-pic {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

.user-username {
  white-space: nowrap;
}

/* ================= DROPDOWN ================= */

.logout-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;

  background: #111;
  border-radius: 10px;
  padding: 6px 0;
  min-width: 150px;

  box-shadow: 0 12px 30px rgba(0,0,0,0.45);
  z-index: 500;

  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;

  transition: opacity 0.2s ease, transform 0.2s ease;
}

.user-profile-container:hover .logout-dropdown,
.logout-dropdown:hover {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.user-profile-container::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 0;
  width: 100%;
  height: 10px;
}

.logout-link {
  display: block;
  padding: 12px 18px;
  font-size: 0.95rem;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
}

.logout-link:hover {
  background: rgba(255, 105, 180, 0.1);
}

.top-section {
  display: flex !important;
  visibility: visible !important;
  height: auto !important;
  opacity: 1 !important;
}

/* ================= FIX USER DROPDOWN CLIPPING ================= */

/* Allow dropdowns to escape header containers */
.top-section,
.right-icons,
.icon-box,
.icon-box-container {
  overflow: visible !important;
}

.logout-dropdown {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
}

.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
}

.content-container {
  width: 100%;
}

.site-title {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.beta-badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  border-radius: 999px;

  color: #000;
  background: #ff4fd8;

  box-shadow:
    0 0 8px rgba(255, 79, 216, 0.8),
    0 0 16px rgba(255, 79, 216, 0.6);

  line-height: 1;
}

/* ✅ FORCE HEADER LAYOUT (FINAL OVERRIDE) */
.top-section {
  display: flex !important;
  align-items: center;
  justify-content: space-between !important;
}

/* ✅ FORCE RIGHT ICONS TO THE FAR RIGHT */
.right-icons {
  margin-left: auto !important;
}

/* ✅ FIX BETA BADGE TEXT VISIBILITY */
.beta-badge {
  color: #000 !important;
  background: #ff4fd8;

  -webkit-text-fill-color: #000 !important;
  background-clip: initial !important;
  -webkit-background-clip: initial !important;

  text-shadow: none !important;
}

body.theme-neon .beta-badge {
  color: #000 !important;
  background: #ff7be5;
  box-shadow: 0 0 10px rgba(255,123,229,0.9);
}

.profile-actions form.inline-action {
  display: inline-block;
  margin: 0;
}

/* ==============================
   TOPLISTS (Phase 1 read-only)
   Placed below the Statistics panel
============================== */

.profile-toplists {
  width: 100%;
}

.toplists-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 6px;
}

/* Each card (Most Loved / Most Hated) */
.toplist-card {
  background: #0f0f0f;
  border-radius: 12px;
  padding: 14px;
  flex: 1;
  border: 1px solid rgba(255,105,180,0.06);
  box-shadow: 0 0 10px rgba(255,105,180,0.04);
  min-width: 0;
}

/* Section label inside card (Songs / Artists / Albums) */
.section-label {
  color: var(--color-accent);
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

/* Lists */
.top-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Smaller variant (artists/albums) */
.top-list.small .top-thumb {
  width: 40px;
  height: 40px;
}

/* Individual item */
.top-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  border: 1px solid rgba(255,255,255,0.02);
  min-width: 0;
}

/* artwork */
.top-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

/* meta text */
.top-meta {
  flex: 1;
  min-width: 0;
}

.top-title {
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-sub {
  color: #bdbdbd;
  font-size: 0.85rem;
  margin-top: 3px;
}


/* muted fallback message */
.muted {
  color: #999;
  padding: 8px 0;
}

/* small adjustments for small thumbnails inside small lists */
.top-thumb.small {
  width: 40px;
  height: 40px;
  border-radius: 6px;
}

/* responsive: stack the cards vertically on narrow screens */
@media (max-width: 900px) {
  .toplists-row {
    flex-direction: column;
  }
  .top-thumb { width: 48px; height: 48px; }
  .score-pill { min-width: 56px; padding: 6px 10px; }
}

/* small screens: ensure spacing and card width */
@media (max-width: 600px) {
  .toplist-card { padding: 12px; }
  .top-item { padding: 8px; gap: 8px; }
}


/* End of profile statistics + toplists styles */

/* Strong thumbnail override for toplists (override global img rules) */
.toplist-card .top-thumb,
.toplist-card img.top-thumb,
.toplist-card img.top-thumb.small {
  width: 56px !important;      /* thumbnail width for songs */
  height: 56px !important;     /* thumbnail height for songs */
  min-width: 56px !important;
  max-width: 56px !important;
  max-height: 56px !important;
  object-fit: cover !important;
  display: block !important;
  border-radius: 8px !important;
  flex-shrink: 0 !important;
}

/* smaller variant */
.toplist-card .top-thumb.small,
.toplist-card img.top-thumb.small {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
  border-radius: 6px !important;
}

/* If some other rule sets img { width:100% }, avoid it inside toplists */
.toplist-card img { max-width: none !important; }