/* ==========================================================
   VersaForge - Google Business Profile Optimization
   ----------------------------------------------------------
   Loaded ONLY by google-business-profile-optimization.php.

   This page's content is entirely about one concrete product -
   the Google Business Profile card itself - so the visuals show
   *that specific interface* being assembled and improved, not
   generic SEO charts. Reuses the shared .vx- shell/frame/stats
   from seo-visuals.css (loaded alongside this file) and adds
   three new page-specific components:

     1. .vx-builder - a live profile builder: fields populate
        one at a time (name, category, hours, photos, posts),
        each ticking a completeness meter upward.
     2. .vx-rep     - a reputation meter: star rating climbs
        and a review counter ticks up as feedback arrives.
     3. .vx-rank    - a before/after local-pack card: the same
        business card slides from an unranked position to #1
        as a "before optimisation / after optimisation" swap.

   PERFORMANCE: every looping animation moves only transform,
   opacity, or stroke-dashoffset (composited layer) - no layout
   thrash. Respects prefers-reduced-motion throughout.
   ========================================================== */

.gbp {
  --gbp-violet: #6A58E4;
  --gbp-blue:   #4A86F5;
  --gbp-green:  #10B981;
  --gbp-amber:  #F59E0B;
  --gbp-ink:    #111827;
  --gbp-slate:  #475569;
  --gbp-mute:   #5B6475;
  --gbp-line:   #E6ECF5;
  --gbp-tint:   #F8FAFF;
  --gbp-mono:   'Inter', ui-monospace, monospace;
}

/* ==========================================================
   1. PROFILE ASSEMBLY - the actual GBP card building itself
      piece by piece: logo, name, stars, photo strip, post chip.
      No bars - this is the real card coming together.
   ========================================================== */
.vx-assemble {
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .7rem;
}

.vx-asm-card {
  padding: 1rem 1.05rem;
  border-radius: 1rem;
  border: 1px solid var(--gbp-line);
  background: linear-gradient(160deg, #fff, #F8FAFF);
  box-shadow: 0 14px 34px -18px rgba(106, 88, 228, .28);
}

.vx-asm-top { display: flex; align-items: center; gap: .65rem; }

.vx-asm-logo {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: .65rem;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--gbp-line);
  opacity: 0;
  transform: scale(.5);
  animation: vx-asm-pop 7s cubic-bezier(.3, 1.4, .5, 1) infinite;
}

@keyframes vx-asm-pop {
  0%, 4%   { opacity: 0; transform: scale(.5); }
  10%, 96% { opacity: 1; transform: scale(1); }
  100%     { opacity: 0; transform: scale(.5); }
}

.vx-asm-name-wrap { flex: 1 1 auto; min-width: 0; }

.vx-asm-name {
  position: relative;
  
  overflow: hidden;
}

.vx-asm-name-text {
  font: 800 14px/1.7 'Inter', sans-serif;
  color: var(--gbp-ink);
  white-space: nowrap;
  clip-path: inset(0 100% 0 0);
  animation: vx-asm-type 7s steps(18) infinite;
}

@keyframes vx-asm-type {
  0%, 12%  { clip-path: inset(0 100% 0 0); }
  32%, 96% { clip-path: inset(0 0% 0 0); }
  100%     { clip-path: inset(0 100% 0 0); }
}

.vx-asm-stars {
  margin-top: .3rem;
  display: inline-flex;
  gap: 1px;
  color: var(--gbp-amber);
  font-size: 11px;
}

.vx-asm-stars span {
  display: inline-block;
  opacity: 0;
  transform: scale(0) rotate(-25deg);
  animation: vx-asm-star 7s cubic-bezier(.3, 1.6, .5, 1) infinite;
}

.vx-asm-stars span:nth-child(1) { animation-delay: .0s;  }
.vx-asm-stars span:nth-child(2) { animation-delay: .12s; }
.vx-asm-stars span:nth-child(3) { animation-delay: .24s; }
.vx-asm-stars span:nth-child(4) { animation-delay: .36s; }
.vx-asm-stars span:nth-child(5) { animation-delay: .48s; }

