/* Welcome page (dashboard.html) and Geo Redirect type modal (GeoRedirectModal.tsx) motion —
   hover only: card lift and animated product icons, plus the modal's open transition.
   All selectors are scoped under .gtw so nothing else in the dashboard is affected. */

.gtw {
  --gtw-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --gtw-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --gtw-blue: #2f6ce0;
  --gtw-green: #5bc35b;
}

/* ---------- Card hover ---------- */

.gtw-tile {
  transition: transform 0.3s var(--gtw-ease), box-shadow 0.3s var(--gtw-ease);
}
.gtw-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px -10px rgba(22, 44, 92, 0.18), 0 2px 6px rgba(22, 44, 92, 0.06);
}

.gtw .fa-plus,
.gtw .btn .fa-long-arrow-right,
.gtw .btn .fa-plug {
  transition: transform 0.3s var(--gtw-ease);
}
.gtw-tile:hover .fa-plus { transform: rotate(90deg); }
.gtw-tile:hover .btn .fa-long-arrow-right { transform: translateX(3px); }
.gtw-tile:hover .btn .fa-plug { transform: rotate(-20deg); }

/* ---------- Modal open (click-triggered) ---------- */

.gtw-modal-backdrop { animation: gtw-fade-in 0.2s ease both; }
.gtw-modal-panel { animation: gtw-modal-in 0.3s var(--gtw-ease) both; }
@keyframes gtw-fade-in { from { opacity: 0; } }
@keyframes gtw-modal-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } }

/* ---------- Ribbons: light sweep on hover ---------- */

.gtw-ribbon { overflow: hidden; }
.gtw-ribbon::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: translateX(-120%);
  pointer-events: none;
}
.gtw-tile:hover .gtw-ribbon::after { animation: gtw-sheen 1.1s var(--gtw-ease) both; }
@keyframes gtw-sheen { from { transform: translateX(-120%); } to { transform: translateX(300%); } }

/* ---------- Icons: shared ---------- */

.gtw-icon { display: block; margin: 0 auto; overflow: visible; }
.gtw-icon text { font-family: "Open Sans", Arial, sans-serif; font-weight: 700; }
.gtw-icon .gtw-c { transform-box: fill-box; transform-origin: center; }

/* Font Awesome icons in the Support / API cards */
.gtw-fa { display: inline-block; transition: transform 0.5s var(--gtw-spring); }
.gtw-tile:hover .gtw-fa-buoy { animation: gtw-buoy 1s var(--gtw-ease); }
@keyframes gtw-buoy {
  0% { transform: rotate(0); }
  35% { transform: rotate(-18deg); }
  70% { transform: rotate(8deg); }
  100% { transform: rotate(0); }
}
.gtw-tile:hover .gtw-fa-plug { animation: gtw-plug 0.9s var(--gtw-ease); }
@keyframes gtw-plug {
  0% { transform: translate(0, 0); }
  40% { transform: translate(-6px, 6px); }
  60% { transform: translate(2px, -2px); }
  100% { transform: translate(0, 0); }
}

/* Geo Insights banner chart: line redraws on hover */
.gtw-chart-line { stroke-dasharray: 60; }
.gtw-tile:hover .gtw-chart-line { animation: gtw-draw 1s var(--gtw-ease) both; }
@keyframes gtw-draw { from { stroke-dashoffset: 60; } to { stroke-dashoffset: 0; } }

/* Shared vertical ticker (URL, currency, script, banner text) */
@keyframes gtw-tick-20 {
  0%, 22% { transform: translateY(0); }
  30%, 55% { transform: translateY(-20px); }
  63%, 88% { transform: translateY(-40px); }
  96%, 100% { transform: translateY(-60px); }
}
@keyframes gtw-tick-44 {
  0%, 22% { transform: translateY(0); }
  30%, 55% { transform: translateY(-44px); }
  63%, 88% { transform: translateY(-88px); }
  96%, 100% { transform: translateY(-132px); }
}
@keyframes gtw-tick-48 {
  0%, 22% { transform: translateY(0); }
  30%, 55% { transform: translateY(-48px); }
  63%, 88% { transform: translateY(-96px); }
  96%, 100% { transform: translateY(-144px); }
}

