
/* لیست استوری‌ها (دایره‌های بالا) */
.stories-list {
    display: flex;
    gap: 15px;
    padding: 20px;
    overflow-x: auto;
    margin-bottom: 20px;
    max-width: 100%;
}

.stories-list::-webkit-scrollbar {
    height: 5px;
}

.stories-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.stories-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
    min-width: 80px;
}

.story-item:hover {
    transform: scale(1.05);
}

.story-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 1px solid transparent;
    background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    padding: 1px;
    position: relative;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-avatar img {
    width: calc(100% - 4px);
    height: calc(100% - 4px);
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    border: 1.5px solid #fff;
}

.story-avatar.has-story {
    border-color: #e1306c;
}

.story-avatar.viewed {
    border-color: #999;
    opacity: 0.7;
}

.story-username {
    margin-top: 8px;
    font-size: 12px;
    color: #262626;
    text-align: center;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* نمایش استوری (Full Screen) */
.story-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

/* نوار پیشرفت استوری‌ها */
.story-progress-container {
    display: flex;
    gap: 4px;
    padding: 10px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.progress-item {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

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

.progress-bar.active {
    animation: progress 5s linear forwards;
}

.progress-bar.completed {
    width: 100%;
}

@keyframes progress {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

/* هدر استوری */
.story-header {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.story-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fff;
    overflow: hidden;
    background: #fff;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.story-time {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    margin-right: 8px;
}

.btn-close {
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    backdrop-filter: blur(10px);
}

.btn-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* محتوای استوری */
.story-content {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* لودینگ دایره‌ای */
.story-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;
    display: none;
}

.story-loader.active {
    display: block;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.story-image-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.story-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.story-text-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 10;
    padding: 20px;
    max-width: 90%;
    word-wrap: break-word;
}

/* دکمه‌های کنترل */
.story-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    border: none;
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.story-nav-btn:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: translateY(-50%) scale(1.1);
}

.story-prev {
    right: 20px;
}

.story-next {
    left: 20px;
}

.story-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .stories-list {
        padding: 15px 10px;
        gap: 10px;
    }

    .story-avatar {
        width: 60px;
        height: 60px;
    }

    .story-username {
        font-size: 11px;
        max-width: 60px;
    }

    .story-text-overlay {
        font-size: 24px;
    }

    .story-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .story-prev {
        right: 10px;
    }

    .story-next {
        left: 10px;
    }
}

/* انیمیشن باز شدن استوری */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.story-viewer {
    animation: fadeIn 0.3s ease;
}

/* انیمیشن تغییر استوری */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.story-content img {
    animation: slideIn 0.3s ease;
}




