/*!
 * Story Player Styles v3.0.0
 * Author: Amir Rezaie (https://amir-rezaie.ir)
 * License: MIT
 */

#stories-container {
    display: flex;
    gap: 15px;
    padding: 15px;
    overflow-x: auto;
}

#stories-container {
    overflow-x: auto;
    display: flex;
    gap: 1rem;
    padding: 1rem;
    cursor: grab;
    scroll-snap-type: none !important;
    user-select: none;
    -webkit-user-drag: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#stories-container img {
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none; /* جلوگیری از تداخل کلیک تصویر با درگ */
}

#stories-container:active {
    cursor: grabbing;
}

#stories-container::-webkit-scrollbar {
    height: 5px;
    display: none;
}

#stories-container:hover::-webkit-scrollbar {
    display: block;
}

#stories-container::-webkit-scrollbar-track {
    background: transparent;
}

#stories-container::-webkit-scrollbar-thumb {
    background: #10b981;
    border-radius: 10px;
}

.story {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.story-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(45deg, #ff6b6b, #ff3838);
    transition: background 0.3s;
}

.story-avatar.viewed {
    background: #ddd !important;
}

.story-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid white;
    object-fit: cover;
}

.story-username {
    margin-top: 5px;
    font-size: 12px;
    color: #333;
    white-space: nowrap;
}

.story-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
}

.progress-container {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: #4CAF50;
    border-radius: 2px;
    transition: width linear;
}

.story-content {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.media-container {
    position: relative;
    width: 100%;
    display: flex;
    height: 100%;
    align-items: center;
}

.story-media {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    display: none;
}

.video-media {
    display: none;
}

.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.3);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prev-button { right: 20px; }
.next-button { left: 20px; }

.close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.3);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-link {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    z-index: 1002;
}


.story-media, .video-media {
    width: 100%;
    height: 90%;
    object-fit: contain;
    display: block;
}
