/* ==========================
   VOIDHALL – PROFILE PAGE
   Depende de base.css + components.css
   ========================== */

body.vh-page-profile {
  /* body base já tem o background */
}

.vh-profile-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 88px 20px 120px;
}

@media (min-width: 640px) {
  .vh-profile-shell { padding: 96px 32px 140px; }
}

/* --------------------------
   HEADER / HERO
   -------------------------- */

.vh-profile-hero {
  border-radius: 22px;
  border: 1px solid var(--border-soft);
  background:
    radial-gradient(circle at 0 0, rgba(255,255,255,0.06), transparent 60%),
    radial-gradient(circle at 110% 0, var(--vh-metal-1), transparent 65%),
    #050506;
  padding: 18px;
}

@media (min-width: 900px) {
  .vh-profile-hero { padding: 22px; }
}

.vh-profile-hero-inner {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

@media (min-width: 900px) {
  .vh-profile-hero-inner {
    grid-template-columns: 112px minmax(0, 1fr) auto;
    gap: 18px;
  }
}

.vh-profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  border: 1px solid var(--border-strong);
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.12), transparent 55%),
    rgba(255,255,255,0.04);
  box-shadow: 0 18px 40px rgba(0,0,0,0.55);
}

@media (min-width: 900px) {
  .vh-profile-avatar { width: 112px; height: 112px; }
}

.vh-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vh-profile-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vh-profile-username {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vh-profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.vh-profile-bio {
  margin-top: 8px;
  color: rgba(255,255,255,0.78);
  font-size: 0.88rem;
  line-height: 1.45;
  max-width: 52rem;
}

.vh-profile-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}

@media (min-width: 900px) {
  .vh-profile-actions { justify-content: flex-end; }
}

.vh-profile-stats {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 900px) {
  .vh-profile-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.vh-profile-stat {
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.035);
  padding: 12px 12px;
}

.vh-profile-stat-label {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}

.vh-profile-stat-value {
  margin-top: 6px;
  font-size: 1.1rem;
  font-weight: 600;
}

/* --------------------------
   CONTENT GRID
   -------------------------- */

.vh-profile-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

@media (min-width: 900px) {
  .vh-profile-grid {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    gap: 18px;
  }
}

.vh-profile-card {
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  background:
    radial-gradient(circle at 0 0, rgba(255,255,255,0.04), transparent 60%),
    #050506;
  padding: 16px;
}

.vh-profile-card-title {
  font-size: 0.78rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-bottom: 12px;
}

.vh-profile-tracklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* reaproveita a vibe dos teus cards (feed) */
.vh-profile-track {
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  background:
    radial-gradient(circle at 0 0, rgba(255,255,255,0.045), transparent 60%),
    #050506;
  overflow: hidden;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
}

.vh-profile-track-cover {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
}

.vh-profile-track-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vh-profile-track-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vh-profile-track-title {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vh-profile-track-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vh-profile-track-cta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.vh-profile-empty {
  color: var(--text-muted);
  font-size: 0.86rem;
}


/* ==========================
   MODAL – EDITAR PERFIL
   ========================== */

.vh-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.vh-modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 20%, rgba(255,255,255,0.06), transparent 60%),
    rgba(0,0,0,0.72);
  backdrop-filter: blur(6px);
}

.vh-modal-panel {
  position: relative;
  width: min(520px, calc(100% - 32px));
  margin-top: 90px;
  border-radius: 22px;
  border: 1px solid var(--border-soft);
  background:
    radial-gradient(circle at 0 0, rgba(255,255,255,0.05), transparent 60%),
    #050506;
  box-shadow: 0 30px 90px rgba(0,0,0,0.75);
  overflow: hidden;
}

/* ---------- HEADER ---------- */

.vh-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-soft);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), transparent);
}

.vh-modal-title {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.vh-modal-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 1.2rem;
  cursor: pointer;
}

.vh-modal-close:hover {
  color: rgba(255,255,255,0.9);
}

/* ---------- BODY ---------- */

.vh-modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Avatar upload card */
.vh-avatar-field {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.035);
}

.vh-avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,0.06);
}

