/* =============================================
   Instagram 24-Hour Stories & Status Ring Styling
   ============================================= */

.stories_bar_wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
    box-sizing: border-box;
}

.stories_bar_wrap::-webkit-scrollbar {
    display: none;
}

.story_item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    width: 68px;
    flex-shrink: 0;
}

/* Instagram Gradient Story Ring */
.story_ring {
    padding: 2px;
    border-radius: 50%;
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    transition: transform 0.2s ease, opacity 0.2s ease;
    display: inline-block;
}

.story_ring.viewed {
    background: rgba(255, 255, 255, 0.25) !important;
}

.has_story_ring {
    padding: 3px !important;
    border-radius: 50% !important;
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888) !important;
    display: inline-block !important;
    cursor: pointer !important;
}

.has_story_ring.viewed {
    background: rgba(255, 255, 255, 0.3) !important;
}

.story_ring_inner {
    padding: 2px;
    background: #111;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story_avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
}

.story_add_btn {
    position: relative;
}

.story_add_icon {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: #0095f6;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border: 2px solid #111;
}

.story_user_name {
    font-size: 11px;
    color: #eee;
    margin-top: 4px;
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    font-weight: 500;
}

/* Fullscreen Story Viewer Modal */
#story_viewer_overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(25px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story_card {
    position: relative;
    width: 400px;
    max-width: 95vw;
    height: 720px;
    max-height: 92vh;
    background: #111;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

/* Top Progress Bars */
.story_progress_wrap {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
    z-index: 10;
}

.story_progress_bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.story_progress_fill {
    width: 0%;
    height: 100%;
    background: #fff;
    transition: width 0.1s linear;
}

/* Story Header */
.story_header {
    position: absolute;
    top: 22px;
    left: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
    color: #fff;
}

.story_header_user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.story_header_avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.story_header_name {
    font-weight: 700;
    font-size: 14px;
    color: #fff;
}

.story_header_time {
    font-size: 11px;
    opacity: 0.7;
}

.story_header_actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.story_icon_btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.story_icon_btn:hover {
    opacity: 1;
}

/* Story Body Content */
.story_body {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.story_img, .story_vid {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story_text_container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    line-height: 1.4;
}

.story_caption_overlay {
    position: absolute;
    bottom: 70px;
    left: 14px;
    right: 14px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    z-index: 5;
}

/* Story Footer & Reply Bar */
.story_footer {
    position: absolute;
    bottom: 12px;
    left: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10;
}

.story_reply_input {
    flex: 1;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    padding: 10px 16px;
    color: #fff;
    font-size: 13px;
    outline: none;
}

.story_reply_input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.story_react_emojis {
    display: flex;
    align-items: center;
    gap: 6px;
}

.story_emoji_btn {
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.15s;
}

.story_emoji_btn:hover {
    transform: scale(1.3);
}

/* Viewers List Drawer */
#story_viewers_modal {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: #1a1a1a;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    z-index: 20;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.8);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
}

#story_viewers_modal.open {
    transform: translateY(0%);
}

.viewer_list_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.viewer_list_body {
    flex: 1;
    overflow-y: auto;
    margin-top: 10px;
}

.viewer_row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.viewer_info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.viewer_avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
}

.viewer_name {
    color: #fff;
    font-weight: 600;
    font-size: 13px;
}

.viewer_time {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
}

/* Floating Heart Animation */
.floating_story_heart {
    position: absolute;
    font-size: 60px;
    pointer-events: none;
    z-index: 99;
    animation: floatStoryHeart 0.8s ease-out forwards;
}

@keyframes floatStoryHeart {
    0% { transform: scale(0.3) translateY(0); opacity: 1; }
    50% { transform: scale(1.2) translateY(-40px); opacity: 0.9; }
    100% { transform: scale(1) translateY(-90px); opacity: 0; }
}

/* =========================
   System Chat Story Announce
   ========================= */
.story_watch_btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #fff !important;
    border: none;
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    margin-left: 6px;
    vertical-align: middle;
    transition: opacity 0.2s, transform 0.1s;
    text-decoration: none;
}
.story_watch_btn:hover {
    opacity: 0.85;
    transform: scale(1.05);
}

/* =========================
   Story React Notification
   ========================= */
.notify_story_react {
    cursor: pointer;
    transition: background 0.15s;
}
.notify_story_react:hover {
    background: rgba(255,255,255,0.07) !important;
}

/* =========================
   Story PM Reply Quote Card
   ========================= */
.story_pm_quote {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(0,0,0,0.3);
    border-left: 3px solid #e6683c;
    border-radius: 8px;
    padding: 8px 10px;
    max-width: 260px;
    margin: 0;
}
.story_pm_media {
    flex-shrink: 0;
}
.story_pm_thumb {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    object-fit: cover;
    display: block;
}
.story_pm_video_icon,
.story_pm_text_icon {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}
.story_pm_body {
    flex: 1;
    min-width: 0;
}
.story_pm_label {
    font-size: 11px;
    font-weight: 700;
    color: #e6683c;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.story_pm_snippet {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 4px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.story_pm_msg {
    font-size: 13px;
    color: #fff;
    font-weight: 500;
    word-break: break-word;
}

/* =========================
   Story Skip Nav Arrows
   ========================= */
.story_nav_btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10000001;
    background: rgba(0,0,0,0.45);
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.story_nav_btn:hover {
    background: rgba(255,255,255,0.18);
    transform: translateY(-50%) scale(1.08);
}
.story_nav_prev {
    left: calc(50% - 220px); /* left of card */
}
.story_nav_next {
    right: calc(50% - 220px); /* right of card */
}
@media (max-width: 520px) {
    .story_nav_prev { left: 6px; }
    .story_nav_next { right: 6px; }
}

/* =========================
   Story Media Loading Spinner
   ========================= */
.story_loading_spinner {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: none; /* shown by JS while loading */
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}
.story_spinner_ring {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255,255,255,0.15);
    border-top-color: #fff;
    border-radius: 50%;
    animation: storySpinRot 0.75s linear infinite;
}
@keyframes storySpinRot {
    to { transform: rotate(360deg); }
}

