/* --------------------------------------- */
/* Base + Layout                          */
/* --------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  color: #0f172a;
}

/* Page wrapper */
.vgt-page {
  /* min-height: 100vh;   <-- get rid of this line */
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 16px;
  background: radial-gradient(circle at top, #e0f2ff 0, #f8fafc 55%, #e5e7eb 100%);
}

/* 🔧 Hard override for embedded / iframe mode */
html.vgt-embedded body,
html.vgt-embedded .vgt-page {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  height: auto !important;
  min-height: 0 !important;
}

/* keep it compact */
html.vgt-embedded .vgt-main {
  margin-bottom: 4px;
}

html.vgt-embedded .vgt-footer {
  display: none;            /* optional, but saves vertical space */
}


/* Main content: tree (left) + details (right) */
.vgt-main {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  gap: 24px;
  align-items: stretch;
  flex-wrap: wrap;
}

/* --------------------------------------- */
/* Tree Panel                             */
/* --------------------------------------- */

.vgt-tree-panel {
  flex: 1 1 360px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 18px;
  padding: 16px;
  background-image: url("background.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
}

/* Tree + tags wrap */
.vgt-tree-image-wrap {
  position: relative;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
}

.vgt-tree-image {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 12px 22px rgba(15, 23, 42, 0.5));
}

/* --------------------------------------- */
/* Tag Layer + Buttons                    */
/* --------------------------------------- */

.vgt-tag-layer {
  position: absolute;
  inset: 0;
  pointer-events: none; /* layer itself ignores clicks */
}

/* Each tag button */
.vgt-tag {
  position: absolute;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  pointer-events: auto; /* re-enable on button */
  /* base transform uses a custom property for rotation */
  --tag-rotate: 0deg;
  transform: translate(-50%, -50%) rotate(var(--tag-rotate));
  transition: transform 0.18s ease, filter 0.18s ease;
}

/* Tag images – global size control */
.vgt-tag img {
  display: block;
  width: 120px;
  height: auto;
}

/* Remove default focus ring */
.vgt-tag:focus,
.vgt-tag:active {
  outline: none !important;
  box-shadow: none !important;
}

/* Hover / active glow */
.vgt-tag:hover {
  transform: translate(-50%, -50%) rotate(var(--tag-rotate)) scale(1.05);
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.85));
}

.vgt-tag--active {
  transform: translate(-50%, -50%) rotate(var(--tag-rotate)) scale(1.075);
  filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.95));
  z-index: 3;
}
/* ---------------------------------------
   OLD SPARKLE EFFECT (DISABLED)
-----------------------------------------*/

/*
.vgt-tag::after { ... }
.vgt-tag--sparkle::after { ... }
@keyframes vgt-sparkle-burst { ... }
*/


/* ============================================
   NEW TWO-POINT SPARKLE EFFECT (Gold Stars)
   Top-Right + Bottom-Left
   ============================================ */

/* STARBURST SHAPE — used by both sparkles */
.vgt-tag::after,
.vgt-tag::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  background: radial-gradient(circle, #fff7d1 0%, #ffe89a 40%, transparent 60%);
  opacity: 0;
  transform: scale(0.1) rotate(0deg);
  pointer-events: none;

  /* star shape */
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 91%,
    50% 70%,
    21% 91%,
    32% 57%,
    2% 35%,
    39% 35%
  );
}

/* ⭐ Top-Right Sparkle */
.vgt-tag::after {
  top: 8%;
  right: 5%;
}

/* ⭐ Bottom-Left Sparkle */
.vgt-tag::before {
  bottom: 10%;
  left: 8%;
}

/* Trigger both sparkles */
.vgt-tag--sparkle::after,
.vgt-tag--sparkle::before {
  animation: vgt-starburst-dual 0.45s ease-out forwards;
}

/* Animation for both sparkles */
@keyframes vgt-starburst-dual {
  0% {
    opacity: 0;
    transform: scale(0.2) rotate(0deg);
  }
  35% {
    opacity: 1;
    transform: scale(1.2) rotate(12deg);
  }
  100% {
    opacity: 0;
    transform: scale(0.5) rotate(-20deg);
  }
}

/* --------------------------------------- */
/* Tag Positions & Angles (zig-zag, de-lined) */
/* --------------------------------------- */

/* Pink – custom amount (upper, slightly right of center) */
.vgt-tag[data-id="custom-heart"] {
  top: 19%;
  left: 58%;   /* on the tree, but not way out on the edge */
  --tag-rotate: -10deg;
}

/* Blue – $30 (move way right so it’s fully on the tree) */
.vgt-tag[data-id="angel-30"] {
  top: 36%;
  left: 45%;   /* was 32% */
  --tag-rotate: 10deg;
}

/* Red – $60 (upper-right / mid-right branch) */
.vgt-tag[data-id="angel-60"] {
  top: 47%;    /* a bit lower than blue */
  left: 78%;   /* clearly on the right side */
  --tag-rotate: -8deg;
}

/* Orange – $90 (come down more on the left side) */
.vgt-tag[data-id="angel-90"] {
  top: 62%;    /* was 56% */
  left: 45%;   /* same left, just lower */
  --tag-rotate: -10deg;
}

/* Green – $150 (nudged slightly lower so it doesn't clash with orange) */
.vgt-tag[data-id="angel-150"] {
  top: 74%;    /* was 68% */
  left: 80%;   /* same horizontal position */
  --tag-rotate: -8deg;
}

/* Purple – $300 (lower-left branch) */
.vgt-tag[data-id="angel-300"] {
  top: 82%;
  left: 30%;   /* lower and clearly left, not under orange */
  --tag-rotate: 6deg;
}

/* --------------------------------------- */
/* Details Panel                          */
/* --------------------------------------- */

.vgt-details-panel {
  flex: 1 1 320px;
  background: #ffffff;
  border-radius: 18px;
  padding: 24px 24px 20px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.vgt-details-panel h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  line-height: 1.25;
}

.vgt-detail-amount {
  margin: 0 0 12px;
  font-weight: 700;
  font-size: 1.1rem;
  color: #0f4aa8;
}

.vgt-detail-description {
  margin: 0 0 20px;
  line-height: 1.55;
  font-size: 0.98rem;
  color: #111827;
}

/* Donate button */
.vgt-donate-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  background: linear-gradient(135deg, #004a98, #2563eb);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.4);
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.vgt-donate-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.5);
}

.vgt-donate-button:active {
  transform: translateY(0);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.35);
}

.vgt-small-note {
  margin-top: 14px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #4b5563;
}

/* --------------------------------------- */
/* Footer                                 */
/* --------------------------------------- */

.vgt-footer {
  margin-top: 8px;
  text-align: center;
  font-size: 0.8rem;
  color: #1f2933;
  opacity: 0.8;
}

/* --------------------------------------- */
/* Responsive                             */
/* --------------------------------------- */

@media (max-width: 900px) {
  .vgt-main {
    flex-direction: column;
  }

  .vgt-tree-panel,
  .vgt-details-panel {
    flex: 1 1 auto;
  }

  .vgt-tree-panel {
    order: -1;
  }

  .vgt-details-panel {
    margin-top: 10px;
  }
}

@media (max-width: 640px) {
  .vgt-page {
    padding: 16px 10px 20px;
  }

  .vgt-tag img {
    width: 95px;
  }

  .vgt-details-panel {
    padding: 18px 16px 16px;
  }

  .vgt-details-panel h2 {
    font-size: 1.25rem;
  }
}
