.abediweb-story-wrapper {
    width: 100%;
    direction: rtl;
    position: relative;
    font-family: inherit;
}

.abediweb-story-bar {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 0 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.abediweb-story-bar::-webkit-scrollbar {
    display: none;
}

.abediweb-story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    flex: 0 0 auto;
    width: 90px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.abediweb-ring {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    padding: 3px;
    display: flex;
    box-sizing: border-box;
}

.abediweb-has-gradient .abediweb-ring {
    /* gradient is set via inline style from Elementor */
}

.abediweb-avatar {
    flex: 1;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    background: #f0f0f0;
    position: relative;
}

.abediweb-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    display: block;
}

.abediweb-story-label {
    font-size: 11px;
    line-height: 1.5;
    color: #333;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 72px;
    font-weight: 500;
}

.abediweb-viewer {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: #000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.abediweb-viewer.abediweb-viewer-open {
    display: flex;
    opacity: 1;
}

.abediweb-viewer-inner {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 420px;
    max-height: 100vh;
    overflow: hidden;
    background: #000;
}

@media (min-width: 768px) {
    .abediweb-viewer-inner {
        height: 90vh;
        border-radius: 16px;
    }
    .abediweb-viewer {
        background: rgba(0, 0, 0, 0.92);
    }
}

.abediweb-viewer-inner {
    box-sizing: border-box;
}

.abediweb-progress-bar {
    position: absolute;
    top: 8px;
    left: 12px;
    right: 12px;
    z-index: 25;
    display: flex;
    gap: 4px;
    direction: ltr;
}

.abediweb-progress-segment {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    overflow: hidden;
}

.abediweb-progress-fill {
    height: 100%;
    width: 0%;
    background: #fff;
    border-radius: 3px;
    transition: width 0.1s linear;
}

.abediweb-viewer-top {
    position: absolute;
    top: 18px;
    right: 12px;
    left: 12px;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: space-between;
    direction: rtl;
}

.abediweb-viewer-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.abediweb-viewer-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
}

.abediweb-viewer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.abediweb-viewer-username {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.abediweb-viewer-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    opacity: 0.8;
    transition: opacity 0.2s, background 0.2s;
    line-height: 1;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.abediweb-viewer-close:hover {
    opacity: 1;
}

.abediweb-slides-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.abediweb-slide {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
}

.abediweb-slide.abediweb-slide-active {
    display: flex;
}

.abediweb-slide-image {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.abediweb-slide-video {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.abediweb-slide-video video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.abediweb-slide-text {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px 40px;
    box-sizing: border-box;
    text-align: center;
}

.abediweb-slide[data-link] {
    cursor: pointer;
}

.abediweb-slide-text-inner {
    font-size: 22px;
    line-height: 1.6;
    font-weight: 600;
    max-width: 100%;
    word-break: break-word;
}

.abediweb-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 30;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    padding: 0;
}

.abediweb-viewer-inner:hover .abediweb-nav-btn {
    opacity: 1;
}

.abediweb-nav-btn:hover {
    background: rgba(0, 0, 0, 0.5);
}

.abediweb-nav-prev {
    right: 8px;
}

.abediweb-nav-next {
    left: 8px;
}

.abediweb-tap-areas {
    position: absolute;
    inset: 0;
    z-index: 15;
    display: flex;
}

.abediweb-tap-left,
.abediweb-tap-center,
.abediweb-tap-right {
    flex: 1;
    cursor: pointer;
}

.abediweb-story-bar-wrapper {
    position: relative;
}

.abediweb-scroll-left {
    position: absolute;
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    background: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
    font-size: 22px;
    width: 32px;
    height: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    padding: 0;
    line-height: 1;
}

.abediweb-story-bar-wrapper:hover .abediweb-scroll-left {
    opacity: 1;
}

.abediweb-scroll-left:hover {
    transform: translateY(-50%) scale(1.1);
}

.abediweb-scroll-visible {
    opacity: 1 !important;
}

.abediweb-scroll-left img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none;
}

@media (max-width:480px){

    .abediweb-story-item {
        width:90px;
    }

    .abediweb-ring {
        width:90px;
        height:90px;
        padding:2px;
    }

    .abediweb-story-label {
        font-size:10px;
        max-width:60px;
    }

    .abediweb-story-bar {
        gap:12px;
        padding:2px 0 6px;
    }


    /* Viewer Popup حرفه‌ای موبایل */

    .abediweb-viewer {
        padding:
        calc(12px + env(safe-area-inset-top))
        12px
        calc(12px + env(safe-area-inset-bottom));

        box-sizing:border-box;
    }


    .abediweb-viewer-inner {

        width:100%;
        height:auto;

        aspect-ratio:9 / 16;

        max-height:85vh;

        border-radius:20px;

    }


    .abediweb-progress-bar {

        top:14px;
        left:12px;
        right:12px;

    }


    .abediweb-viewer-top {

        top:38px;
        left:12px;
        right:12px;

    }


    .abediweb-slide-text-inner {
        font-size:18px;
    }

}



.abediweb-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
}

.abediweb-link-btn-wrapper {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    text-align: center;
    pointer-events: auto;
}

.abediweb-link-btn {
    display: inline-block;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, transform 0.15s;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

.abediweb-link-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}
