/* WondarCore — código propio, no generado. Se puede modificar libremente. */
/* Banner de /miperfil (avatar/username/bio editables) — migrado de Gonzalo/perfil.css, adaptado a
   los colores ya usados en el sitio oficial (#1a1a2e / #2563eb / #7c3aed, ver .perfil-avatar en
   perfil-publico.css). El resto de la página (composer "Nueva publicación" y grid "Mis
   publicaciones") reusa composer-publico.css / publicaciones-shared.css tal cual. */

.mp-banner {
  background: linear-gradient(135deg, #1a1a2e 0%, #2d1b69 60%, #1a1a2e 100%);
  border-radius: 20px;
  padding: 2rem 2.5rem 1.75rem;
  color: #fff;
}

.mp-banner-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.mp-settings-wrap {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  align-self: end;
  display: flex;
  gap: 0.5rem;
}

.mp-settings-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

.mp-settings-btn:hover { background: rgba(255, 255, 255, 0.28); }

.mp-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: #1a1a2e;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.mp-settings-btn:hover .mp-tooltip,
.mp-settings-btn:focus-visible .mp-tooltip { opacity: 1; }

.mp-avatar-wrap {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  align-self: center;
  position: relative;
}

.mp-avatar {
  width: 156px;
  height: 156px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-color: #2563eb;
  border: 4px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2.4rem;
  font-weight: 700;
}

.mp-avatar-edit {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #2563eb;
  border: 2px solid #fff;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.15s;
}

.mp-avatar-edit:hover { opacity: 0.85; }
.mp-avatar-edit:disabled { opacity: 0.6; cursor: not-allowed; }

.mp-avatar-wrap--uploading .mp-avatar { opacity: 0.5; }
.mp-avatar-wrap--uploading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 34px;
  height: 34px;
  border: 4px solid rgba(255, 255, 255, 0.5);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: mp-avatar-spin 0.8s linear infinite;
  pointer-events: none;
}
@keyframes mp-avatar-spin {
  to { transform: rotate(360deg); }
}

.mp-username-wrap {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  align-self: start;
}

