
/* =========================================================
   NEWSKUND FLOATING LIVE BUTTON
   Unique namespace: nk-live-widget-
   ========================================================= */

#nk-live-widget-root,
#nk-live-widget-root * {
    box-sizing: border-box;
}

#nk-live-widget-root {
    --nk-live-widget-size: 68px;
    --nk-live-widget-bottom: 150px;
    --nk-live-widget-color: #f13030;
    --nk-live-widget-text-color: #ffffff;

    position: fixed;
    bottom: var(--nk-live-widget-bottom);
    left: 14px;
    z-index: 999990;
    width: var(--nk-live-widget-size);
    height: var(--nk-live-widget-size);
    font-family: Arial, "Noto Sans Devanagari", sans-serif;
    isolation: isolate;
    -webkit-tap-highlight-color: transparent;
}

#nk-live-widget-root.nk-live-widget-side-right {
    left: auto;
    right: 14px;
}

#nk-live-widget-root.nk-live-widget-is-dragged {
    transition: none !important;
}

.nk-live-widget-drag-area {
    position: relative;
    width: 100%;
    height: 100%;
    touch-action: auto;
}

/* Main circular button */
#nk-live-widget-root .nk-live-widget-button {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    background: var(--nk-live-widget-color);
    color: var(--nk-live-widget-text-color);
    box-shadow:
        0 5px 14px rgba(0, 0, 0, 0.25),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    text-decoration: none;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
    cursor: pointer;
    z-index: 2;
    transform: translateZ(0);
    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        filter 180ms ease;
}

#nk-live-widget-root .nk-live-widget-button:hover {
    color: var(--nk-live-widget-text-color);
    text-decoration: none;
    transform: scale(1.06);
    filter: brightness(1.08);
    box-shadow:
        0 7px 20px rgba(0, 0, 0, 0.3),
        0 0 0 4px rgba(241, 48, 48, 0.12);
}

#nk-live-widget-root .nk-live-widget-button:focus-visible {
    outline: 3px solid #222;
    outline-offset: 4px;
}

#nk-live-widget-root .nk-live-widget-label {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
    pointer-events: none;
}

#nk-live-widget-root .nk-live-widget-live-dot {
    display: block;
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 7px rgba(255, 255, 255, 0.9);
    pointer-events: none;
}

/* Drag handle */
#nk-live-widget-root .nk-live-widget-drag-handle {
    width: 30px;
    height: 30px;
    top: 25px;
    left: 1px;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.55);;
    color: #333333;
    border: 1px solid #d5d5d5;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: move;
    z-index: 999;
}

/* Smaller logo on mobile */
@media (max-width: 600px) {
    #nk-live-widget-root .nk-live-widget-tv-icon {
        width: 19px;
        height: 19px;
        flex-basis: 19px;
    }
}

#nk-live-widget-root .nk-live-widget-tv-icon {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    margin: 0 auto;
}
#nk-live-widget-root .nk-live-widget-drag-handle svg {
    width: 100%;
    height: 100%;
    display: block;
    fill: currentColor;
}

#nk-live-widget-root .nk-live-widget-drag-handle:active {
    cursor: grabbing;
}

/* Animated ripple rings */
#nk-live-widget-root .nk-live-widget-ripple,
#nk-live-widget-root .nk-live-widget-ripple::before,
#nk-live-widget-root .nk-live-widget-ripple::after {
    position: absolute;
    inset: 0;
    border: 2px solid var(--nk-live-widget-color);
    border-radius: 50%;
    pointer-events: none;
}

#nk-live-widget-root .nk-live-widget-ripple {
    z-index: 0;
    opacity: 0;
}

#nk-live-widget-root[data-animation="ripple"] .nk-live-widget-ripple,
#nk-live-widget-root[data-animation="ripple"] .nk-live-widget-ripple::before,
#nk-live-widget-root[data-animation="ripple"] .nk-live-widget-ripple::after {
    animation: nk-live-widget-ripple 2.7s ease-out infinite;
}

#nk-live-widget-root[data-animation="ripple"] .nk-live-widget-ripple::before,
#nk-live-widget-root[data-animation="ripple"] .nk-live-widget-ripple::after {
    content: "";
}

#nk-live-widget-root[data-animation="ripple"] .nk-live-widget-ripple::before {
    animation-delay: 0.9s;
}

#nk-live-widget-root[data-animation="ripple"] .nk-live-widget-ripple::after {
    animation-delay: 1.8s;
}

@keyframes nk-live-widget-ripple {
    0% {
        transform: scale(1);
        opacity: 0.65;
    }
    100% {
        transform: scale(1.9);
        opacity: 0;
    }
}

/* Alternative: soft glow */
#nk-live-widget-root[data-animation="glow"] .nk-live-widget-button {
    animation: nk-live-widget-glow 1.8s ease-in-out infinite;
}

@keyframes nk-live-widget-glow {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow:
            0 4px 18px rgba(0, 0, 0, 0.25),
            0 0 0 9px rgba(241, 48, 48, 0.13),
            0 0 24px rgba(241, 48, 48, 0.4);
    }
}

/* Alternative: gentle bounce */
#nk-live-widget-root[data-animation="bounce"] .nk-live-widget-button {
    animation: nk-live-widget-bounce 2.4s ease-in-out infinite;
}

@keyframes nk-live-widget-bounce {
    0%, 85%, 100% {
        transform: translateY(0);
    }
    90% {
        transform: translateY(-5px);
    }
    95% {
        transform: translateY(0);
    }
}

/* Disable animation when requested */
#nk-live-widget-root[data-animation="none"] .nk-live-widget-ripple {
    display: none;
}

#nk-live-widget-root[data-animation="none"] .nk-live-widget-button {
    animation: none;
}

/* Mobile responsive behavior */
@media (max-width: 600px) {
    #nk-live-widget-root {
        left: 10px;
    }

    #nk-live-widget-root.nk-live-widget-side-right {
        left: auto;
        right: 10px;
    }

    #nk-live-widget-root .nk-live-widget-button {
        font-size: 10px;
        padding: 5px;
    }

    #nk-live-widget-root .nk-live-widget-drag-handle {
        width: 27px;
        height: 27px;
    }
}

/* Respect accessibility preferences */
@media (prefers-reduced-motion: reduce) {
    #nk-live-widget-root .nk-live-widget-button,
    #nk-live-widget-root .nk-live-widget-ripple,
    #nk-live-widget-root .nk-live-widget-ripple::before,
    #nk-live-widget-root .nk-live-widget-ripple::after {
        animation: none !important;
        transition: none !important;
    }
}