/* ---------- Geo Redirect: domain changes, page reloads ---------- */
/* .gtw-autoplay plays icon animations without hover: used by product empty states, which only users with no setups see */
.gtw-tile:hover .gtw-redirect .gtw-url,
.gtw-autoplay .gtw-redirect .gtw-url { animation: gtw-tick-20 4.2s var(--gtw-ease) infinite; }
.gtw-tile:hover .gtw-redirect .gtw-page,
.gtw-autoplay .gtw-redirect .gtw-page { animation: gtw-reload 4.2s ease infinite; }
.gtw-tile:hover .gtw-redirect .gtw-chev,
.gtw-autoplay .gtw-redirect .gtw-chev { animation: gtw-nudge 1.4s var(--gtw-ease) infinite; }
@keyframes gtw-reload {
  0%, 24% { opacity: 1; }
  28% { opacity: 0.2; }
  34%, 57% { opacity: 1; }
  61% { opacity: 0.2; }
  67%, 90% { opacity: 1; }
  94% { opacity: 0.2; }
  100% { opacity: 1; }
}
@keyframes gtw-nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(3px); }
}

/* ---------- Geo Link: chain snaps together, cursor clicks ---------- */
.gtw-tile:hover .gtw-link .gtw-chain-l, .gtw-autoplay .gtw-link .gtw-chain-l { animation: gtw-chain-l 0.6s var(--gtw-spring) both; }
.gtw-tile:hover .gtw-link .gtw-chain-r, .gtw-autoplay .gtw-link .gtw-chain-r { animation: gtw-chain-r 0.6s var(--gtw-spring) both; }
.gtw-tile:hover .gtw-link .gtw-underline, .gtw-autoplay .gtw-link .gtw-underline { animation: gtw-underline 0.5s var(--gtw-ease) 0.45s both; }
.gtw-tile:hover .gtw-link .gtw-cursor, .gtw-autoplay .gtw-link .gtw-cursor { animation: gtw-cursor 1.4s var(--gtw-ease) both; }
.gtw-tile:hover .gtw-link .gtw-ripple, .gtw-autoplay .gtw-link .gtw-ripple { animation: gtw-ripple 0.7s ease-out 0.95s both; }
.gtw-link .gtw-underline { transform: scaleX(0); transform-origin: left; transform-box: fill-box; }
.gtw-link .gtw-cursor,
.gtw-link .gtw-ripple { opacity: 0; }
@keyframes gtw-chain-l { from { transform: translateX(-8px); } to { transform: none; } }
@keyframes gtw-chain-r { from { transform: translateX(8px); } to { transform: none; } }
@keyframes gtw-underline { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes gtw-cursor {
  0% { opacity: 0; transform: translate(56px, 34px); }
  25% { opacity: 1; }
  60% { transform: translate(0, 0); }
  68% { transform: translate(0, 0) scale(0.85); }
  78%, 100% { opacity: 1; transform: translate(0, 0) scale(1); }
}
@keyframes gtw-ripple {
  from { opacity: 0.55; transform: scale(0.2); }
  to { opacity: 0; transform: scale(2.2); }
}

/* ---------- Geo Currency / Geo Translate: symbol ticker ---------- */
.gtw-tile:hover .gtw-currency .gtw-ticker, .gtw-autoplay .gtw-currency .gtw-ticker,
.gtw-tile:hover .gtw-translate .gtw-ticker, .gtw-autoplay .gtw-translate .gtw-ticker { animation: gtw-tick-48 4.2s var(--gtw-ease) infinite; }
.gtw-tile:hover .gtw-currency .gtw-base, .gtw-autoplay .gtw-currency .gtw-base,
.gtw-tile:hover .gtw-translate .gtw-base, .gtw-autoplay .gtw-translate .gtw-base { animation: gtw-bump 1.4s var(--gtw-ease) infinite; }
@keyframes gtw-bump {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.08); }
  30% { transform: scale(1); }
}

