/* استوری تخفیف VIP — رینگ بنفش-طلایی، تگ آویز، افکت ۴ ثانیه‌ای */

.story-avatar-wrap {
    position: relative;
    width: fit-content;
    margin: 0 auto 6px;
    overflow: visible;
}

.story-avatar-wrap--offer {
    /* تگ کنار رینگ — بدون فضای اضافه زیر نام */
}

.story-item .story-avatar-wrap--offer,
.story-chip .story-avatar-wrap--offer {
    overflow: visible;
}

/* ── تگ VIP — آویزان از پایین رینگ (نه کنارش) ── */
.story-offer-ring-badge {
    position: absolute;
    top: auto;
    left: 50%;
    bottom: 1px;
    z-index: 6;
    width: 0;
    height: 0;
    pointer-events: none;
}

.story-offer-ring-badge__pin {
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    transform: translate(-50%, -40%);
    background: radial-gradient(circle at 35% 30%, #fff 0%, #e8d5a8 35%, #29483d 100%);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.65),
        0 0 8px rgba(201, 164, 94, 0.75);
}

.story-offer-ring-badge__swing {
    position: absolute;
    top: 3px;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translate(-50%, 0) rotate(-2deg);
    transform-origin: 50% 0;
    filter: drop-shadow(0 5px 12px rgba(23, 56, 47, 0.28));
    animation: bn-offer-pendulum 2.6s ease-in-out infinite;
}

.story-offer-ring-badge__thread {
    display: block;
    flex-shrink: 0;
    width: 1.5px;
    height: 10px;
    border-radius: 999px;
    transform-origin: 50% 0;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(232, 213, 168, 0.98) 42%,
        rgba(41, 72, 61, 0.95) 100%
    );
    box-shadow: 0 0 6px rgba(201, 164, 94, 0.5);
    animation: bn-offer-thread-stretch 2.6s ease-in-out infinite;
}

.story-offer-ring-badge__tag {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.18rem;
    margin-top: 1px;
    padding: 0.14rem 0.42rem 0.15rem;
    border-radius: 999px;
    font-size: 0.5rem;
    font-weight: 900;
    letter-spacing: 0.03em;
    color: #fff;
    white-space: nowrap;
    line-height: 1;
    transform: rotate(2deg);
    transform-origin: 50% 0;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.3) 0%, transparent 45%),
        linear-gradient(135deg, #17382f 0%, #29483d 40%, #c5a46d 72%, #e4d4b2 100%);
    border: 1px solid rgba(255, 255, 255, 0.78);
    box-shadow:
        0 6px 16px rgba(23, 56, 47, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
    animation: bn-offer-tag-sway 2.6s ease-in-out infinite;
}

.story-offer-ring-badge__tag i {
    font-size: 0.44rem;
    color: #fde68a;
    filter: drop-shadow(0 0 4px rgba(253, 230, 138, 0.7));
}

.story-offer-ring-badge__tag::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.65), rgba(201, 164, 94, 0.35), rgba(197, 164, 109, 0.45));
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

@keyframes bn-offer-pendulum {
    0%, 100% {
        transform: translate(-50%, 0) rotate(-4deg);
    }
    50% {
        transform: translate(-50%, 1px) rotate(4deg);
    }
}

@keyframes bn-offer-thread-stretch {
    0%, 100% {
        transform: scaleY(1);
    }
    35% {
        transform: scaleY(1.22);
    }
    65% {
        transform: scaleY(0.86);
    }
}

@keyframes bn-offer-tag-sway {
    0%, 100% {
        transform: rotate(2deg) translateY(0);
    }
    40% {
        transform: rotate(4deg) translateY(2px);
    }
    70% {
        transform: rotate(0deg) translateY(-1px);
    }
}

/* پروفایل — همان آویز از پایین رینگ، کمی جمع‌تر */
.profile-stories-rail .story-offer-ring-badge__swing,
.bn-profile-stories .story-offer-ring-badge__swing {
    transform: translate(-50%, 0) rotate(-2deg);
    animation-name: bn-offer-pendulum-profile;
}

.profile-stories-rail .story-offer-ring-badge__tag,
.bn-profile-stories .story-offer-ring-badge__tag {
    font-size: 0.44rem;
    padding: 0.1rem 0.32rem 0.11rem;
}

@keyframes bn-offer-pendulum-profile {
    0%, 100% {
        transform: translate(-50%, 0) rotate(-4deg);
    }
    50% {
        transform: translate(-50%, 1px) rotate(3deg);
    }
}

.story-item:has(.story-avatar-wrap--offer) .story-username,
.story-chip:has(.story-avatar-wrap--offer) .story-username {
    margin-top: 0;
}

@media (prefers-reduced-motion: reduce) {
    .story-offer-ring-badge__swing,
    .story-offer-ring-badge__thread,
    .story-offer-ring-badge__tag {
        animation: none !important;
        will-change: auto;
    }
}

