/* ==========================================================================
   Token Theme - public website promo (Views/Shared/_TokenPromo.cshtml)
   Floating "Pay with NE Token" widget, bottom right, in the website colours
   (green #76bf59 / #3fa53b / #0c2e03). Stand-alone: every class starts with
   "ntp-" and nothing here touches the site's own elements.
   ========================================================================== */

/* top right, a little below the site header (~140px) and the banner's corner icon; the card opens below the coin */
.ntp {
    position: fixed;
    top: 215px;
    right: 24px;
    z-index: 9998;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 14px;
    font-family: inherit;
    line-height: 1.4;
}

/* ---------- Coin button ---------- */

.ntp-fab-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.ntp-fab {
    position: relative;
    width: 66px;
    height: 66px;
    padding: 7px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 10px 28px rgba(12, 46, 3, .22), 0 0 0 0 rgba(63, 165, 59, .5);
    cursor: pointer;
    /* buzz every few seconds + a soft green glow that breathes */
    animation: ntp-buzz 5s ease-in-out 1.5s infinite, ntp-glow 2.4s ease-in-out infinite;
}

    /* two ripples spreading out of the circle, one after the other */
    .ntp-fab::before,
    .ntp-fab::after {
        content: "";
        position: absolute;
        inset: -3px;
        border-radius: 50%;
        border: 2px solid rgba(63, 165, 59, .6);
        animation: ntp-ring 2.4s ease-out infinite;
        pointer-events: none;
    }

    .ntp-fab::after {
        border-color: rgba(247, 181, 0, .6);
        animation-delay: 1.2s;
    }

    .ntp-fab:hover {
        animation-play-state: paused;
        transform: translateY(-2px) scale(1.06);
    }

    .ntp-fab:focus-visible {
        outline: 3px solid #3fa53b;
        outline-offset: 5px;
    }

/* spinning green / gold border running round the circle */
.ntp-fab-spin {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #76bf59, #3fa53b, #f7b500, #ffe58a, #76bf59);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
    animation: ntp-spin 2.6s linear infinite;
}

.ntp-fab-coin {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 50%;
}

    .ntp-fab-coin img {
        display: block;
        width: 100%;
        height: 100%;
        animation: ntp-wobble 3s ease-in-out infinite;
    }

/* light sweeping across the coin */
.ntp-fab-glint {
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .85) 50%, transparent 65%);
    transform: translateX(-120%);
    animation: ntp-glint 3.2s ease-in-out .8s infinite;
}

/* "Token Pay NEW" pill sliding out next to the coin while the card is closed */
.ntp-fab-label {
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    padding: 7px 12px;
    border-radius: 999px;
    background: #0c2e03;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(12, 46, 3, .25);
    opacity: 0;
    transform: translate(10px, -50%);
    pointer-events: none;
    animation: ntp-label 7s ease-in-out 3s infinite;
}

    .ntp-fab-label b {
        margin-left: 4px;
        padding: 1px 7px;
        border-radius: 999px;
        background: #3fa53b;
        font-size: 10px;
        letter-spacing: .06em;
        text-transform: uppercase;
    }

    .ntp-fab-label::after {
        content: "";
        position: absolute;
        right: -5px;
        top: 50%;
        width: 10px;
        height: 10px;
        margin-top: -5px;
        background: #0c2e03;
        transform: rotate(45deg);
    }

.ntp.is-open .ntp-fab-label {
    display: none;
}

.ntp-fab-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #3fa53b;
}

.ntp-fab-dot {
    animation: ntp-pulse 1.6s ease-out infinite;
}

.ntp.is-open .ntp-fab-dot {
    display: none;
}

/* while the card is open the button stays calm */
.ntp.is-open .ntp-fab {
    animation: none;
}

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

.ntp-card {
    position: relative;
    width: 300px;
    padding: 18px 18px 16px;
    border: 1px solid rgba(12, 46, 3, .08);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(12, 46, 3, .2);
    color: #212121;
    animation: ntp-in .55s cubic-bezier(.2, 1.4, .4, 1);
}

    .ntp-card::before {
        content: "";
        position: absolute;
        inset: 0 0 auto 0;
        height: 5px;
        border-radius: 18px 18px 0 0;
        background: linear-gradient(90deg, #76bf59, #3fa53b, #f7b500);
    }

.ntp-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #6b7280;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

    .ntp-close:hover {
        background: #f2f7f0;
        color: #212121;
    }

    .ntp-close:focus-visible {
        outline: 2px solid #3fa53b;
    }

.ntp-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 26px 10px 0;
}

