/* --- Variables & Base --- */
.eis-widget-container {
    width: 100%;
    position: relative;
    font-family: iransans, tahoma, sans-serif; /* فونت پیش‌فرض فارسی */
}

/* Floating Layout Mode */
.eis-is-floating {
    position: fixed;
    bottom: 20px;
    z-index: 9999;
    width: auto;
    background: #fff;
    padding: 10px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
.eis-pos-right { right: 20px; }
.eis-pos-left { left: 20px; }

/* Avatar List */
.eis-avatars-list {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px;
    scrollbar-width: none;
    direction: rtl; /* راست‌چین */
}
.eis-avatars-list::-webkit-scrollbar { display: none; }

.eis-story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

/* Rings (Seen vs Unseen) */
.eis-avatar-ring {
    padding: 3px;
    border-radius: 50%;
    background: var(--ring-unseen, linear-gradient(45deg, #f09433, #bc1888));
    transition: transform 0.3s;
}
.eis-story-item.eis-seen .eis-avatar-ring {
    background: var(--ring-seen, #bfbfbf);
}
.eis-story-item:hover .eis-avatar-ring { transform: scale(1.08); }

.eis-avatar-wrap {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #fff;
    padding: 3px;
}
.eis-avatar-wrap img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.eis-story-username { font-size: 12px; margin-top: 8px; color: #333; }

/* --- Premium Modal & Player --- */
.eis-modal {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: #111; z-index: 999999;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: opacity 0.3s;
    direction: rtl;
}
.eis-modal.active { opacity: 1; visibility: visible; }

.eis-player {
    position: relative; width: 100%; max-width: 420px; height: 100dvh;
    background: #000; overflow: hidden;
}
@media (min-width: 768px) {
    .eis-player { height: 90vh; border-radius: 16px; }
}

/* Media Elements */
.eis-player img, .eis-player video {
    width: 100%; height: 100%; object-fit: cover;
    opacity: 0; transition: opacity 0.3s;
}
.eis-player img.active, .eis-player video.active { opacity: 1; }

/* Progress Bars */
.eis-progress-wrap {
    position: absolute; top: 15px; left: 10px; right: 10px;
    display: flex; gap: 4px; z-index: 10; direction: ltr; /* پروگرس بار همیشه چپ به راست است */
}
.eis-bar { flex: 1; height: 3px; background: rgba(255,255,255,0.3); border-radius: 2px; overflow: hidden;}
.eis-fill { height: 100%; background: #fff; width: 0%; transform-origin: left; }

/* Header Info */
.eis-header {
    position: absolute; top: 30px; right: 15px;
    display: flex; align-items: center; gap: 10px; z-index: 10;
}
.eis-header img { width: 35px; height: 35px; border-radius: 50%; border: 1px solid #fff; opacity: 1;}
.eis-header span { color: #fff; font-weight: bold; font-size: 14px; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }

.eis-close { position: absolute; top: 25px; left: 15px; color: #fff; font-size: 28px; cursor: pointer; z-index: 10; }

/* Touch Zones */
.eis-zone { position: absolute; top: 0; width: 50%; height: 80%; z-index: 5; }
.eis-zone-prev { right: 0; } /* در فارسی راست یعنی قبلی */
.eis-zone-next { left: 0; }

/* Swipe Up Button */
.eis-swipe-up {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center;
    color: #fff; text-decoration: none; z-index: 20;
    font-weight: bold; font-size: 14px; text-shadow: 0 1px 4px rgba(0,0,0,0.8);
    animation: eisBounce 1.5s infinite;
}
.eis-swipe-up::before {
    content: '⌃'; font-size: 24px; line-height: 1; margin-bottom: -5px;
}
@keyframes eisBounce {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, -10px); }
}