/* ── رینگ استوری تخفیف ── */
.story-avatar.story-offer-unviewed {
    background: conic-gradient(
        from 210deg,
        #2563eb,
        #17382f,
        #29483d,
        #e4d4b2,
        #c9a46e,
        #17382f,
        #2563eb
    );
    padding: 3px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.38),
        0 0 18px rgba(197, 164, 109, 0.32),
        0 12px 28px rgba(23, 56, 47, 0.30);
    animation: bn-offer-ring-pulse 3.2s ease-in-out infinite;
}

.story-avatar.story-offer-viewed {
    background: linear-gradient(135deg, rgba(41, 72, 61, 0.45), rgba(197, 164, 109, 0.35));
    padding: 2px;
    opacity: 0.88;
}

@keyframes bn-offer-ring-pulse {
    0%, 100% { filter: hue-rotate(0deg) brightness(1); }
    50% { filter: hue-rotate(12deg) brightness(1.06); }
}

/* ── ویوور — بدون تیره‌کردن اضافه ── */
.story-viewer--offer {
    background: #000;
}

.story-viewer--offer .story-seg.active::after {
    background: linear-gradient(90deg, #c9a46e, #29483d, #17382f);
}

.story-viewer--offer .story-viewer-media {
    position: relative;
}

.story-viewer--offer .story-viewer-media img,
.story-viewer--offer .story-viewer-media video {
    position: relative;
    z-index: 0;
}

/* ── افکت ۴ ثانیه‌ای تخفیف (بدون dim کل صفحه) ── */
.story-offer-splash {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 5vw, 2rem);
    opacity: 0;
    visibility: hidden;
}

.story-offer-splash.is-visible {
    visibility: visible;
    animation: bn-offer-splash-enter 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.story-offer-splash.is-exiting {
    animation: bn-offer-splash-exit 0.65s cubic-bezier(0.55, 0, 0.85, 0.36) forwards;
}

@keyframes bn-offer-splash-enter {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bn-offer-splash-exit {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(1.04);
    }
}

.story-offer-splash__halo {
    position: absolute;
    width: min(88vw, 340px);
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(201, 164, 94, 0.22) 0%, transparent 58%),
        radial-gradient(circle, rgba(197, 164, 109, 0.28) 0%, transparent 70%);
    animation: bn-offer-halo-breathe 2.4s ease-in-out infinite;
}

@keyframes bn-offer-halo-breathe {
    0%, 100% { transform: scale(0.96); opacity: 0.75; }
    50% { transform: scale(1.06); opacity: 1; }
}

.story-offer-splash__burst {
    position: absolute;
    width: min(92vw, 360px);
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    opacity: 0;
    animation: bn-offer-burst 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.08s forwards;
}

@keyframes bn-offer-burst {
    0% {
        transform: scale(0.55);
        opacity: 0.85;
        border-color: rgba(201, 164, 94, 0.65);
    }
    100% {
        transform: scale(1.35);
        opacity: 0;
        border-color: rgba(197, 164, 109, 0);
    }
}

.story-offer-splash__particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.story-offer-splash__particles span {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fde68a, #e4d4b2);
    box-shadow: 0 0 10px rgba(253, 230, 138, 0.75);
    animation: bn-offer-particle 3.2s ease-in-out infinite;
}

.story-offer-splash__particles span:nth-child(1) { top: 22%; left: 18%; animation-delay: 0s; }
.story-offer-splash__particles span:nth-child(2) { top: 30%; right: 14%; animation-delay: 0.45s; }
.story-offer-splash__particles span:nth-child(3) { top: 48%; left: 10%; animation-delay: 0.9s; }
.story-offer-splash__particles span:nth-child(4) { top: 58%; right: 22%; animation-delay: 1.35s; }
.story-offer-splash__particles span:nth-child(5) { top: 38%; left: 42%; animation-delay: 1.8s; }
.story-offer-splash__particles span:nth-child(6) { top: 62%; left: 36%; animation-delay: 2.1s; }

@keyframes bn-offer-particle {
    0%, 100% { opacity: 0.15; transform: translateY(0) scale(0.6); }
    50% { opacity: 1; transform: translateY(-8px) scale(1.15); }
}

.story-offer-splash__card {
    position: relative;
    width: min(92vw, 320px);
    padding: clamp(1.35rem, 4.5vw, 1.85rem) clamp(1.25rem, 4vw, 1.65rem);
    border-radius: 28px;
    text-align: center;
    color: #fff;
    background:
        linear-gradient(155deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0.06) 38%, rgba(255, 255, 255, 0.02) 100%),
        linear-gradient(135deg, rgba(79, 70, 229, 0.42) 0%, rgba(124, 58, 237, 0.38) 45%, rgba(168, 85, 247, 0.28) 100%);
    backdrop-filter: blur(20px) saturate(165%);
    -webkit-backdrop-filter: blur(20px) saturate(165%);
    border: 1px solid rgba(255, 255, 255, 0.42);
    box-shadow:
        0 28px 90px rgba(49, 46, 129, 0.42),
        0 0 0 1px rgba(201, 164, 94, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.38);
    overflow: hidden;
    transform: translateY(8px);
    animation: bn-offer-card-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

