/* ============================================================
   MAGIC UI HERO — Animated components for Transfer Express
   Inspired by Magic UI / shadcn/ui, adapted to vanilla CSS
   Load BEFORE dark-mode-fixes.css
   ============================================================ */

/* --- 1. ANIMATED GRID PATTERN (background layer) --- */
.hero-magic {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.hero-grid-pattern {
    pointer-events: none;
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 80%);
    animation: gridPulse 8s ease-in-out infinite;
}

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

/* --- 2. FLOATING ORBS (ambient particles) --- */
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    z-index: 1;
    will-change: transform;
}

.hero-orb--1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #1565c0, transparent 70%);
    top: -15%;
    right: -10%;
    animation: orbFloat1 14s ease-in-out infinite;
}

.hero-orb--2 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #c9a84c, transparent 70%);
    bottom: -10%;
    left: -5%;
    animation: orbFloat2 18s ease-in-out infinite;
}

.hero-orb--3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, #26a69a, transparent 70%);
    top: 30%;
    left: 60%;
    animation: orbFloat3 12s ease-in-out infinite;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-40px, 30px) scale(1.1); }
    66% { transform: translate(20px, -20px) scale(0.95); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -40px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

@keyframes orbFloat3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-30px, -30px) scale(1.15); }
}

/* --- 3. METEOR LINES --- */
.hero-meteors {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.meteor {
    position: absolute;
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, rgba(201,168,76,0.6), transparent);
    border-radius: 9999px;
    transform: rotate(-35deg);
    opacity: 0;
    animation: meteorShoot var(--meteor-duration, 4s) var(--meteor-delay, 0s) infinite;
}

.meteor::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    width: 6px;
    height: 3px;
    background: #c9a84c;
    border-radius: 50%;
    box-shadow: 0 0 8px 2px rgba(201,168,76,0.4);
}

@keyframes meteorShoot {
    0% {
        opacity: 0;
        transform: rotate(-35deg) translateX(0);
    }
    5% {
        opacity: 1;
    }
    30% {
        opacity: 0;
        transform: rotate(-35deg) translateX(600px);
    }
    100% {
        opacity: 0;
        transform: rotate(-35deg) translateX(600px);
    }
}

/* --- 4. BORDER BEAM (eyebrow badge) --- */
.hero-eyebrow-magic {
    position: relative;
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--color-gold-accent);
    margin-bottom: 1.8rem;
    padding: 0.6rem 2rem;
    background: rgba(201, 168, 76, 0.06);
    border-radius: var(--radius-full);
    overflow: hidden;
    z-index: 2;
}

.hero-eyebrow-magic::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: conic-gradient(
        from var(--beam-angle, 0deg),
        transparent 0%,
        transparent 75%,
        #c9a84c 85%,
        #ffd54f 95%,
        transparent 100%
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: borderBeam 4s linear infinite;
}

@keyframes borderBeam {
    0%   { --beam-angle: 0deg; }
    100% { --beam-angle: 360deg; }
}

/* Fallback: @property for animated CSS custom property */
@property --beam-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* --- 5. TEXT BLUR REVEAL --- */
.text-blur-reveal {
    opacity: 0;
    filter: blur(12px);
    transform: translateY(20px);
    animation: textBlurIn 0.9s var(--reveal-delay, 0s) cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes textBlurIn {
    0% {
        opacity: 0;
        filter: blur(12px);
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        filter: blur(0px);
        transform: translateY(0);
    }
}

/* --- 6. WORD-BY-WORD REVEAL for H1 --- */
.hero-word {
    display: inline-block;
    opacity: 0;
    filter: blur(10px);
    transform: translateY(16px);
    animation: wordReveal 0.7s var(--word-delay, 0s) cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes wordReveal {
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

/* --- 7. SHIMMER BUTTON --- */
.btn-shimmer {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.25),
        transparent
    );
    transform: skewX(-20deg);
    animation: btnShimmer 3s 2s infinite;
}

@keyframes btnShimmer {
    0%   { left: -100%; }
    40%  { left: 150%; }
    100% { left: 150%; }
}

/* --- 8. RIPPLE BACKGROUND (CTA area) --- */
.hero-cta-magic {
    display: flex;
    gap: 1.2rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 2.8rem;
    position: relative;
    z-index: 2;
}

/* --- 9. NUMBER TICKER --- */
.ticker-value {
    display: inline-block;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    position: relative;
}

.ticker-digit {
    display: inline-block;
    transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.ticker-suffix {
    display: inline-block;
}

/* --- 10. TRUST BAR MAGIC (glassmorphism + stagger) --- */
.hero-trust-magic {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: 3.5rem;
    padding: 1.4rem 2.8rem;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(20px);
    animation: trustBarReveal 0.8s 1.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Inner glow line at top */
.hero-trust-magic::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201,168,76,0.4), transparent);
}

