/* =========================================
   NEXUS FEED — Feed page layout + post card
   ========================================= */

.nx-feed-page { padding-top: var(--nx-spacing-md); }

.nx-feed-list { display: flex; flex-direction: column; gap: 0; }

/* Loading more indicator */
.nx-feed-load-more {
    text-align: center;
    padding: var(--nx-spacing-lg);
}
.nx-feed-end {
    text-align: center;
    padding: var(--nx-spacing-lg);
    color: var(--nx-text-muted);
    font-size: 0.875rem;
}

/* Shared post / reshare */
.nx-post-shared {
    margin: 8px var(--nx-spacing-md);
    padding: var(--nx-spacing-sm) var(--nx-spacing-md);
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius);
    background: var(--nx-bg-secondary);
}
.nx-post-shared .nx-post-author-name { font-size: 0.875rem; }
.nx-post-shared .nx-post-content    { padding: var(--nx-spacing-sm) 0 0; font-size: 0.9375rem; }

/* Pinned post indicator */
.nx-post-pinned-bar {
    display: flex; align-items: center; gap: 6px;
    padding: 6px var(--nx-spacing-md);
    font-size: 0.8125rem; font-weight: 600;
    color: var(--nx-text-muted);
    background: var(--nx-bg);
    border-bottom: 1px solid var(--nx-border-light);
}

/* Post visibility chip */
.nx-privacy-chip {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.75rem; color: var(--nx-text-muted);
}

/* Feeling / activity tag */
.nx-post-feeling { color: var(--nx-text-secondary); font-size: 0.9375rem; }

/* Tagged users */
.nx-post-tagged { font-size: 0.9375rem; color: var(--nx-text-secondary); }

/* Check-in */
.nx-post-location { display: flex; align-items: center; gap: 4px; font-size: 0.9375rem; color: var(--nx-text-secondary); }

/* ── Poll post ──────────────────────────── */
.nx-post-poll {
    padding: 0 var(--nx-spacing-md) var(--nx-spacing-md);
}
.nx-poll-question {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--nx-text-primary);
    margin-bottom: 10px;
}
.nx-poll-options { display: flex; flex-direction: column; gap: 8px; }
.nx-poll-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border: 2px solid var(--nx-border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    overflow: hidden;
    background: var(--nx-card);
    transition: border-color var(--nx-transition);
    user-select: none;
}
.nx-poll-option:hover:not([disabled]) { border-color: var(--nx-primary); }
.nx-poll-option[disabled] { cursor: default; }
.nx-poll-option.is-voted { border-color: var(--nx-primary); color: var(--nx-primary); font-weight: 600; }
.nx-poll-bar {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background: rgba(24,119,242,.1);
    transition: width .5s ease;
    z-index: 0;
}
.nx-poll-option span { position: relative; z-index: 1; }
.nx-poll-pct {
    position: relative; z-index: 1;
    font-size: 0.8rem;
    color: var(--nx-text-muted);
    min-width: 36px;
    text-align: right;
}
.nx-poll-meta {
    margin-top: 8px;
    font-size: 0.8125rem;
    color: var(--nx-text-muted);
}
.nx-poll-expires { margin-left: 8px; }

/* ── Background-color post ──────────────── */
.nx-post-bg-color {
    border-radius: var(--nx-radius);
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
}
.nx-post-bg-color .nx-post-text {
    font-size: 1.375rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,.25);
    line-height: 1.4;
    word-break: break-word;
}

/* ── Online status dot ──────────────────── */
.nx-online-dot {
    position: absolute;
    bottom: 1px; right: 1px;
    width: 11px; height: 11px;
    background: #31a24c;
    border: 2px solid var(--nx-card);
    border-radius: 50%;
    display: block;
}
.nx-avatar-wrap { position: relative; display: inline-block; flex-shrink: 0; }

/* ── Ad slot between posts ──────────────── */
.nx-ad-slot {
    background: var(--nx-card);
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius);
    box-shadow: var(--nx-shadow-sm);
    padding: var(--nx-spacing-md);
    text-align: center;
    color: var(--nx-text-muted);
    font-size: 0.75rem;
    margin-bottom: var(--nx-spacing-md);
    overflow: hidden;
}
.nx-ad-slot-label {
    display: block;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-size: 0.6875rem;
}


/* =========================================
   STORIES BAR
   ========================================= */

.nx-stories-wrapper {
    position: relative;
    background: var(--nx-card);
    border: 1px solid var(--nx-border-light);
    border-radius: var(--nx-radius);
    box-shadow: var(--nx-shadow-sm);
    margin-bottom: var(--nx-spacing-md);
    padding: 12px 16px;
    overflow: hidden;
}

.nx-stories-bar {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}
.nx-stories-bar::-webkit-scrollbar { display: none; }

/* ── Add Story card ────────────────────── */
.nx-story-add-card {
    flex-shrink: 0;
    width: 88px;
    height: 138px;
    border-radius: 12px;
    background: #f0f2f5;
    border: 1.5px solid var(--nx-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.nx-story-add-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.18); }

.nx-story-add-photo {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 68%;
    object-fit: cover;
    display: block;
}

.nx-story-add-icon {
    position: absolute;
    bottom: 34px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    background: var(--nx-primary, #1877f2);
    border-radius: 50%;
    border: 3px solid var(--nx-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    z-index: 2;
}

.nx-story-add-label {
    position: absolute;
    bottom: 10px;
    width: 100%;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--nx-text-primary);
    padding: 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Divider between add-card and story cards */
.nx-story-add-card::after {
    content: "";
    position: absolute;
    right: -6px; top: 10%; bottom: 10%;
    width: 1px;
    background: var(--nx-border);
}

/* ── Story cards ───────────────────────── */
.nx-story-card {
    flex-shrink: 0;
    width: 88px;
    height: 138px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2.5px solid var(--nx-primary, #1877f2);
    background: var(--nx-bg-secondary, #222);
}
.nx-story-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.nx-story-card.nx-story-card-seen { border-color: var(--nx-border); }

.nx-story-card > img:first-child {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nx-story-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,.25) 0%, transparent 40%, rgba(0,0,0,.55) 100%);
    pointer-events: none;
}

.nx-story-card-avatar {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50%;
    border: 2px solid var(--nx-primary, #1877f2);
    object-fit: cover;
}
.nx-story-card-seen .nx-story-card-avatar { border-color: rgba(255,255,255,.5); }

.nx-story-card-name {
    position: absolute;
    bottom: 8px;
    left: 6px;
    right: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

/* ── Dark mode overrides ────────────────── */
[data-theme="dark"] .nx-story-add-card {
    background: #3a3b3c;
    border-color: #4a4b4c;
}
[data-theme="dark"] .nx-story-add-label {
    color: #e4e6eb;
}
[data-theme="dark"] .nx-story-card {
    background: #18191a;
    border-color: #1877F2;
}
[data-theme="dark"] .nx-story-card.nx-story-card-seen {
    border-color: #3a3b3c;
}
[data-theme="dark"] .nx-stories-nav-btn {
    background: #3a3b3c;
    border-color: #4a4b4c;
    color: #e4e6eb;
}

/* ── Nav buttons ───────────────────────── */
.nx-stories-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--nx-card);
    border: 1px solid var(--nx-border);
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    color: var(--nx-text-primary);
    font-size: 20px;
    line-height: 1;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, box-shadow 0.15s;
    cursor: pointer;
}
.nx-stories-nav-btn:hover { background: var(--nx-bg-secondary, var(--nx-bg)); box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.nx-stories-nav-prev { left: 6px; }
.nx-stories-nav-next { right: 6px; }