@keyframes bn-offer-card-rise {
    from { transform: translateY(24px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.story-offer-splash__shimmer {
    position: absolute;
    inset: -40% -60%;
    background: linear-gradient(
        105deg,
        transparent 42%,
        rgba(255, 255, 255, 0.28) 50%,
        transparent 58%
    );
    transform: translateX(-120%) rotate(12deg);
    animation: bn-offer-shimmer 2.8s ease-in-out 0.4s infinite;
    pointer-events: none;
}

@keyframes bn-offer-shimmer {
    0% { transform: translateX(-120%) rotate(12deg); }
    45%, 100% { transform: translateX(120%) rotate(12deg); }
}

.story-offer-splash__ribbon {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
    padding: 0.28rem 0.72rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff7ed;
    background: linear-gradient(135deg, rgba(201, 164, 94, 0.95), rgba(180, 130, 70, 0.88));
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 8px 22px rgba(201, 164, 94, 0.38);
}

.story-offer-splash__ribbon i {
    font-size: 0.62rem;
    color: #fff;
}

.story-offer-splash__percent-wrap {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0.12rem;
    margin: 0 0 0.35rem;
    line-height: 1;
}

.story-offer-splash__percent {
    font-size: clamp(3rem, 14vw, 4.2rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    background: linear-gradient(180deg, #fff 0%, #ede9fe 38%, #fde68a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 6px 24px rgba(197, 164, 109, 0.45));
    animation: bn-offer-percent-pop 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

.story-offer-splash__pct-sign {
    font-size: clamp(1.2rem, 5vw, 1.55rem);
    font-weight: 900;
    color: #fde68a;
    margin-top: 0.35rem;
}

@keyframes bn-offer-percent-pop {
    from { transform: scale(0.72); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.story-offer-splash__title {
    margin: 0 0 0.35rem;
    font-size: clamp(1rem, 4.2vw, 1.2rem);
    font-weight: 800;
    color: #faf5ff;
    line-height: 1.35;
}

.story-offer-splash__desc {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(237, 233, 254, 0.92);
    line-height: 1.6;
}

.story-offer-splash__price {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: baseline;
    justify-content: center;
    font-size: 0.84rem;
    color: #ddd6fe;
}

.story-offer-splash__price del {
    opacity: 0.62;
}

.story-offer-splash__price strong {
    color: #bbf7d0;
    font-size: 1.02rem;
    font-weight: 900;
}

.story-offer-splash__valid {
    margin-top: 0.55rem;
    font-size: 0.72rem;
    color: rgba(253, 230, 138, 0.88);
    font-weight: 700;
}

/* ── استودیو پزشک ── */
.dp-story-studio--offer .modal-header h3 {
    background: linear-gradient(135deg, #17382f, #c5a46d);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.dp-story-mode-tabs {
    display: flex;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

.dp-story-mode-tab {
    flex: 1;
    border: 1px solid var(--bn-border, rgba(148, 163, 184, 0.35));
    border-radius: 999px;
    padding: 0.45rem 0.65rem;
    background: transparent;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--bn-text-2);
}

.dp-story-mode-tab.is-active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #17382f, #c5a46d);
    box-shadow: 0 8px 20px rgba(23, 56, 47, 0.22);
}

.dp-story-mode-tab--offer:not(.is-active) {
    border-color: rgba(23, 56, 47, 0.28);
    color: #17382f;
}

.dp-story-offer-preview-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.28rem 0.58rem;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #17382f, #c5a46d, #c9a46e);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 8px 20px rgba(23, 56, 47, 0.28);
}

.dp-story-studio__preview {
    position: relative;
}

.dp-story-duration-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dp-story-duration-row input[type="range"] {
    flex: 1;
}

.dp-story-duration-value {
    min-width: 3.2rem;
    font-weight: 800;
    color: #17382f;
    text-align: center;
}

.profile-story-chip--offer .story-avatar {
    animation: bn-offer-ring-pulse 3.2s ease-in-out infinite;
}

/* Premium polish: quieter continuous FX; respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .story-offer-ring-badge *,
    .story-offer-splash *,
    .profile-story-chip--offer .story-avatar,
    [class*="bn-offer-"] {
        animation: none !important;
        transition: none !important;
    }
}
@supports (animation-timeline: auto) {
    .story-offer-ring-badge__tag,
    .story-offer-halo,
    .story-offer-particle {
        animation-duration: 4.8s;
    }
}

