/* activity.php — UASEX microblog feed v16 */

.activity-page {
    --mb-bg: rgba(16, 10, 26, 0.72);
    --mb-border: rgba(255, 255, 255, 0.08);
    --mb-text: #f5f1f8;
    --mb-muted: rgba(190, 176, 205, 0.82);
    --mb-faint: rgba(140, 124, 158, 0.78);
    --mb-accent: #bc13fe;
    --mb-gap: 14px;

    width: 100%;
    max-width: 580px;
    margin: 0 auto;
    padding: 6px 0 calc(18px + env(safe-area-inset-bottom, 0px));
    color: var(--mb-text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ── Header ── */

.act-head {
    position: sticky;
    top: 0;
    z-index: 40;
    margin-bottom: 12px;
    padding: 10px 0 12px;
    background: linear-gradient(180deg, rgba(8, 4, 14, 0.98) 0%, rgba(8, 4, 14, 0.88) 75%, transparent 100%);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.act-head__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.act-head__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.act-head__live {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255, 61, 90, 0.14);
    border: 1px solid rgba(255, 61, 90, 0.28);
}

.act-head__live::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff3d5a;
    box-shadow: 0 0 10px rgba(255, 61, 90, 0.75);
    animation: act-pulse 2s ease-in-out infinite;
}

@keyframes act-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

.act-head__title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
}

.act-head__meta {
    margin: 3px 0 0;
    font-size: 12px;
    color: var(--mb-muted);
}

.act-head__write {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(188, 19, 254, 0.35);
    border-radius: 999px;
    background: rgba(188, 19, 254, 0.12);
    color: #e9d5ff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.act-intro {
    margin-bottom: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(188, 19, 254, 0.16);
    background: rgba(188, 19, 254, 0.08);
}

.act-intro__text {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--mb-muted);
}

.act-fab {
    display: none;
}

.act-toast {
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.act-toast--ok { color: #86efac; background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.22); }
.act-toast--err { color: #fca5a5; background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.22); }

/* ── Feed ── */

.act-stream__list {
    display: flex;
    flex-direction: column;
    gap: var(--mb-gap);
}

.act-empty {
    padding: 48px 24px;
    text-align: center;
    border-radius: 18px;
    border: 1px dashed rgba(188, 19, 254, 0.2);
}

.act-empty__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 22px;
    background: rgba(188, 19, 254, 0.12);
}

.act-empty__title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}

.act-empty__text {
    margin: 0 auto;
    max-width: 280px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--mb-muted);
}

/* ── Microblog post ── */

.mb-post {
    position: relative;
    border-radius: 18px;
    border: 1px solid var(--mb-border);
    background: var(--mb-bg);
    overflow: hidden;
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.mb-post::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--mb-accent);
}

.mb-post:hover {
    background: rgba(22, 14, 34, 0.92);
}

.mb-post__link {
    display: block;
    padding: 14px 16px 16px 18px;
    color: inherit;
    text-decoration: none;
}

.mb-post__badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 12px;
    padding: 6px 12px 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
}

.mb-post__badge-icon {
    font-size: 14px;
    line-height: 1;
}

.mb-post__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.mb-post__ava {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(145deg, #bc13fe, #7c4dff);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.mb-post__meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 2px 10px;
    min-width: 0;
    flex: 1;
}

.mb-post__name {
    grid-column: 1;
    grid-row: 1;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
}

.mb-post__action {
    grid-column: 1;
    grid-row: 2;
    font-size: 12px;
    font-weight: 600;
    color: var(--mb-muted);
    line-height: 1.35;
}

.mb-post__time {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    color: var(--mb-faint);
    font-size: 12px;
    white-space: nowrap;
}

.mb-post__body {
    padding-left: 50px;
}

.mb-post__title {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -0.02em;
    color: #fff;
}

.mb-post__snippet {
    margin: 0 0 8px;
    font-size: 15px;
    line-height: 1.58;
    color: var(--mb-text);
    word-break: break-word;
}

.mb-post__context {
    margin: 0 0 10px;
}

.mb-post__context-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--mb-muted);
}

