/* ============================================
   BounceZero — Animations & Visual Polish
   Scroll animations, typewriter, micro-interactions
   ============================================ */

/* ---- Scroll-Triggered Animations ---- */

/* Base hidden state — only hide when JS is available */
.js-loaded [data-animate] {
    opacity: 0;
    will-change: transform, opacity;
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.js-loaded [data-animate].is-visible {
    opacity: 1;
    transform: none !important;
}

/* Fade Up (default) */
.js-loaded [data-animate="fade-up"] {
    transform: translateY(40px);
}

/* Fade Down */
.js-loaded [data-animate="fade-down"] {
    transform: translateY(-40px);
}

/* Fade Left */
.js-loaded [data-animate="fade-left"] {
    transform: translateX(-40px);
}

/* Fade Right */
.js-loaded [data-animate="fade-right"] {
    transform: translateX(40px);
}

/* Scale In */
.js-loaded [data-animate="scale-in"] {
    transform: scale(0.9);
}

/* Zoom In (more dramatic) */
.js-loaded [data-animate="zoom-in"] {
    transform: scale(0.8);
}

/* Delay utilities via data-delay */
[data-delay="100"] { transition-delay: 0.1s; }
[data-delay="150"] { transition-delay: 0.15s; }
[data-delay="200"] { transition-delay: 0.2s; }
[data-delay="250"] { transition-delay: 0.25s; }
[data-delay="300"] { transition-delay: 0.3s; }
[data-delay="350"] { transition-delay: 0.35s; }
[data-delay="400"] { transition-delay: 0.4s; }
[data-delay="450"] { transition-delay: 0.45s; }
[data-delay="500"] { transition-delay: 0.5s; }
[data-delay="600"] { transition-delay: 0.6s; }
[data-delay="700"] { transition-delay: 0.7s; }
[data-delay="800"] { transition-delay: 0.8s; }

/* ---- Staggered Children ---- */
.js-loaded [data-stagger] > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-stagger].is-visible > *:nth-child(1) { transition-delay: 0s; }
[data-stagger].is-visible > *:nth-child(2) { transition-delay: 0.12s; }
[data-stagger].is-visible > *:nth-child(3) { transition-delay: 0.24s; }
[data-stagger].is-visible > *:nth-child(4) { transition-delay: 0.36s; }
[data-stagger].is-visible > *:nth-child(5) { transition-delay: 0.48s; }
[data-stagger].is-visible > *:nth-child(6) { transition-delay: 0.60s; }
[data-stagger].is-visible > *:nth-child(7) { transition-delay: 0.72s; }
[data-stagger].is-visible > *:nth-child(8) { transition-delay: 0.84s; }
[data-stagger].is-visible > *:nth-child(9) { transition-delay: 0.96s; }

[data-stagger].is-visible > * {
    opacity: 1;
    transform: none;
}

/* Stagger scale variant */
[data-stagger="scale"] > * {
    transform: scale(0.9);
}

/* ---- Typewriter ---- */
.typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: currentColor;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 0.7s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ---- Gradient Headline ---- */
/* Defined in custom.css — no animation override here */

/* ---- Pulse Glow on CTA Buttons ---- */
.pulse-glow {
    animation: pulseGlow 2.5s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(233, 30, 99, 0.3), 0 0 20px rgba(233, 30, 99, 0.1); }
    50% { box-shadow: 0 0 10px rgba(233, 30, 99, 0.5), 0 0 40px rgba(233, 30, 99, 0.2); }
}

.pulse-glow-teal {
    animation: pulseGlowTeal 2.5s ease-in-out infinite;
}

@keyframes pulseGlowTeal {
    0%, 100% { box-shadow: 0 0 5px rgba(38, 166, 154, 0.3), 0 0 20px rgba(38, 166, 154, 0.1); }
    50% { box-shadow: 0 0 10px rgba(38, 166, 154, 0.5), 0 0 40px rgba(38, 166, 154, 0.2); }
}

/* ---- Button Hover Lift ---- */
.btn-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* ---- Card Hover Lift ---- */
.card-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .card-lift:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* ---- Link Underline Slide ---- */
.link-slide {
    position: relative;
    display: inline-block;
}

.link-slide::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #E91E63;
    transition: width 0.3s ease;
}

.link-slide:hover::after {
    width: 100%;
}

/* ---- Gradient Divider ---- */
.gradient-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(233, 30, 99, 0.3), transparent);
    border: none;
    margin: 2rem 0;
}

.gradient-divider-teal {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(38, 166, 154, 0.3), transparent);
    border: none;
    margin: 2rem 0;
}

/* ---- Back to Top Button ---- */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #E91E63;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
    z-index: 50;
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: #C2185B;
    transform: translateY(-3px);
}