/* ---------- Geo Consent: banner slides up, accept gets pressed ---------- */
.gtw-tile:hover .gtw-consent .gtw-modal, .gtw-autoplay .gtw-consent .gtw-modal { animation: gtw-slide-up 0.6s var(--gtw-ease) both; }
.gtw-tile:hover .gtw-consent .gtw-accept, .gtw-autoplay .gtw-consent .gtw-accept { animation: gtw-press 0.5s var(--gtw-ease) 0.75s both; }
.gtw-tile:hover .gtw-consent .gtw-accept-bg, .gtw-autoplay .gtw-consent .gtw-accept-bg { animation: gtw-accept 0.5s ease 0.85s both; }
@keyframes gtw-slide-up { from { transform: translateY(72px); } to { transform: none; } }
@keyframes gtw-press {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(0.9); }
}
@keyframes gtw-accept { to { fill: var(--gtw-green); } }

/* ---------- Geo Page: profile pops, links cascade in ---------- */
.gtw-tile:hover .gtw-phone .gtw-avatar, .gtw-autoplay .gtw-phone .gtw-avatar { animation: gtw-pop 0.55s var(--gtw-spring) both; }
.gtw-tile:hover .gtw-phone .gtw-item, .gtw-autoplay .gtw-phone .gtw-item { animation: gtw-item 0.45s var(--gtw-ease) both; }
.gtw-tile:hover .gtw-phone .gtw-item:nth-of-type(2), .gtw-autoplay .gtw-phone .gtw-item:nth-of-type(2) { animation-delay: 0.08s; }
.gtw-tile:hover .gtw-phone .gtw-item:nth-of-type(3), .gtw-autoplay .gtw-phone .gtw-item:nth-of-type(3) { animation-delay: 0.16s; }
.gtw-tile:hover .gtw-phone .gtw-item:nth-of-type(4), .gtw-autoplay .gtw-phone .gtw-item:nth-of-type(4) { animation-delay: 0.24s; }
.gtw-tile:hover .gtw-phone .gtw-item:nth-of-type(5), .gtw-autoplay .gtw-phone .gtw-item:nth-of-type(5) { animation-delay: 0.32s; }
@keyframes gtw-pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes gtw-item { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Geo Content: banner message rotates ---------- */
.gtw-tile:hover .gtw-content .gtw-ticker, .gtw-autoplay .gtw-content .gtw-ticker { animation: gtw-tick-44 4.2s var(--gtw-ease) infinite; }

/* ---------- Geo Image: image swaps for another location ---------- */
.gtw-image .gtw-img-b { opacity: 0; transition: opacity 0.45s ease; }
.gtw-image .gtw-img-a { transition: transform 0.6s var(--gtw-ease); }
.gtw-image .gtw-sun { transform: translateY(12px); transition: transform 0.7s var(--gtw-spring) 0.1s; }
.gtw-tile:hover .gtw-image .gtw-img-b, .gtw-autoplay .gtw-image .gtw-img-b { opacity: 1; }
.gtw-tile:hover .gtw-image .gtw-img-a, .gtw-autoplay .gtw-image .gtw-img-a { transform: scale(1.06); }
.gtw-tile:hover .gtw-image .gtw-sun, .gtw-autoplay .gtw-image .gtw-sun { transform: none; }

/* ---------- Geo Popup: backdrop dims, popup springs in ---------- */
.gtw-popup .gtw-backdrop { opacity: 0; }
.gtw-tile:hover .gtw-popup .gtw-backdrop, .gtw-autoplay .gtw-popup .gtw-backdrop { animation: gtw-fade-to 0.4s ease both; }
.gtw-tile:hover .gtw-popup .gtw-box, .gtw-autoplay .gtw-popup .gtw-box { animation: gtw-spring-in 0.6s var(--gtw-spring) both; }
.gtw-tile:hover .gtw-popup .gtw-cta, .gtw-autoplay .gtw-popup .gtw-cta { animation: gtw-pulse 0.6s var(--gtw-ease) 0.7s both; }
@keyframes gtw-fade-to { to { opacity: 0.22; } }
@keyframes gtw-spring-in { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: scale(1); } }
@keyframes gtw-pulse {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.12); }
}