@keyframes vx-asm-star {
  0%, 34%  { opacity: 0; transform: scale(0) rotate(-25deg); }
  46%, 96% { opacity: 1; transform: scale(1) rotate(0deg); }
  100%     { opacity: 0; transform: scale(0) rotate(-25deg); }
}

.vx-asm-verify {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .22rem .5rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, .12);
  color: #059669;
  font: 800 10px/1.5 var(--gbp-mono);
  letter-spacing: .05em;
  opacity: 0;
  transform: translate3d(6px, 0, 0);
  animation: vx-asm-badge 7s cubic-bezier(.3, 1.4, .5, 1) infinite;
}

@keyframes vx-asm-badge {
  0%, 58%   { opacity: 0; transform: translate3d(6px, 0, 0); }
  68%, 96%  { opacity: 1; transform: translate3d(0, 0, 0); }
  100%      { opacity: 0; transform: translate3d(6px, 0, 0); }
}

.vx-asm-photos {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: .35rem;
  margin-top: .8rem;
}

.vx-asm-photo {
  aspect-ratio: 1;
  border-radius: .5rem;
  background: linear-gradient(135deg, var(--gbp-violet), var(--gbp-blue));
  opacity: 0;
  transform: scale(.6);
  animation: vx-asm-photo 7s cubic-bezier(.3, 1.5, .5, 1) infinite;
}