.mp-username-display {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mp-username {
  font-size: 1.3rem;
  font-weight: 800;
  white-space: nowrap;
}

.mp-username-edit {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.mp-username-edit:hover { background: rgba(255, 255, 255, 0.28); }

.mp-username-form {
  display: none;
  align-items: center;
  gap: 6px;
}

.mp-username-form--open { display: inline-flex; }

.mp-username-at { font-weight: 700; font-size: 0.95rem; }

.mp-username-input {
  border: none;
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  font-size: 0.88rem;
  font-family: inherit;
  min-width: 130px;
}

.mp-username-input:focus { outline: 2px solid #2563eb; }

.mp-username-save {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
  flex-shrink: 0;
}
.mp-username-save:disabled { opacity: 0.6; cursor: default; }

.mp-username-error {
  display: block;
  font-size: 0.72rem;
  color: #fecaca;
  margin-top: 4px;
}

/* Redes sociales (Instagram/X/LinkedIn), entre el banner y la bio — ver mpRenderRedes en
   miperfil-publico.js. Se edita desde /perfil; acá es solo lectura, links a la URL real. */
.mp-redes {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.9rem auto 0;
}

.mp-red-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f4f5f7;
  color: #333;
  text-decoration: none;
  border-radius: 20px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.15s;
}

.mp-red-link:hover { background: #eaeaea; }

/* Bio, fuera del banner */
.mp-bio-wrap {
  margin: 1.5rem auto 0;
  max-width: 560px;
  text-align: center;
}

.mp-bio-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  margin-bottom: 0.6rem;
}

.mp-bio {
  font-size: 0.92rem;
  line-height: 1.6;
  color: #444;
  margin: 0;
  white-space: pre-wrap;
}

.mp-bio--empty { color: #999; font-style: italic; }

.mp-bio-edit-icon {
  flex: 0 0 auto;
  background: none;
  border: none;
  padding: 2px;
  margin-top: 0.15rem;
  line-height: 1;
  color: #999;
  cursor: pointer;
}

.mp-bio-edit-icon:hover { color: #2563eb; }

.mp-bio-input {
  display: none;
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid #ddd;
  padding: 0.75rem;
  font-family: inherit;
  font-size: 0.88rem;
  resize: vertical;
  min-height: 70px;
  margin-bottom: 0.7rem;
}

.mp-bio-input:focus { outline: none; border-color: #2563eb; }
.mp-bio-input--open { display: block; }

.mp-bio-actions { display: none; gap: 8px; justify-content: center; }
.mp-bio-actions--open { display: flex; }

/* "Cancelar" en esta página es gris/ghost (Gonzalo/perfil.css .pf-btn-ghost), no el violeta que usa
   .val-btn--secondary en el resto del sitio (valorar, opiniones) — override acotado a este contenedor
   para no tocar esas otras páginas, que comparten la misma clase con otro criterio de color. */
#miperfil-publico .val-btn--secondary { background: #f4f5f7; color: #333; }
#miperfil-publico .val-btn--secondary:hover { background: #eaeaea; opacity: 1; }

@media (max-width: 600px) {
  .mp-banner { padding: 1.5rem 1.25rem; }
  .mp-banner-row { grid-template-columns: 1fr; justify-items: center; }
  .mp-settings-wrap { grid-column: 1; grid-row: 3; justify-self: center; margin-top: 0.85rem; }
  .mp-avatar-wrap { grid-column: 1; grid-row: 1; }
  .mp-username-wrap { grid-column: 1; grid-row: 2; justify-self: center; margin-top: 0.85rem; text-align: center; }
}

/* ── Encabezado de "Mis publicaciones" + botón que abre el modal ── */
.mp-posts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.mp-posts-header .destino-card-title { margin: 0; }

/* ── MODAL "Nueva publicación", migrado de Gonzalo/perfil.css (.pf-modal*) — antes el composer vivía
   siempre visible e inline en la página; ahora se abre en un modal de 2 pasos (elegir tipo → form),
   mismos ids/campos que ya maneja composer-publico.js (no se tocó ese script). ── */
.pf-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 30, 0.5);
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 2000;
}

.pf-modal-overlay--open { display: flex; }

.pf-modal {
  position: relative;
  background: #fff;
  border-radius: 20px;
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.pf-modal:has(#mp-post-step-form.pf-post-step--active) {
  max-width: 720px;
}

.pf-modal-close {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #f4f5f7;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.pf-modal-close:hover { background: #eaeaea; }

.pf-modal-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #1a1a2e;
  margin: 0 2.5rem 0.4rem 0;
}

.pf-modal-sub {
  font-size: 0.86rem;
  color: #888;
  line-height: 1.5;
  margin: 0 0 1.25rem;
}

.pf-post-step { display: none; }
.pf-post-step--active { display: block; }

.pf-post-type-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pf-post-type-option {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: #f9f9fb;
  border: 1.5px solid transparent;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  cursor: pointer;
  min-height: 44px;
  width: 100%;
}

.pf-post-type-option:hover { border-color: #2563eb; }

.pf-post-type-option > span:last-child { display: flex; flex-direction: column; min-width: 0; }

.pf-post-type-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pf-post-type-icon--foto { background: #2563eb; }
.pf-post-type-icon--video { background: #e53e3e; }
.pf-post-type-icon--nota { background: #1a1a2e; }

.pf-post-type-name {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  color: #1a1a2e;
}

.pf-post-type-desc {
  display: block;
  font-size: 0.78rem;
  color: #888;
  margin-top: 2px;
  line-height: 1.4;
}

.pf-post-back {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #f4f5f7;
  border: none;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #444;
  cursor: pointer;
  min-height: 38px;
  margin-bottom: 0.9rem;
}

.pf-post-back:hover { background: #eaeaea; }

/* El form del composer queda dentro del modal — se le saca el fondo/padding de "card" que tiene en
   /perfil (composer-publico.css), acá el modal ya aporta esos dos. */
#mp-post-step-form .composer-form { display: block !important; }

/* ── "Guías" (banner de portada de la home) — sección de admin, migrada de Gonzalo/perfil.css.
   Reusa el mismo shell de modal (.pf-modal*) que "Nueva publicación", pero de un solo paso. ── */
.pf-guias-empty { color: #999; font-size: 0.9rem; }

.pf-modal--guide { max-width: 720px; }

/* Campos del form de guía — clase propia (no .composer-field/.composer-field--active) a propósito:
   esas dos las maneja composerShowFieldsFor() en composer-publico.js con un querySelectorAll
   GLOBAL sobre toda la página (no scopeado a su propio form), así que apenas ese script corre
   (auto-selecciona "Foto" al cargar) le sacaba la clase --active a todos los campos de este modal
   también, dejándolos en display:none — bug real, visto en captura de Agustin 2026-07-23. */
.guia-field {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.guia-field.pf-guide-row {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.pf-guide-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  color: #1a1a2e;
  min-height: 44px;
  cursor: pointer;
}

.pf-guide-checkbox-label input { width: 18px; height: 18px; flex-shrink: 0; }

.pf-guide-caducidad { flex: 1; min-width: 200px; }

.pf-guias-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 1.25rem;
}

.pf-guia-card {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  background: #f9f9fb;
  border-radius: 14px;
  padding: 0.9rem 1rem;
}

.pf-guia-thumb {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-color: #eee;
  flex-shrink: 0;
}

.pf-guia-info { flex: 1; min-width: 160px; }

.pf-guia-titulo { font-weight: 800; color: #1a1a2e; margin: 0 0 2px; }

.pf-guia-subtitulo {
  font-size: 0.82rem;
  color: #777;
  margin: 0 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pf-guia-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.pf-guia-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
}

.pf-guia-badge--on { background: #dcfce7; color: #16a34a; }
.pf-guia-badge--off { background: #eee; color: #888; }

.pf-guia-caducidad-text { font-size: 0.75rem; color: #999; }

.pf-guia-actions { display: flex; gap: 6px; flex-shrink: 0; }

.pf-guia-action-btn {
  width: 44px;
  height: 44px;
  min-height: 0;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #444;
}

.pf-guia-action-btn:hover { border-color: #2563eb; color: #2563eb; }
.pf-guia-action-btn--delete:hover { border-color: #e53e3e; color: #e53e3e; }

/* Tarjeta de guía en modo solo-lectura (perfil de otro usuario, /miperfil/{username}) — mismo
   .pf-guia-card, pero es un <a> a la página de detalle en vez de abrir el modal de edición. */
.pf-guia-card--link { text-decoration: none; color: inherit; transition: transform 0.15s; }
.pf-guia-card--link:hover { transform: translateY(-2px); }