/* ---- Legal Page TOC ---- */
.legal-toc {
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
}

.legal-toc a {
    display: block;
    padding: 0.4rem 0.75rem;
    border-left: 2px solid transparent;
    font-size: 0.8rem;
    color: rgba(148, 163, 184, 0.7);
    transition: all 0.2s ease;
    text-decoration: none;
}

.legal-toc a:hover {
    color: #E91E63;
    border-left-color: rgba(233, 30, 99, 0.3);
}

.legal-toc a.active {
    color: #E91E63;
    border-left-color: #E91E63;
    background: rgba(233, 30, 99, 0.05);
    font-weight: 600;
}

/* Legal section number badge */
.section-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: rgba(233, 30, 99, 0.1);
    color: #E91E63;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* Legal callout box */
.legal-callout {
    background: rgba(233, 30, 99, 0.04);
    border-left: 3px solid #E91E63;
    border-radius: 0 0.5rem 0.5rem 0;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
}

[data-theme="dark"] .legal-callout {
    background: rgba(233, 30, 99, 0.08);
}

/* ---- Counter Animation ---- */
.counter-num {
    display: inline-block;
    min-width: 1ch;
}

/* ---- Input Enhanced Focus ---- */
.input-enhanced {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-enhanced:focus {
    border-color: #E91E63 !important;
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1), 0 0 20px rgba(233, 30, 99, 0.05);
}

/* ---- Floating Shapes Background ---- */
.floating-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.floating-shapes .shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.03;
    animation: floatShape 20s ease-in-out infinite;
}

.floating-shapes .shape:nth-child(1) {
    width: 300px; height: 300px;
    background: #E91E63;
    top: 10%; left: -5%;
    animation-duration: 25s;
}

.floating-shapes .shape:nth-child(2) {
    width: 200px; height: 200px;
    background: #9C27B0;
    top: 60%; right: -3%;
    animation-delay: -5s;
    animation-duration: 20s;
}

.floating-shapes .shape:nth-child(3) {
    width: 150px; height: 150px;
    background: #26A69A;
    bottom: 10%; left: 30%;
    animation-delay: -10s;
    animation-duration: 22s;
}

@keyframes floatShape {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -20px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 10px) scale(1.02); }
}

/* ---- Subtle background gradient shift ---- */
.bg-gradient-shift {
    background-size: 200% 200%;
    animation: bgShift 15s ease infinite;
}

@keyframes bgShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ---- Table row hover for dashboard ---- */
.table-row-hover {
    transition: background-color 0.2s ease;
}

.table-row-hover:hover {
    background-color: rgba(233, 30, 99, 0.03);
}

[data-theme="dark"] .table-row-hover:hover {
    background-color: rgba(233, 30, 99, 0.06);
}

/* ============================================
   Reduced Motion — Respect accessibility
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    [data-animate],
    [data-stagger] > * {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .typewriter-cursor {
        animation: none;
    }

    .pulse-glow, .pulse-glow-teal {
        animation: none;
    }

    .gradient-headline {
        animation: none;
    }

    .floating-shapes .shape {
        animation: none;
    }
}

/* ============================================
   Mobile Adjustments
   ============================================ */
@media (max-width: 768px) {
    [data-animate="fade-up"] { transform: translateY(20px); }
    [data-animate="fade-down"] { transform: translateY(-20px); }
    [data-animate="fade-left"] { transform: translateX(-20px); }
    [data-animate="fade-right"] { transform: translateX(20px); }

    [data-stagger] > * {
        transform: translateY(20px);
    }

    .legal-toc {
        position: static;
        max-height: none;
    }
}

/* ============================================
   Premium Checkout Modal — shared by pricing.php & dashboard.php
   ============================================ */