.vx-asm-photo:nth-child(1) { animation-delay: .55s; background: linear-gradient(135deg, #6A58E4, #4A86F5); }
.vx-asm-photo:nth-child(2) { animation-delay: .68s; background: linear-gradient(135deg, #4A86F5, #28A8D9); }
.vx-asm-photo:nth-child(3) { animation-delay: .81s; background: linear-gradient(135deg, #28A8D9, #10B981); }
.vx-asm-photo:nth-child(4) { animation-delay: .94s; background: linear-gradient(135deg, #10B981, #6A58E4); }

@keyframes vx-asm-photo {
  0%, 100%   { opacity: 0; transform: scale(.6); }
  8%, 92%    { opacity: 1; transform: scale(1); }
}

.vx-asm-post {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .8rem;
  padding: .55rem .65rem;
  border-radius: .7rem;
  background: #fff;
  border: 1px dashed var(--gbp-line);
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  animation: vx-asm-postin 7s cubic-bezier(.3, 1.3, .5, 1) infinite;
}

@keyframes vx-asm-postin {
  0%, 72%  { opacity: 0; transform: translate3d(0, 8px, 0); }
  82%, 96% { opacity: 1; transform: translate3d(0, 0, 0); }
  100%     { opacity: 0; transform: translate3d(0, 8px, 0); }
}

.vx-asm-post-ico {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--gbp-violet), var(--gbp-blue));
  color: #fff;
}

.vx-asm-post-t { font: 700 10.5px/1.3 'Inter', sans-serif; color: var(--gbp-slate); }
.vx-asm-post-t b { color: var(--gbp-ink); }

.vx-asm-caption {
  text-align: center;
  font: 700 10px/1.4 var(--gbp-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gbp-mute);
}

.vx-asm-caption b { color: var(--gbp-violet); }

/* ==========================================================
   1b. COMPLETENESS DIAL - circular progress ring with
       orbiting proof points, replacing a plain bar list.
   ========================================================== */
.vx-dial-scene {
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}

.vx-dial-wrap {
  position: relative;
  width: min(100%, clamp(150px, 30vw, 190px));
  aspect-ratio: 1;
}

.vx-dial-wrap svg { width: 100%; height: 100%; }

.vx-dial-track { fill: none; stroke: #ECEFF7; stroke-width: 8; }

.vx-dial-arc {
  fill: none;
  stroke: url(#gbpDialGrad);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 289;
  stroke-dashoffset: 289;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  animation: vx-dialsweep 6s cubic-bezier(.3, .8, .2, 1) infinite;
}

@keyframes vx-dialsweep {
  0%       { stroke-dashoffset: 289; }
  45%, 85% { stroke-dashoffset: 12; }
  100%     { stroke-dashoffset: 289; }
}

.vx-dial-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.vx-dial-num {
  font: 800 clamp(24px, 5vw, 32px)/1 'Inter', sans-serif;
  color: var(--gbp-ink);
}

.vx-dial-lbl {
  margin-top: .25rem;
  font: 700 10px/1.3 var(--gbp-mono);
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--gbp-mute);
}

/* orbiting proof chips around the ring */
.vx-dial-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .28rem .55rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--gbp-line);
  box-shadow: 0 8px 18px -8px rgba(17, 24, 39, .28);
  font: 800 10px/1.4 var(--gbp-mono);
  color: var(--gbp-slate);
  white-space: nowrap;
  opacity: 0;
  animation: vx-dialchip 6s cubic-bezier(.3, 1.3, .5, 1) infinite;
}

.vx-dial-chip.d1 { top: 2%;    left: -12%; animation-delay: .3s;  }
.vx-dial-chip.d2 { top: 30%;   right: -18%; animation-delay: 1.1s; }
.vx-dial-chip.d3 { bottom: 6%; left: -8%;  animation-delay: 1.9s; }

@keyframes vx-dialchip {
  0%, 6%   { opacity: 0; transform: translate3d(0, 6px, 0); }
  16%, 84% { opacity: 1; transform: translate3d(0, 0, 0); }
  94%,100% { opacity: 0; transform: translate3d(0, -6px, 0); }
}

.vx-dial-foot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .5rem;
  width: 100%;
  margin-top: .3rem;
}

/* ==========================================================
   2. REPUTATION METER - star rating + review count climbing
   ========================================================== */
.vx-rep {
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .3rem;
}

.vx-rep-stars {
  position: relative;
  display: inline-flex;
  gap: .2rem;
  font-size: clamp(20px, 3.4vw, 26px);
  line-height: 1;
  color: #E4E7EE;
}

.vx-rep-stars .fg {
  position: absolute;
  inset: 0;
  display: inline-flex;
  gap: .2rem;
  color: var(--gbp-amber);
  overflow: hidden;
  width: 0%;
  animation: vx-repfill 4.5s cubic-bezier(.3, .8, .2, 1) infinite;
}

@keyframes vx-repfill {
  0%       { width: 0%; }
  16%      { width: 12%; }
  45%, 85% { width: 96%; }
  100%     { width: 96%; opacity: 0; }
}

.vx-rep-num {
  font: 800 clamp(26px, 4.6vw, 34px)/1 'Inter', sans-serif;
  color: var(--gbp-ink);
  margin-top: .4rem;
}

.vx-rep-count {
  font: 700 10.5px/1.4 var(--gbp-mono);
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--gbp-mute);
}

.vx-rep-count b { color: var(--gbp-violet); font-size: 12px; }

/* floating review chips drifting up behind the meter */
.vx-rep-chip {
  position: absolute;
  padding: .3rem .55rem;
  border-radius: .6rem;
  background: #fff;
  border: 1px solid var(--gbp-line);
  box-shadow: 0 8px 18px -8px rgba(17, 24, 39, .25);
  font: 700 10px/1.3 'Inter', sans-serif;
  color: var(--gbp-slate);
  opacity: 0;
  animation: vx-repchip 4.5s ease-in-out infinite;
  white-space: nowrap;
}

.vx-rep-chip.c1 { top: 6%;  left: 2%;  animation-delay: .3s;  }
.vx-rep-chip.c2 { top: 14%; right: 0%; animation-delay: 1.4s; }
.vx-rep-chip.c3 { bottom: 10%; left: 6%; animation-delay: 2.5s; }

@keyframes vx-repchip {
  0%, 100% { opacity: 0; transform: translate3d(0, 10px, 0); }
  12%, 40% { opacity: 1; transform: translate3d(0, 0, 0); }
  55%      { opacity: 0; transform: translate3d(0, -8px, 0); }
}

/* ==========================================================
   3. RANK SWAP - before/after local-pack position
   ========================================================== */
.vx-rank {
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .5rem;
}

.vx-rank-state {
  position: relative;
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .65rem .75rem;
  border-radius: .75rem;
  border: 1px solid var(--gbp-line);
  background: #fff;
  overflow: hidden;
}

.vx-rank-tag {
  position: absolute;
  top: .5rem;
  right: .6rem;
  padding: .18rem .5rem;
  border-radius: 999px;
  font: 800 10px/1.5 var(--gbp-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.vx-rank-state.is-before { animation: vx-rankbefore 6s ease-in-out infinite; }
.vx-rank-state.is-before .vx-rank-tag { background: #F1F3F9; color: var(--gbp-mute); }

.vx-rank-state.is-after { animation: vx-rankafter 6s ease-in-out infinite; }
.vx-rank-state.is-after .vx-rank-tag { background: rgba(16, 185, 129, .14); color: #059669; }

@keyframes vx-rankbefore {
  0%, 40%   { opacity: 1; filter: none; }
  55%, 100% { opacity: .4; filter: grayscale(.3); }
}

@keyframes vx-rankafter {
  0%, 40%   { transform: scale(.98); box-shadow: none; }
  55%, 92%  { transform: scale(1); box-shadow: 0 12px 28px -14px rgba(16, 185, 129, .4); }
  100%      { transform: scale(.98); box-shadow: none; }
}

.vx-rank-state.is-after {
  border-color: rgba(16, 185, 129, .35);
  background: linear-gradient(135deg, rgba(16, 185, 129, .07), rgba(16, 185, 129, .02));
}

.vx-rank-pos {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: .55rem;
  font: 800 12px/1 var(--gbp-mono);
}

.vx-rank-state.is-before .vx-rank-pos { background: #F1F3F9; color: var(--gbp-mute); }
.vx-rank-state.is-after .vx-rank-pos  { background: var(--gbp-green); color: #fff; }

.vx-rank-main { flex: 1 1 auto; min-width: 0; }

.vx-rank-name {
  font: 700 12px/1.3 'Inter', sans-serif;
  color: var(--gbp-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vx-rank-meta {
  margin-top: .12rem;
  font: 600 10px/1.3 var(--gbp-mono);
  color: var(--gbp-mute);
}

/* connecting arrow between the two states */
.vx-rank-arrow {
  align-self: center;
  color: var(--gbp-violet);
  animation: vx-rankarrow 1.6s ease-in-out infinite;
}

@keyframes vx-rankarrow {
  0%, 100% { transform: translate3d(0, 0, 0); opacity: .6; }
  50%      { transform: translate3d(0, 4px, 0); opacity: 1; }
}

/* ==========================================================
   4. RESPONSIVE
   ========================================================== */
@media (max-width: 639px) {
  .vx-build-label { font-size: 10px; }
  .vx-build-pct   { font-size: 10px; }
  .vx-rep-num     { font-size: 24px; }
  .vx-rep-chip    { font-size: 10px; padding: .3rem .5rem; }
  .vx-rank-name   { font-size: 11px; }
  .vx-rank-meta   { font-size: 10px; }
}

@media (max-width: 400px) {
  .vx-rep-chip.c2 { display: none; } /* keeps the meter readable on the narrowest phones */
}

/* ==========================================================
   5. MOTION SAFETY
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
  .gbp *, .gbp *::before, .gbp *::after {
    animation: none !important;
    transition: none !important;
  }
  .vx-build-row::after     { opacity: 0; }
  .vx-build-icon           { background: var(--gbp-green); color: #fff; }
  .vx-build-bar span       { transform: scaleX(1); }
  .vx-build-pct            { color: #059669; }
  .vx-rep-stars .fg        { width: 96%; opacity: 1; }
  .vx-rep-chip             { opacity: 1; transform: none; }
  .vx-rank-state.is-before { opacity: .4; filter: grayscale(.3); }
  .vx-rank-state.is-after  { transform: none; box-shadow: 0 12px 28px -14px rgba(16, 185, 129, .4); }
}

/* ==========================================================
   MOBILE 2-UP FIX -- fixed 3-item metric/stat strips show only
   2 tiles per row on small phones (3 tiles in a row was either
   cramped/clipped, or stacking all 3 full-width made the card
   too tall). The 3rd tile is hidden rather than wrapped to its
   own half-empty row, and the CTA nothing else references it.
   ========================================================== */
@media (max-width: 480px) {
  .vx-dial-foot { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: .6rem !important; }
  .vx-dial-foot > *:nth-child(3) { display: none !important; }
}
