/*!
 * Story Player Styles v2.1.0 (RTL Fixed)
 * Author: Amir Rezaie
 * License: MIT
 */

#stories-container {
    display: flex;
    gap: 15px;
    padding: 15px;
    overflow-x: hidden;
    direction: rtl;
    height: 135px;
}

#stories-prev{left: 0;}

/* =========================
   Story Item
========================= */
.story {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.story-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    padding: 3px;
    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: 3px solid #fff;
    object-fit: cover;
}

.story-username {
    margin-top: 6px;
    font-size: 12px;
    color: #333;
    white-space: nowrap;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================
   Modal
========================= */
.story-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 1000;
    direction: rtl;
}

.story-content {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================
   Progress
========================= */
.progress-container {
    position: absolute;
    top: 12px;
    right: 12px;
    left: 12px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    z-index: 1002;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: #fff;
    border-radius: 2px;
}

/* =========================
   Media
========================= */
.story-media,
.video-media {
    width: 100%;
    height: 90%;
    object-fit: contain;
    display: none;
}

/* =========================
   Navigation Buttons
========================= */
.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.25);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    z-index: 1003;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prev-button {
    right: 20px; /* RTL: قبلی سمت راست */
}

.next-button {
    left: 20px; /* RTL: بعدی سمت چپ */
}

/* hidden state (مثل اینستاگرام) */
.nav-button.is-hidden {
    opacity: 0;
    pointer-events: none;
}

/* =========================
   Close Button
========================= */
.close-button {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255,255,255,0.25);
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: white;
    font-size: 22px;
    cursor: pointer;
    z-index: 1003;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================
   Story Link
========================= */
.story-link {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    z-index: 1004;
    white-space: nowrap;
}