@keyframes trustBarReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.trust-magic-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 2.2rem;
    opacity: 0;
    animation: trustItemIn 0.6s var(--trust-delay, 1.8s) cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes trustItemIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.trust-magic-item strong {
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
    letter-spacing: -0.02em;
}

.trust-magic-item span {
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-top: 0.3rem;
}

.trust-magic-divider {
    width: 1px;
    height: 36px;
    background: linear-gradient(180deg, transparent, rgba(201,168,76,0.3), transparent);
    flex-shrink: 0;
}

/* --- 11. LIVE INDICATOR (pulsing dot) --- */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.8rem;
    opacity: 0;
    animation: textBlurIn 0.6s 0.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    z-index: 2;
    position: relative;
}

.live-dot {
    width: 7px;
    height: 7px;
    background: #4caf50;
    border-radius: 50%;
    position: relative;
}

.live-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1.5px solid rgba(76, 175, 80, 0.5);
    animation: livePulse 2s ease-out infinite;
}

@keyframes livePulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* --- 12. H1 STYLING ENHANCEMENT --- */
.hero-magic h1 {
    position: relative;
    z-index: 2;
    line-height: 1.08;
    margin-bottom: 1.6rem;
}

.hero-h1-accent .hero-word {
    background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 40%, #c9a84c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- 13. SUBTITLE MAGIC --- */
.hero-subtitle-magic {
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
}

.hero-subtitle-magic .sep {
    width: 4px;
    height: 4px;
    background: var(--color-gold-accent);
    border-radius: 50%;
    flex-shrink: 0;
    opacity: 0.6;
}

/* --- 14. CTA BUTTONS PREMIUM --- */
.btn-magic-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 210px;
    padding: 1rem 2.2rem;
    font-family: var(--font-primary, 'Poppins', sans-serif);
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #ff6f00, #ff8f00);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
    box-shadow: 0 4px 24px rgba(255, 111, 0, 0.35), inset 0 1px 0 rgba(255,255,255,0.15);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-magic-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 32px rgba(255, 111, 0, 0.45), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-magic-primary:active {
    transform: translateY(-1px) scale(0.99);
}

.btn-badge-magic {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    background: rgba(255,255,255,0.2);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    margin-left: 0.3rem;
}

.btn-magic-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-width: 200px;
    padding: 1rem 2.2rem;
    font-family: var(--font-primary, 'Poppins', sans-serif);
    font-size: 1rem;
    font-weight: 500;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    cursor: pointer;
    text-decoration: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-magic-outline:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.btn-magic-outline svg {
    width: 18px;
    height: 18px;
    fill: #25D366;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .hero-grid-pattern {
        background-size: 40px 40px;
    }

    .hero-orb--1 { width: 280px; height: 280px; }
    .hero-orb--2 { width: 200px; height: 200px; }
    .hero-orb--3 { display: none; }

    .hero-meteors { display: none; }

    .hero-eyebrow-magic {
        font-size: 0.65rem;
        padding: 0.5rem 1.2rem;
        letter-spacing: 0.2em;
    }

    .hero-subtitle-magic {
        font-size: 0.85rem;
        gap: 0.5rem;
    }

    .hero-cta-magic {
        flex-direction: column;
        margin-top: 2rem;
    }

    .btn-magic-primary,
    .btn-magic-outline {
        min-width: 260px;
    }

    .hero-trust-magic {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem 1.8rem;
        border-radius: var(--radius-xl);
        margin-top: 2.5rem;
    }

    .trust-magic-item {
        padding: 0.3rem 0;
        flex-direction: row;
        gap: 0.6rem;
    }

    .trust-magic-divider {
        width: 60%;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(201,168,76,0.2), transparent);
    }

    .trust-magic-item span {
        margin-top: 0;
    }
}

@media (max-width: 480px) {
    .hero-eyebrow-magic {
        font-size: 0.58rem;
        padding: 0.4rem 1rem;
    }

    .btn-magic-primary,
    .btn-magic-outline {
        min-width: 100%;
        font-size: 0.95rem;
    }
}

/* --- REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
    .hero-grid-pattern,
    .hero-orb,
    .meteor,
    .hero-eyebrow-magic::before,
    .btn-shimmer::after,
    .live-dot::after {
        animation: none !important;
    }

    .text-blur-reveal,
    .hero-word,
    .hero-trust-magic,
    .trust-magic-item {
        opacity: 1 !important;
        filter: none !important;
        transform: none !important;
        animation: none !important;
    }
}