.vh-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vh-avatar-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vh-avatar-action {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.65);
}

.vh-avatar-action label {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
  cursor: pointer;
}

.vh-avatar-action label:hover {
  text-decoration: underline;
}

.vh-avatar-action input {
  display: none;
}

/* ---------- Fields ---------- */

.vh-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vh-field-label {
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}

.vh-field textarea {
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.9);
  padding: 12px 14px;
  font-size: 0.88rem;
  line-height: 1.45;
  resize: vertical;
  min-height: 110px;
}

.vh-field textarea:focus {
  outline: none;
  border-color: rgba(255,255,255,0.35);
}

/* Counter */
.vh-field-counter {
  align-self: flex-end;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.5);
}

/* ---------- FOOTER ---------- */

/* ==========================
   MODAL BUTTONS – REFINO
   ========================== */

.vh-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--border-soft);
  background: linear-gradient(
    0deg,
    rgba(255,255,255,0.035),
    transparent
  );
}

/* Base comum */
.vh-modal-actions .vh-btn {
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

/* Cancelar (ghost refinado) */
.vh-modal-actions .vh-btn-ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.14em;
}

.vh-modal-actions .vh-btn:not(.vh-btn-ghost):hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.22);
}

.vh-modal-actions .vh-btn-ghost:hover {
  background: rgba(255,255,255,0.035);
  border-color: rgba(255,255,255,0.25);
}

.vh-modal-actions .vh-btn-ghost:active {
  transform: translateY(1px);
}

/* Guardar (primário) */
.vh-modal-actions .vh-btn:not(.vh-btn-ghost) {
  background: rgba(5,5,6,0.95);
  border: 1px solid var(--border-strong);
  color: rgba(244,244,245,0.9);
}

  box-shadow:
    0 0 0 rgba(255,255,255,0),
    inset 0 1px 0 rgba(255,255,255,0.25);
}

.vh-modal-actions .vh-btn:not(.vh-btn-ghost):hover {
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.28), transparent 55%),
    rgba(255,255,255,0.10);
}

.vh-modal-actions .vh-btn:not(.vh-btn-ghost):active {
  transform: translateY(1px);
  box-shadow:
    0 0 10px rgba(255,255,255,0.12),
    inset 0 1px 0 rgba(255,255,255,0.2);
}

/* Disabled (opcional) */
.vh-modal-actions .vh-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}


/* ==========================
   LIGHT MODE OVERRIDES (profile)
   ========================== */

html[data-theme="light"] .vh-profile-hero,
html[data-theme="light"] .vh-profile-card,
html[data-theme="light"] .vh-profile-track {
  background:
    radial-gradient(circle at 0 0, rgba(0,0,0,0.05), transparent 60%),
    rgba(255,255,255,0.78);
}

html[data-theme="light"] .vh-profile-avatar {
  background:
    radial-gradient(circle at 30% 20%, rgba(0,0,0,0.06), transparent 55%),
    rgba(255,255,255,0.86);
  box-shadow: 0 18px 40px rgba(0,0,0,0.12);
}

html[data-theme="light"] .vh-profile-bio {
  color: rgba(0,0,0,0.72);
}

html[data-theme="light"] .vh-profile-stat {
  background: rgba(0,0,0,0.04);
}

html[data-theme="light"] .vh-profile-stat-label,
html[data-theme="light"] .vh-profile-card-title {
  color: rgba(0,0,0,0.55);
}

html[data-theme="light"] .vh-profile-track-cover {
  background: rgba(0,0,0,0.06);
}


.vh-avatar-preview.is-updated {
  animation: vh-avatar-flash 160ms ease-out;
}

@keyframes vh-avatar-flash {
  from {
    box-shadow: 0 0 0 rgba(255,255,255,0);
  }
  to {
    box-shadow: 0 0 14px rgba(255,255,255,0.25);
  }
}

.vh-avatar-preview::after {
  content: '✓';
  position: absolute;
  bottom: 6px;
  right: 6px;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.85);
  color: #000;
  opacity: 0;
  transition: opacity 120ms ease;
}

.vh-avatar-preview.is-updated::after {
  opacity: 1;
}