.ntp-coin {
    flex: none;
    width: 48px;
    height: 48px;
    animation: ntp-wobble 4s ease-in-out infinite;
}

.ntp-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    background: #e3f4df;
    color: #1d6b1a;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    animation: ntp-badge 1.6s ease-in-out infinite;
}

.ntp-head h3 {
    margin: 4px 0 0;
    color: #0c2e03;
    font-size: 18px;
    font-weight: 800;
}

.ntp-text {
    margin: 0 0 12px;
    color: #4a5568;
    font-size: 14px;
}

.ntp-rate {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 8px 12px;
    border: 1px solid rgba(63, 165, 59, .3);
    border-radius: 12px;
    background: rgba(63, 165, 59, .07);
    color: #212121;
    font-size: 14px;
}

    .ntp-rate strong {
        color: #1d6b1a;
        font-size: 16px;
    }

.ntp-live {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3fa53b;
    animation: ntp-pulse 1.8s ease-out infinite;
}

.ntp-btn,
.ntp-btn:visited {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #76bf59 0%, #3fa53b 55%, #2a8a2a 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(63, 165, 59, .3);
}

    .ntp-btn:hover,
    .ntp-btn:focus {
        color: #fff;
        text-decoration: none;
        filter: brightness(1.05);
    }

    .ntp-btn svg {
        width: 18px;
        height: 18px;
    }

/* ---------- Motion ---------- */

@keyframes ntp-in {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(.97);
    }
}

@keyframes ntp-ring {
    0% {
        transform: scale(.95);
        opacity: 1;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

@keyframes ntp-spin {
    to {
        transform: rotate(360deg);
    }
}

/* short buzz, then rest for the remaining time */
@keyframes ntp-buzz {
    0%, 14%, 100% {
        transform: rotate(0) scale(1);
    }

    2% {
        transform: rotate(-14deg) scale(1.08);
    }

    4% {
        transform: rotate(12deg) scale(1.08);
    }

    6% {
        transform: rotate(-10deg) scale(1.08);
    }

    8% {
        transform: rotate(8deg) scale(1.06);
    }

    10% {
        transform: rotate(-4deg) scale(1.03);
    }

    12% {
        transform: rotate(2deg) scale(1);
    }
}

@keyframes ntp-glow {
    0%, 100% {
        box-shadow: 0 10px 28px rgba(12, 46, 3, .22), 0 0 0 0 rgba(63, 165, 59, .35);
    }

    50% {
        box-shadow: 0 10px 28px rgba(12, 46, 3, .22), 0 0 22px 6px rgba(63, 165, 59, .35);
    }
}

@keyframes ntp-glint {
    0%, 60%, 100% {
        transform: translateX(-120%);
    }

    40% {
        transform: translateX(120%);
    }
}

/* label: slide in, stay, slide out, then wait */
@keyframes ntp-label {
    0%, 70%, 100% {
        opacity: 0;
        transform: translate(10px, -50%);
    }

    8%, 60% {
        opacity: 1;
        transform: translate(0, -50%);
    }
}

@keyframes ntp-badge {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.12);
    }
}

/* tilt without flipping, the leaf would mirror */
@keyframes ntp-wobble {
    0%, 100% {
        transform: rotateY(0) rotate(0);
    }

    50% {
        transform: rotateY(25deg) rotate(-6deg);
    }
}

@keyframes ntp-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(63, 165, 59, .55);
    }

    70%, 100% {
        box-shadow: 0 0 0 7px rgba(63, 165, 59, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ntp-fab,
    .ntp-fab::before,
    .ntp-fab::after,
    .ntp-fab-spin,
    .ntp-fab-coin img,
    .ntp-fab-glint,
    .ntp-fab-dot,
    .ntp-badge,
    .ntp-coin,
    .ntp-card,
    .ntp-live {
        animation: none;
    }

    /* without motion the label simply stays visible next to the coin */
    .ntp-fab-label {
        animation: none;
        opacity: 1;
        transform: translate(0, -50%);
    }
}

/* phones: the header is shorter */
@media (max-width: 767px) {
    .ntp {
        top: 190px;
        right: 14px;
    }

    .ntp-fab {
        width: 58px;
        height: 58px;
        padding: 6px;
    }

    .ntp-fab-label {
        font-size: 12px;
    }

    .ntp-card {
        width: min(300px, calc(100vw - 28px));
    }
}