.mb-post__media {
    margin-top: 10px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--mb-border);
    background: rgba(0, 0, 0, 0.45);
    width: fit-content;
    max-width: min(100%, 300px);
    line-height: 0;
}

.mb-post__media img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: min(360px, 55vh);
    object-fit: contain;
    object-position: center;
}

/* site-pages.css sets height:auto on all imgs — keep feed previews proportional */
.site-content .activity-page .mb-post__media img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: min(360px, 55vh);
    object-fit: contain;
}

/* ── Type colors ── */

.mb-post--type-micro::before { background: #a855f7; }
.mb-post--type-micro .mb-post__badge { color: #e9d5ff; background: rgba(168, 85, 247, 0.16); border-color: rgba(168, 85, 247, 0.28); }
.mb-post--type-micro .mb-post__ava { background: linear-gradient(145deg, #bc13fe, #7c4dff); }
.mb-post--type-micro:hover { border-color: rgba(168, 85, 247, 0.35); }

.mb-post--type-post::before { background: #f43f5e; }
.mb-post--type-post .mb-post__badge { color: #fecdd3; background: rgba(244, 63, 94, 0.14); border-color: rgba(244, 63, 94, 0.28); }
.mb-post--type-post .mb-post__ava { background: linear-gradient(145deg, #f43f5e, #ec4899); }
.mb-post--type-post:hover { border-color: rgba(244, 63, 94, 0.35); }

.mb-post--type-photo::before { background: #0ea5e9; }
.mb-post--type-photo .mb-post__badge { color: #bae6fd; background: rgba(14, 165, 233, 0.14); border-color: rgba(14, 165, 233, 0.28); }
.mb-post--type-photo .mb-post__ava { background: linear-gradient(145deg, #0ea5e9, #6366f1); }
.mb-post--type-photo:hover { border-color: rgba(14, 165, 233, 0.35); }

.mb-post--type-video::before { background: #6366f1; }
.mb-post--type-video .mb-post__badge { color: #c7d2fe; background: rgba(99, 102, 241, 0.14); border-color: rgba(99, 102, 241, 0.28); }
.mb-post--type-video .mb-post__ava { background: linear-gradient(145deg, #6366f1, #8b5cf6); }
.mb-post--type-video:hover { border-color: rgba(99, 102, 241, 0.35); }

.mb-post--type-story::before { background: #ec4899; }
.mb-post--type-story .mb-post__badge { color: #fbcfe8; background: rgba(236, 72, 153, 0.14); border-color: rgba(236, 72, 153, 0.28); }
.mb-post--type-story .mb-post__ava { background: linear-gradient(145deg, #ec4899, #f97316); }
.mb-post--type-story:hover { border-color: rgba(236, 72, 153, 0.35); }

.mb-post--type-forum_topic::before { background: #f59e0b; }
.mb-post--type-forum_topic .mb-post__badge { color: #fde68a; background: rgba(245, 158, 11, 0.18); border-color: rgba(245, 158, 11, 0.32); }
.mb-post--type-forum_topic .mb-post__ava { background: linear-gradient(145deg, #f59e0b, #eab308); }
.mb-post--type-forum_topic:hover { border-color: rgba(245, 158, 11, 0.38); }

.mb-post--type-forum_reply::before { background: #38bdf8; }
.mb-post--type-forum_reply .mb-post__badge { color: #bae6fd; background: rgba(56, 189, 248, 0.14); border-color: rgba(56, 189, 248, 0.3); }
.mb-post--type-forum_reply .mb-post__ava { background: linear-gradient(145deg, #0284c7, #38bdf8); }
.mb-post--type-forum_reply:hover { border-color: rgba(56, 189, 248, 0.35); }
.mb-post--type-forum_reply .mb-post__title { font-size: 15px; color: var(--mb-muted); font-weight: 700; }
.mb-post--type-forum_reply .mb-post__snippet { font-size: 16px; color: #fff; }

.mb-post--type-comment::before { background: #14b8a6; }
.mb-post--type-comment .mb-post__badge { color: #99f6e4; background: rgba(20, 184, 166, 0.14); border-color: rgba(20, 184, 166, 0.28); }
.mb-post--type-comment .mb-post__ava { background: linear-gradient(145deg, #14b8a6, #06b6d4); }
.mb-post--type-comment:hover { border-color: rgba(20, 184, 166, 0.35); }
.mb-post--type-comment .mb-post__title { font-size: 15px; color: var(--mb-muted); font-weight: 700; }

.mb-post--type-review::before { background: #eab308; }
.mb-post--type-review .mb-post__badge { color: #fef08a; background: rgba(234, 179, 8, 0.14); border-color: rgba(234, 179, 8, 0.28); }
.mb-post--type-review .mb-post__ava { background: linear-gradient(145deg, #eab308, #f59e0b); }
.mb-post--type-review:hover { border-color: rgba(234, 179, 8, 0.35); }
.mb-post--type-review .mb-post__title { font-size: 15px; color: var(--mb-muted); font-weight: 700; }

/* legacy tone aliases */
.mb-post--forum:not(.mb-post--type-forum_topic):not(.mb-post--type-forum_reply)::before { background: #f59e0b; }
.mb-post--forum_reply::before { background: #38bdf8; }

/* ── Composer ── */

.act-composer {
    margin-top: 16px;
    scroll-margin-top: 72px;
    scroll-margin-bottom: 100px;
}

.act-composer__box {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(188, 19, 254, 0.2);
    background: var(--mb-bg);
}

.act-composer__label {
    display: block;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.act-composer__input {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--mb-border);
    background: rgba(0, 0, 0, 0.28);
    color: #fff;
    font-size: 16px;
    line-height: 1.5;
    resize: vertical;
    min-height: 84px;
    font-family: inherit;
}

.act-composer__input:focus {
    outline: none;
    border-color: rgba(188, 19, 254, 0.45);
    box-shadow: 0 0 0 3px rgba(188, 19, 254, 0.12);
}

.act-composer__toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.act-composer__attach {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--mb-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--mb-muted);
    font-size: 13px;
    cursor: pointer;
}

.act-composer__attach input { display: none; }

.act-composer__count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 700;
    color: var(--mb-faint);
}

.act-composer__send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--mb-accent), #7c4dff);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.act-composer__ghost {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--mb-border);
    color: var(--mb-muted);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.act-composer__box--guest { text-align: center; }
.act-composer__guest-text { margin: 0 0 14px; color: var(--mb-muted); }
.act-composer__guest-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 1199px) {
    .activity-page {
        padding-bottom: calc(12px + var(--bottom-nav-h, 154px) + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 640px) {
    .act-head__write { display: none; }

    .act-fab {
        display: flex;
        position: fixed;
        right: 14px;
        bottom: calc(var(--bottom-nav-h, 154px) + 14px + env(safe-area-inset-bottom, 0px));
        z-index: 45;
        align-items: center;
        justify-content: center;
        width: 54px;
        height: 54px;
        border: 0;
        border-radius: 50%;
        background: linear-gradient(145deg, var(--mb-accent), #7c4dff);
        color: #fff;
        cursor: pointer;
        box-shadow: 0 8px 28px rgba(188, 19, 254, 0.45);
    }

    .mb-post__body { padding-left: 0; }
    .mb-post__meta { grid-template-columns: 1fr; }
    .mb-post__time { grid-column: 1; grid-row: 3; justify-self: start; margin-top: 2px; }
}

@media (min-width: 1200px) {
    .activity-page { max-width: 560px; }
}
