/* ================================================================
   WoozChat — Correções finais (v11)
   1. Menu "Trocar capa" como popover flutuante
   2. Stats dentro do hero-inner
   3. Player de música iTunes bonito no perfil
   4. Botão "Trocar foto" bem estilizado no editar-perfil
   5. Chat: mensagens grandes quebram linha e ficam responsivas
   6. Ticks de leitura afastados do texto
   7. Áudio do chat: fake waveform + barra sob o play
   ================================================================ */

/* ============ 1. COVER MENU (popover) ============ */
.cover-change-btn,
#coverChangeBtn.cover-change-btn {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  left: auto !important;
  z-index: 6;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  background: rgba(10, 14, 26, .72);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .18);
  transition: background .18s, transform .18s;
}
.cover-change-btn:hover { background: rgba(20,25,45,.9); transform: translateY(-1px); }

/* Popover ligado ao body via JS (posição via inline style) */
.wz-popover {
  position: fixed;
  min-width: 260px;
  background: linear-gradient(180deg, #131a2e, #0d1327);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 24px 60px -12px rgba(0,0,0,.75), 0 2px 0 rgba(255,255,255,.05) inset;
  z-index: 10000;
  animation: wzPopIn .18s ease-out;
}
@keyframes wzPopIn { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }
.wz-popover label {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13.5px;
  color: #e6ecff;
  font-weight: 500;
  transition: background .15s;
}
.wz-popover label:hover { background: rgba(99,102,241,.15); }
.wz-popover label small { display: block; opacity: .55; font-size: 11px; margin-top: 3px; font-weight: 400; }
.wz-popover label.is-locked { opacity: .5; cursor: not-allowed; }
.wz-popover label.is-locked:hover { background: transparent; }

/* ============ 2. STATS DENTRO DO HERO-INNER ============ */
.profile-hero-inner {
  position: relative;
  display: flex !important;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.profile-hero-inner .profile-info { flex: 1 1 180px; min-width: 0; }
.profile-hero-inner .profile-stats-inline {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.profile-hero-inner .profile-stats-inline .stat {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 8px 14px;
  min-width: 66px;
  text-align: center;
  text-decoration: none;
  transition: background .15s, border-color .15s, transform .15s;
}
.profile-hero-inner .profile-stats-inline .stat:hover { background: rgba(99,102,241,.14); border-color: rgba(99,102,241,.4); transform: translateY(-1px); }
.profile-hero-inner .profile-stats-inline .stat strong {
  display: block; font-size: 20px; line-height: 1; font-weight: 800; color: #fff;
}
.profile-hero-inner .profile-stats-inline .stat-fan strong { color: #ec4899; }
.profile-hero-inner .profile-stats-inline .stat-hate strong { color: #f87171; }
.profile-hero-inner .profile-stats-inline .stat span {
  display: block; font-size: 11px; color: #94a3b8; margin-top: 3px; letter-spacing: .3px;
}
/* Esconde os stats antigos (embaixo) — já foram movidos pra dentro do hero */
.profile-v3 > .profile-stats.profile-stats-v3 { display: none !important; }

/* Em mobile, empilha os stats abaixo do nome, mas ainda dentro do hero-inner */
@media (max-width: 540px) {
  .profile-hero-inner .profile-stats-inline {
    width: 100%;
    justify-content: flex-start;
  }
  .profile-hero-inner .profile-stats-inline .stat { padding: 7px 12px; min-width: 60px; }
  .profile-hero-inner .profile-stats-inline .stat strong { font-size: 17px; }
}

/* ============ 3. PLAYER DE MÚSICA (perfil + picker) ============ */
.profile-music.profile-music-itunes {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(99,102,241,.16), rgba(236,72,153,.1));
  border: 1px solid rgba(255,255,255,.08);
  margin: 12px 0;
  box-shadow: 0 8px 24px -12px rgba(99,102,241,.4);
}
.profile-music.profile-music-itunes .pm-art {
  width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.profile-music.profile-music-itunes .pm-info { flex: 1; min-width: 0; }
.profile-music.profile-music-itunes .pm-track {
  display: block; color: #fff; font-size: 14px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.profile-music.profile-music-itunes .pm-artist {
  display: block; color: #94a3b8; font-size: 12px; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.profile-music.profile-music-itunes .pm-audio,
.profile-music.profile-music-itunes audio { display: none; }

/* Botão play custom */
.pm-play-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  border: 0; color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 16px -4px rgba(236,72,153,.55);
  transition: transform .18s;
}
.pm-play-btn:hover { transform: scale(1.06); }
.pm-play-btn svg { width: 18px; height: 18px; }

/* Music selected (no picker) — mesma cara */
.music-selected {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(99,102,241,.16), rgba(236,72,153,.1));
  border: 1px solid rgba(255,255,255,.1);
  margin-top: 10px;
}
.music-selected[hidden] { display: none !important; }
.music-selected img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.music-selected .music-selected-info { flex: 1; min-width: 0; }
.music-selected .music-selected-info strong { display: block; color: #fff; font-size: 14px; font-weight: 700; }
.music-selected .music-selected-info span { display: block; color: #94a3b8; font-size: 12px; margin-top: 2px; }
.music-selected audio { display: none; }
.music-clear {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(239,68,68,.15); color: #fca5a5;
  border: 1px solid rgba(239,68,68,.3); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.music-clear:hover { background: rgba(239,68,68,.3); }

/* Esconder a aba "colar link" (removida a pedido) */
.music-tab[data-tab="link"],
.music-panel[data-panel="link"] { display: none !important; }
.music-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.music-tab {
  flex: 1; padding: 10px; border-radius: 10px;
  background: rgba(255,255,255,.04); color: #e2e8f0;
  border: 1px solid rgba(255,255,255,.08); cursor: pointer;
  font-weight: 600; font-size: 13px; transition: all .15s;
}
.music-tab.active {
  background: linear-gradient(135deg, #6366f1, #38bdf8);
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 14px -4px rgba(99,102,241,.6);
}

/* ============ 4. BOTÃO "TROCAR FOTO" NO EDITAR-PERFIL ============ */
.edit-profile-head {
  display: flex !important;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}
.edit-profile-head > img.profile-avatar {
  width: 88px; height: 88px; border-radius: 50%; object-fit: cover;
  border: 3px solid rgba(99,102,241,.4);
  flex-shrink: 0;
}
.edit-profile-title-box { flex: 1; min-width: 0; }
.edit-profile-title-box h1 { margin: 0 0 10px; font-size: 22px; }
.edit-profile-head .avatar-change-btn,
.edit-profile-head #avatarChangeBtn {
  position: relative !important;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 9px 16px !important;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #38bdf8) !important;
  color: #fff !important;
  font-size: 13px;
  font-weight: 700;
  border: 0 !important;
  cursor: pointer;
  box-shadow: 0 6px 18px -6px rgba(99,102,241,.55);
  transition: transform .18s, box-shadow .18s;
  top: auto !important; right: auto !important; left: auto !important;
}
.edit-profile-head .avatar-change-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -6px rgba(99,102,241,.7); }
.edit-profile-title-box .field-hint {
  display: block;
  margin-top: 12px;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
}

/* ============ 5. CHAT: mensagens grandes quebram, ticks afastados ============ */
.chat-bubble,
.chat-bubble p,
.chat-bubble .wz-msg-body,
.chat-bubble .msg-text {
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  white-space: pre-wrap;
}
.chat-bubble {
  max-width: min(72%, 560px) !important;
  padding-right: 46px !important;   /* espaço pros ticks */
  padding-bottom: 20px !important;  /* espaço pra hora */
  position: relative;
}
@media (max-width: 640px) {
  .chat-bubble { max-width: 82% !important; }
}
.chat-bubble .chat-msg-meta,
.chat-bubble .msg-time,
.chat-bubble .msg-ticks {
  position: absolute;
  bottom: 4px;
  right: 8px;
  font-size: 10.5px;
  color: rgba(255,255,255,.65);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}
.chat-bubble.theirs .chat-msg-meta,
.chat-bubble.theirs .msg-time { color: rgba(226,232,240,.55); }
.chat-messages { overflow-x: hidden; }

/* ============ 7. ÁUDIO DO CHAT: waveform fake sob o play ============ */
.chat-audio,
.chat-bubble .audio-wrap,
.wz-audio {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(99,102,241,.35), rgba(56,189,248,.25));
  min-width: 220px;
  max-width: 280px;
  position: relative;
}
.chat-audio audio, .wz-audio audio { display: none; }
.wz-audio-play {
  width: 34px; height: 34px; border-radius: 50%;
  background: #fff; color: #1e293b; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform .15s;
}
.wz-audio-play:hover { transform: scale(1.06); }
.wz-audio-play svg { width: 14px; height: 14px; }
.wz-audio-wave {
  flex: 1; height: 26px; display: flex; align-items: center; gap: 2px;
  overflow: hidden;
}
.wz-audio-wave span {
  flex: 1;
  background: rgba(255,255,255,.55);
  border-radius: 2px;
  min-height: 4px;
  transition: background .2s, transform .2s;
  transform-origin: center;
}
.wz-audio.playing .wz-audio-wave span {
  animation: wzWave 1s ease-in-out infinite;
  background: #fff;
}
.wz-audio.playing .wz-audio-wave span:nth-child(2n) { animation-delay: .1s; }
.wz-audio.playing .wz-audio-wave span:nth-child(3n) { animation-delay: .2s; }
.wz-audio.playing .wz-audio-wave span:nth-child(4n) { animation-delay: .3s; }
.wz-audio.playing .wz-audio-wave span:nth-child(5n) { animation-delay: .4s; }
@keyframes wzWave {
  0%, 100% { transform: scaleY(.4); }
  50%      { transform: scaleY(1); }
}
.wz-audio-time {
  font-size: 11.5px; color: #fff; font-variant-numeric: tabular-nums;
  flex-shrink: 0; opacity: .9;
}

/* ============ ADMIN DASHBOARD ============ */
.admin-dashboard { max-width: 1200px; margin: 0 auto; padding: 24px 16px; }
.admin-dashboard h1 {
  font-size: 26px; margin: 0 0 4px; letter-spacing: -.5px;
  color: #f8fafc;
}
.admin-dashboard .admin-subtitle { color: #94a3b8; font-size: 13.5px; margin-bottom: 22px; }
.admin-metric-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 28px;
}
.admin-metric {
  background: linear-gradient(180deg, rgba(30,41,59,.7), rgba(15,23,42,.55));
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  padding: 18px 20px;
  transition: border-color .2s, transform .2s;
}
.admin-metric:hover { border-color: rgba(99,102,241,.35); transform: translateY(-2px); }
.admin-metric .metric-label {
  color: #94a3b8; font-size: 12px; font-weight: 600;
  letter-spacing: .5px; text-transform: uppercase;
}
.admin-metric .metric-value {
  font-size: 30px; font-weight: 800; color: #f8fafc;
  margin-top: 6px; line-height: 1; letter-spacing: -1px;
}
.admin-metric .metric-hint { color: #64748b; font-size: 11.5px; margin-top: 8px; }
.admin-metric.accent-blue   .metric-value { color: #60a5fa; }
.admin-metric.accent-green  .metric-value { color: #4ade80; }
.admin-metric.accent-amber  .metric-value { color: #fbbf24; }
.admin-metric.accent-pink   .metric-value { color: #f472b6; }
.admin-metric.accent-red    .metric-value { color: #f87171; }

.admin-section {
  background: rgba(15,23,42,.5);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 20px;
}
.admin-section h2 {
  margin: 0 0 14px; font-size: 16px; color: #f1f5f9;
  font-weight: 700; letter-spacing: -.2px;
  display: flex; align-items: center; gap: 8px;
}
.admin-section h2 .count-pill {
  background: rgba(99,102,241,.2); color: #a5b4fc;
  padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
}

.admin-user-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 10px;
  background: rgba(2,6,20,.4);
  border: 1px solid rgba(255,255,255,.04);
  margin-bottom: 8px; flex-wrap: wrap;
}
.admin-user-row > img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.admin-user-row .user-main { flex: 1; min-width: 180px; }
.admin-user-row .user-main strong { color: #f1f5f9; font-size: 14px; }
.admin-user-row .user-main span { display: block; color: #94a3b8; font-size: 12px; margin-top: 2px; }
.admin-user-row .admin-tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; margin-right: 4px; margin-top: 4px;
  background: rgba(30,41,59,.7); color: #cbd5e1;
}
.admin-user-row .admin-tag.tag-admin  { background: rgba(99,102,241,.2); color: #a5b4fc; }
.admin-user-row .admin-tag.tag-banned { background: rgba(239,68,68,.25); color: #fca5a5; }
.admin-user-row .admin-tag.tag-premium{ background: rgba(251,191,36,.2); color: #fbbf24; }
.admin-user-row .admin-tag.tag-basic  { background: rgba(56,189,248,.2); color: #7dd3fc; }
.admin-user-row .admin-tag.tag-ip     { background: rgba(30,41,59,.7); color: #93c5fd; font-family: ui-monospace, monospace; }
.admin-user-row .admin-actions {
  display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto;
}
.admin-btn {
  padding: 7px 12px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.08); background: rgba(30,41,59,.7);
  color: #e2e8f0; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background .15s, transform .15s;
}
.admin-btn:hover { background: rgba(51,65,85,.9); transform: translateY(-1px); }
.admin-btn.btn-primary { background: linear-gradient(135deg, #6366f1, #38bdf8); border-color: transparent; color: #fff; }
.admin-btn.btn-basic   { background: linear-gradient(135deg, #0ea5e9, #38bdf8); border-color: transparent; color: #fff; }
.admin-btn.btn-premium { background: linear-gradient(135deg, #f59e0b, #ec4899); border-color: transparent; color: #fff; }
.admin-btn.btn-danger  { background: rgba(239,68,68,.85); border-color: transparent; color: #fff; }
.admin-btn.btn-success { background: rgba(34,197,94,.85); border-color: transparent; color: #fff; }
.admin-btn.btn-neutral { background: rgba(71,85,105,.7); color: #f1f5f9; }
.admin-btn:disabled { opacity: .5; cursor: not-allowed; }

.admin-search-form {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.admin-search-form input {
  flex: 1; padding: 10px 14px; border-radius: 10px;
  background: rgba(2,6,20,.5); border: 1px solid rgba(255,255,255,.08);
  color: #f1f5f9; font-size: 14px;
}
.admin-search-form button {
  padding: 10px 18px; border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #38bdf8); border: 0; color: #fff;
  font-weight: 700; cursor: pointer;
}

.admin-banned-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; background: rgba(20,10,10,.4);
  border: 1px solid rgba(239,68,68,.15); border-radius: 10px; margin-bottom: 8px;
}
.admin-banned-row code { color: #fca5a5; font-size: 13px; font-family: ui-monospace, monospace; }
.admin-banned-row .banned-meta { color: #94a3b8; font-size: 12px; }
.admin-banned-row .banned-date { color: #64748b; font-size: 11px; margin-left: auto; }

/* ============ PREMIUM PLANS (2 opções) ============ */
.premium-plans-2 {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin: 28px auto;
  max-width: 780px;
}
.premium-plan {
  padding: 26px 24px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(30,41,59,.7), rgba(15,23,42,.6));
  border: 1px solid rgba(255,255,255,.08);
  position: relative;
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.premium-plan:hover { transform: translateY(-4px); }
.premium-plan.plan-basic { border-color: rgba(56,189,248,.4); }
.premium-plan.plan-premium {
  border-color: rgba(251,191,36,.5);
  background: linear-gradient(180deg, rgba(60,40,20,.5), rgba(30,15,30,.6));
  box-shadow: 0 20px 60px -20px rgba(251,191,36,.35);
}
.premium-plan .plan-badge {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; margin-bottom: 12px;
}
.plan-basic .plan-badge   { background: rgba(56,189,248,.2); color: #7dd3fc; }
.plan-premium .plan-badge { background: linear-gradient(135deg, #fbbf24, #ec4899); color: #fff; }
.premium-plan h3 { margin: 0 0 8px; font-size: 22px; color: #f8fafc; font-weight: 800; }
.premium-plan .plan-price {
  font-size: 34px; font-weight: 800; color: #fff; letter-spacing: -1px;
  display: block; margin: 6px 0 2px;
}
.premium-plan .plan-price small { font-size: 16px; opacity: .7; margin-right: 2px; }
.premium-plan .plan-per { color: #94a3b8; font-size: 13px; }
.premium-plan .plan-features {
  list-style: none; padding: 0; margin: 18px 0;
  display: flex; flex-direction: column; gap: 10px;
}
.premium-plan .plan-features li {
  color: #e2e8f0; font-size: 13.5px; line-height: 1.4;
  display: flex; gap: 8px; align-items: flex-start;
}
.premium-plan .plan-features li::before {
  content: "✓"; color: #4ade80; font-weight: 800; flex-shrink: 0;
}
.plan-premium .plan-features li::before { color: #fbbf24; }
.premium-plan .btn-primary {
  width: 100%; padding: 12px; border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #38bdf8); color: #fff;
  border: 0; font-weight: 700; text-decoration: none; text-align: center;
  display: block; transition: transform .15s, box-shadow .15s;
}
.plan-premium .btn-primary {
  background: linear-gradient(135deg, #fbbf24, #ec4899);
  box-shadow: 0 10px 30px -10px rgba(236,72,153,.6);
}
.premium-plan .btn-primary:hover { transform: translateY(-2px); }

/* ============ [FIX 24] Plan features: li was flex, splitting <b> tags into separate flex items ============ */
.premium-plan .plan-features li {
  display: block !important;
  position: relative;
  padding-left: 22px;
  gap: 0;
}
.premium-plan .plan-features li::before {
  position: absolute;
  left: 0;
  top: 0;
  line-height: 1.4;
}
.premium-plan .plan-features li b,
.premium-plan .plan-features li strong { color: #fff; font-weight: 700; }

/* ============ [FIX 24] Chat: force min-width:0 up the flex chain so long strings wrap ============ */
.wz-msg-row,
.wz-msg-row > *,
.chat-bubble,
.chat-bubble > *,
.wz-msg-body,
.wz-msg-body > * {
  min-width: 0 !important;
}
.wz-msg-body { max-width: 100%; }
.chat-bubble .wz-msg-body,
.chat-bubble p,
.chat-bubble .msg-text {
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  white-space: pre-wrap;
  max-width: 100%;
}
