/* ============================================================
   GeoVillages — Visor público (view.php)
   Página standalone: NO carga base.css, así que trae su propio
   mini-reset. La página del usuario vive dentro de #page y manda
   con su propio fondo; el cromo del visor es CLARO y discreto.
   ============================================================ */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  /* Gris muy suave alrededor de la página del usuario (no oscuro). */
  background: #f1f5f9;
  color: #0f172a;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 44px 16px 96px; /* el 16px lateral debe coincidir con PAD en view.php */
}
body.has-preview { padding-top: 110px; }

/* ---------- Marco de la página ---------- */
#page-wrap {
  max-width: 100%;
  border-radius: 12px;
  /* Sombra suave: la página "flota" sobre el fondo claro. */
  box-shadow:
    0 6px 22px rgba(15, 23, 42, .10),
    0 26px 60px rgba(15, 23, 42, .12),
    0 0 0 1px rgba(15, 23, 42, .06);
}
#page {
  transform-origin: top left; /* la escala responsive parte de arriba-izquierda */
  border-radius: 12px;        /* .gv-page ya recorta con overflow:hidden */
}

/* ---------- Banner de vista previa ---------- */
.gv-preview-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 13px 18px;
  background: linear-gradient(90deg, #fef3c7, #fce7f3);
  color: #7c2d12;
  border-bottom: 1px solid rgba(15, 23, 42, .08);
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 2px 14px rgba(15, 23, 42, .07);
}
.gv-preview-eye { font-size: 17px; }
.gv-preview-banner a {
  color: #6d28d9;
  background: rgba(255, 255, 255, .9);
  padding: 6px 15px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid rgba(15, 23, 42, .08);
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.gv-preview-banner a:hover {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, .18);
}

/* ---------- Footer del autor ---------- */
.gv-view-footer {
  margin-top: 26px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  color: #5b6478;
  font-size: 13.5px;
  font-weight: 500;
}
.gv-vf-author { color: #0e7490; font-weight: 600; }
.gv-vf-dot { color: #94a3b8; }

/* ---------- Badge "Hecho con GeoVillages" ---------- */
.gv-made-with {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .88);
  border: 1px solid #e2e8f0;
  color: #5b6478;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(15, 23, 42, .10);
  opacity: .9;
  transition: opacity .2s ease, transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.gv-made-with strong { color: #6d28d9; font-weight: 700; }
.gv-made-with:hover {
  opacity: 1;
  transform: translateY(-2px);
  border-color: rgba(124, 58, 237, .45);
  box-shadow: 0 10px 28px rgba(124, 58, 237, .22);
}

/* ---------- Reproductor de música flotante ---------- */
.gv-music {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 15px 7px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(15, 23, 42, .12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #5b6478;
  font-size: 12.5px;
  font-weight: 600;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.gv-music:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 58, 237, .40);
  box-shadow: 0 10px 26px rgba(124, 58, 237, .20);
}

/* Botón redondo con acento violeta */
.gv-music-btn {
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  box-shadow: 0 2px 8px rgba(124, 58, 237, .35);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.gv-music-btn:hover { filter: brightness(1.05); box-shadow: 0 4px 12px rgba(124, 58, 237, .45); }
.gv-music-btn:active { transform: scale(.94); }
.gv-music-btn:focus-visible { outline: 2px solid #7c3aed; outline-offset: 2px; }

/* Iconos play/pausa hechos con CSS (sin dependencias) */
.gv-music-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
/* Play: triángulo con bordes */
.gv-music-play {
  width: 0; height: 0;
  margin-left: 2px;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent #fff;
}
/* Pausa: dos barras (pseudo-elementos) */
.gv-music-pause { width: 10px; height: 12px; }
.gv-music-pause::before,
.gv-music-pause::after {
  content: "";
  position: absolute;
  top: 0;
  width: 3px;
  height: 12px;
  border-radius: 1px;
  background: #fff;
}
.gv-music-pause::before { left: 0; }
.gv-music-pause::after  { right: 0; }

/* Alternancia play/pausa según estado */
.gv-music .gv-music-pause { display: none; }
.gv-music.is-playing .gv-music-play  { display: none; }
.gv-music.is-playing .gv-music-pause { display: block; }

.gv-music-label { white-space: nowrap; }
.gv-music-note { color: #7c3aed; font-weight: 700; }

/* Ecualizador sutil: barras que "bailan" solo al reproducir */
.gv-music-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}
.gv-music-eq i {
  width: 3px;
  height: 4px;
  border-radius: 1px;
  background: linear-gradient(180deg, #ec4899, #7c3aed);
  opacity: .55;
}
.gv-music.is-playing .gv-music-eq i {
  animation: gv-eq 900ms ease-in-out infinite;
}
.gv-music.is-playing .gv-music-eq i:nth-child(1) { animation-delay: 0ms; }
.gv-music.is-playing .gv-music-eq i:nth-child(2) { animation-delay: 150ms; }
.gv-music.is-playing .gv-music-eq i:nth-child(3) { animation-delay: 300ms; }
.gv-music.is-playing .gv-music-eq i:nth-child(4) { animation-delay: 450ms; }

@keyframes gv-eq {
  0%, 100% { height: 4px;  opacity: .55; }
  50%      { height: 14px; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .gv-music.is-playing .gv-music-eq i { animation: none; height: 9px; opacity: .8; }
}

/* ---------- Pantallas pequeñas ---------- */
@media (max-width: 640px) {
  body { padding: 24px 16px 92px; }
  body.has-preview { padding-top: 118px; }
  .gv-preview-banner { font-size: 13px; padding: 11px 14px; }
  .gv-made-with { right: 12px; bottom: 12px; padding: 8px 13px; font-size: 11.5px; }
  .gv-music { left: 12px; bottom: 12px; }
}