/* Backdrop */
.bz-backdrop {
  background: rgba(0,0,0,0);
  transition: background 180ms ease-out;
}
.bz-backdrop.bz-open {
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Panel */
.bz-modal-panel {
  border-radius: 20px;
  max-width: 480px;
  width: calc(100% - 32px);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.06),
    0 8px 24px rgba(0,0,0,0.10),
    0 32px 64px rgba(0,0,0,0.15);
  transform: scale(0.96) translateY(10px);
  opacity: 0;
  transition: transform 220ms cubic-bezier(0.22,1,0.36,1), opacity 220ms cubic-bezier(0.22,1,0.36,1);
  overscroll-behavior: contain;
}
[data-theme="dark"] .bz-modal-panel {
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 8px 24px rgba(0,0,0,0.40),
    0 32px 64px rgba(0,0,0,0.50);
}
.bz-backdrop.bz-open .bz-modal-panel {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Closing state */
.bz-backdrop.bz-closing .bz-modal-panel {
  transform: scale(0.96) translateY(8px);
  opacity: 0;
}
.bz-backdrop.bz-closing {
  background: rgba(0,0,0,0) !important;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: background 160ms ease-in, backdrop-filter 160ms ease-in;
}

/* Order summary panel tint */
.bz-summary-panel {
  background: #F8F8FA;
}
[data-theme="dark"] .bz-summary-panel {
  background: rgba(255,255,255,0.04);
}

/* Payment method cards — unselected */
.bz-method-card {
  border-color: #E5E7EB;
  background: #fff;
}
[data-theme="dark"] .bz-method-card {
  border-color: rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
}
.bz-method-card:hover {
  border-color: rgba(233,30,99,0.35);
  background: rgba(233,30,99,0.02);
}
[data-theme="dark"] .bz-method-card:hover {
  border-color: rgba(233,30,99,0.40);
  background: rgba(233,30,99,0.07);
}

/* Unselected indicator */
.bz-method-card .bz-method-indicator {
  border-color: #D1D5DB;
}
[data-theme="dark"] .bz-method-card .bz-method-indicator {
  border-color: rgba(255,255,255,0.20);
}
.bz-method-card .bz-method-dot {
  background: transparent;
}

/* Selected card */
.bz-method-card.bz-method-active {
  border-color: #E91E63;
  background: rgba(233,30,99,0.05);
}
[data-theme="dark"] .bz-method-card.bz-method-active {
  border-color: #E91E63;
  background: rgba(233,30,99,0.10);
}
.bz-method-card.bz-method-active .bz-method-indicator {
  border-color: #E91E63;
  background: #E91E63;
}
.bz-method-card.bz-method-active .bz-method-dot {
  background: white;
  width: 6px;
  height: 6px;
}

/* Indicator pop animation on select */
@keyframes bzIndicatorPop {
  0%   { transform: scale(0.7); }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.bz-method-card.bz-method-active .bz-method-indicator {
  animation: bzIndicatorPop 180ms cubic-bezier(0.34,1.56,0.64,1) forwards;
}

/* Coupon group — fused input+button */
.bz-coupon-group {
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 150ms ease;
}
[data-theme="dark"] .bz-coupon-group {
  border-color: rgba(255,255,255,0.12);
}
.bz-coupon-group:focus-within {
  border-color: #E91E63;
}
.bz-coupon-group.bz-coupon-error {
  border-color: #EF4444;
}
.bz-coupon-group.bz-coupon-success {
  border-color: #10B981;
}
.bz-coupon-input {
  border: none;
}
.bz-coupon-btn {
  border-left: 1.5px solid #E5E7EB;
  border-radius: 0;
}
[data-theme="dark"] .bz-coupon-btn {
  border-left-color: rgba(255,255,255,0.10);
}

/* Coupon shake animation */
@keyframes bzShake {
  0%,100% { transform: translateX(0); }
  18%     { transform: translateX(-5px); }
  36%     { transform: translateX(5px); }
  54%     { transform: translateX(-4px); }
  72%     { transform: translateX(4px); }
  90%     { transform: translateX(-2px); }
}
.bz-coupon-group.bz-shake {
  animation: bzShake 280ms cubic-bezier(0.36,0.07,0.19,0.97) both;
}

/* CTA button */
.bz-cta-btn {
  background: #E91E63;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
}
.bz-cta-btn:hover {
  background: #F0256E;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 4px 16px rgba(233,30,99,0.35);
}
.bz-cta-btn:active {
  background: #C2185B;
  box-shadow: none;
  transform: scale(0.99);
}
.bz-cta-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10);
}
.bz-cta-btn.bz-loading {
  background: #E91E63;
  cursor: not-allowed;
  pointer-events: none;
}
.bz-cta-btn.bz-success {
  background: #10B981;
  box-shadow: none;
  pointer-events: none;
  transition: background 300ms ease;
}

/* Mobile bottom sheet */
@media (max-width: 520px) {
  .bz-backdrop.bz-is-modal {
    align-items: flex-end;
    padding: 0;
  }
  .bz-is-modal .bz-modal-panel {
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
    transform: translateY(100%);
    opacity: 1;
    padding-bottom: env(safe-area-inset-bottom, 16px);
  }
  .bz-is-modal.bz-open .bz-modal-panel {
    transform: translateY(0);
    opacity: 1;
    transition: transform 280ms cubic-bezier(0.22,1,0.36,1);
  }
  .bz-is-modal.bz-closing .bz-modal-panel {
    transform: translateY(100%);
    transition: transform 200ms ease-in;
  }
}

/* Scrollbar inside modal */
.bz-modal-panel::-webkit-scrollbar { width: 4px; }
.bz-modal-panel::-webkit-scrollbar-track { background: transparent; }
.bz-modal-panel::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 4px; }
[data-theme="dark"] .bz-modal-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); }
