/* Stories Thumbnail Section */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.story-item .rounded-full {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stories Scroll Snap */
.stories-wrapper {
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.story-item {
    scroll-snap-align: start;
}

/* Modal Overlay - Force Full Screen and Black */
#storyViewer {
    background: #000 !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999 !important;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#storyViewer.active {
    display: flex !important;
    opacity: 1 !important;
}

/* Image Container */
.story-container {
    width: 100%;
    height: 100%;
    max-width: 450px;
    max-height: 85vh;
    position: relative;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .story-container {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}

#storyImage {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

/* Progress Bars */
#storyProgress {
    display: flex;
    gap: 4px;
    padding: 10px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.progress-segment {
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    flex: 1;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #fff;
    width: 0%;
}

/* Header & Controls */
.story-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 30px 20px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 101;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent);
    color: #fff;
}

#storyAuthorAvatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Story Footer */
.story-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    text-align: center;
    color: #fff;
    z-index: 100;
}

#storyClose {
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

#storyClose:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

#deskPrev,
#deskNext {
    display: none !important;
}

@media (min-width: 1024px) {

    #deskPrev,
    #deskNext {
        display: flex !important;
        position: fixed;
        top: 50%;
        transform: translateY(-50%);
        width: 50px;
        height: 50px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        color: #fff;
        z-index: 100000;
        transition: all 0.3s ease;
        cursor: pointer;
        backdrop-filter: blur(5px);
    }

    #deskPrev:hover,
    #deskNext:hover {
        background: rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.4);
        transform: translateY(-50%) scale(1.1);
    }

    #deskPrev {
        left: 40px;
    }

    #deskNext {
        right: 40px;
    }
}

/* Touch Navigation Overlays - Ensure they are invisible */
#storyPrev,
#storyNext {
    background: transparent !important;
    -webkit-tap-highlight-color: transparent;
}

.story-ring {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    padding: 3px;
    /* سُمك الحلقة */
    background: conic-gradient(#ff6a00,
            #ff0057,
            #ff6a00);
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-ring img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: #000;
}