/* ---------- Geo Bar: bar slides in and pushes the page down ---------- */
.gtw-tile:hover .gtw-bar .gtw-topbar, .gtw-autoplay .gtw-bar .gtw-topbar { animation: gtw-bar-in 0.55s var(--gtw-ease) both; }
.gtw-tile:hover .gtw-bar .gtw-below, .gtw-autoplay .gtw-bar .gtw-below { animation: gtw-push 0.55s var(--gtw-ease) both; }
.gtw-tile:hover .gtw-bar .gtw-cta, .gtw-autoplay .gtw-bar .gtw-cta { animation: gtw-pulse 0.6s var(--gtw-ease) 0.6s both; }
@keyframes gtw-bar-in { from { transform: translateY(-28px); } to { transform: none; } }
@keyframes gtw-push { from { transform: translateY(-26px); } to { transform: none; } }

/* ---------- Geo Location: pin drops with a ripple ---------- */
.gtw-location .gtw-ping { opacity: 0; }
.gtw-tile:hover .gtw-location .gtw-pin, .gtw-autoplay .gtw-location .gtw-pin { animation: gtw-pin-drop 0.75s var(--gtw-ease) both; }
.gtw-tile:hover .gtw-location .gtw-ping, .gtw-autoplay .gtw-location .gtw-ping { animation: gtw-ripple 0.8s ease-out 0.5s both; }
.gtw-tile:hover .gtw-location .gtw-found, .gtw-autoplay .gtw-location .gtw-found { animation: gtw-pulse 0.5s var(--gtw-ease) 0.7s both; }
@keyframes gtw-pin-drop {
  0% { opacity: 0; transform: translateY(-36px); }
  55% { opacity: 1; transform: translateY(0); }
  72% { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

/* ---------- Geo Javascript: code types itself ---------- */
.gtw-js .gtw-cover { transform: scaleX(0); transform-box: fill-box; transform-origin: right; }
.gtw-js .gtw-caret { opacity: 0; }
.gtw-tile:hover .gtw-js .gtw-cover, .gtw-autoplay .gtw-js .gtw-cover { animation: gtw-type 1.1s steps(15) 0.15s both; }
.gtw-tile:hover .gtw-js .gtw-caret, .gtw-autoplay .gtw-js .gtw-caret { animation: gtw-caret-move 1.1s steps(15) 0.15s both, gtw-blink 0.8s steps(1) 1.25s infinite; }
@keyframes gtw-type { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes gtw-caret-move { from { opacity: 1; transform: translateX(0); } to { opacity: 1; transform: translateX(90px); } }
@keyframes gtw-blink {
  0% { opacity: 1; transform: translateX(90px); }
  50% { opacity: 0; transform: translateX(90px); }
  100% { opacity: 1; transform: translateX(90px); }
}

/* ---------- Geo Block: X shakes, BLOCKED stamps ---------- */
.gtw-tile:hover .gtw-block .gtw-x, .gtw-autoplay .gtw-block .gtw-x { animation: gtw-shake 0.55s ease both; }
.gtw-tile:hover .gtw-block .gtw-stamp, .gtw-autoplay .gtw-block .gtw-stamp { animation: gtw-stamp 0.5s var(--gtw-spring) 0.3s both; }
@keyframes gtw-shake {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-14deg); }
  40% { transform: rotate(12deg); }
  60% { transform: rotate(-8deg); }
  80% { transform: rotate(4deg); }
}
@keyframes gtw-stamp {
  from { opacity: 0; transform: scale(1.9) rotate(-8deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

/* ---------- Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  .gtw,
  .gtw *,
  .gtw *::before,
  .gtw *::after {
    animation: none !important;
    transition: none !important;
  }
}
