/* wall/css/wall.css
 *
 * Only wall-specific styles live here.
 * Filter tabs  → common nav_pills / nav_pill
 * Avatars      → common .avatar / .avatar_sm / .avatar_image
 * Post card    → common .content_box (already applied in JS)
 * Follow btn   → common .btn .btn_sm .btn_outline_primary / .btn_primary
 * Buttons      → common .btn .btn_sm .btn_primary etc.
 */

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.wall-layout {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
}
.wall-layout .wall-wrap {
    flex: 1;
    min-width: 0;
}
.wall-buddy-sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* reset content_box hover transform so sidebar doesn't drift */
    transform: none !important;
}

.wall-wrap {
    width: 100%;
    padding: 0 0 2rem;
}

@media (max-width: 768px) {
    .wall-layout { flex-direction: column; }
    .wall-buddy-sidebar { width: 100%; position: static; max-height: 320px; }
}

/* ── Filter tab group — full-width segmented control ────────────────────────── */
.wall-filter-group {
    width: 100%;
    display: flex;
}
.wall-filter-group .btn {
    flex: 1;
    justify-content: center;
}

/* ── Compose box ─────────────────────────────────────────────────────────────── */
/* content_box already provides bg, border, radius, shadow */
.wall-compose-box {
    padding: 1rem 1.1rem 0.85rem;
    margin-bottom: 10px;
}

.wall-compose-textarea {
    resize: none;
    min-height: 64px;
    flex: 1;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    font-size: var(--text_base);
    line-height: 1.5;
    padding: 0 !important;
}
.wall-compose-textarea:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}
.wall-image-label {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.wall-image-label input[type="file"] { display: none; }

/* Toolbar divider above actions row */
.wall-compose-box .d_flex.align_items_center.gap_sm.justify_content_between {
    border-top: 1px solid var(--base_border_light);
    margin-top: 0.6rem;
    padding-top: 0.6rem;
}

/* ── Post card ───────────────────────────────────────────────────────────────── */
/* content_box provides bg, border, radius, shadow — only override what's unique */
.wall-post {
    padding: 1.1rem 1.2rem 0.75rem;
    margin-bottom: 12px;
}
.wall-post.is-deleted {
    opacity: 0.5;
    border-style: dashed;
    box-shadow: none;
}

/* ── Post header ─────────────────────────────────────────────────────────────── */
.wall-post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.75rem;
}
.wall-post-profile-link {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}
.wall-post-profile-link:hover .wall-post-username {
    text-decoration: underline;
}
.wall-post-meta { min-width: 0; }
.wall-post-username {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--base_text_on_light);
    line-height: 1.2;
}
.wall-post-time {
    font-size: 0.72rem;
    color: var(--base_text_muted);
    margin-top: 1px;
}
.wall-post-menu { position: relative; }
.wall-post-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    color: var(--base_text_muted);
    border-radius: 8px;
    line-height: 1;
}
.wall-post-menu-btn:hover { background: var(--base_border_light); }
.wall-post-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid var(--base_border_light);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 140px;
    z-index: 100;
    overflow: hidden;
}
.wall-post-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 9px 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: var(--text_sm);
    color: var(--base_text_on_light);
}
.wall-post-dropdown button:hover { background: var(--base_border_light); }
.wall-post-dropdown button.danger { color: var(--base_danger); }

/* ── Post body ───────────────────────────────────────────────────────────────── */
.wall-post-body {
    font-size: 0.9375rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 0.75rem;
    color: var(--base_text_on_light);
}
.wall-post-image {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    display: block;
}

/* ── Content-type badge ──────────────────────────────────────────────────────── */
.wall-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--base_text_muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}

/* ── Gallery card ────────────────────────────────────────────────────────────── */
.wall-gallery-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--base_border_light, #e2e8f0);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 0.5rem;
    transition: box-shadow 0.15s ease;
}
.wall-gallery-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.wall-gallery-card-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--base_border_light, #e2e8f0);
}
.wall-gallery-thumbs {
    display: grid;
    gap: 2px;
    background: var(--grid_item_bg_1, #f3f4f6);
}
.wall-gallery-thumbs-1 { grid-template-columns: 1fr; max-height: 360px; }
.wall-gallery-thumbs-2 { grid-template-columns: 1fr 1fr; max-height: 240px; }
.wall-gallery-thumbs-3 { grid-template-columns: 1fr 1fr 1fr; max-height: 200px; }
.wall-gallery-thumbs-4 { grid-template-columns: 1fr 1fr; max-height: 280px; }
.wall-gallery-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Share embed ─────────────────────────────────────────────────────────────── */
.wall-share-embed {
    border: 1px solid var(--base_border_light);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    background: var(--base_light, #f8fafc);
    margin-top: 0.5rem;
}
.wall-share-embed .wall-share-orig-user {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--base_text_muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.wall-share-embed .wall-share-orig-body {
    font-size: var(--text_sm);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.wall-share-embed .wall-share-orig-image {
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 6px;
}
.wall-share-removed {
    font-size: var(--text_sm);
    color: var(--base_text_muted);
    font-style: italic;
}

/* ── Reactions bar ───────────────────────────────────────────────────────────── */
.wall-reactions-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin-bottom: 0.5rem;
    min-height: 8px;
}
.wall-reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border: 1.5px solid var(--base_border_light);
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.wall-reaction-btn:hover {
    background: var(--base_border_light);
    transform: scale(1.05);
}
.wall-reaction-btn.mine {
    border-color: var(--base_primary, #a855f7);
    background: rgba(168,85,247,0.08);
}
.wall-reaction-btn .wall-reaction-count {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--base_text_muted);
}

/* ── Action row ──────────────────────────────────────────────────────────────── */
.wall-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    padding-top: 0.5rem;
    border-top: 1px solid var(--base_border_light);
    flex-wrap: wrap;
}
.wall-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--base_text_muted);
    transition: background 0.15s, color 0.15s;
}
.wall-action-btn:hover {
    background: var(--base_border_light);
    color: var(--base_text_on_light);
}
.wall-action-btn .material-symbols-outlined { font-size: 16px; }

/* Quick reaction popup */
.wall-quick-reactions {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    background: #fff;
    border: 1px solid var(--base_border_light);
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.14);
    padding: 6px 10px;
    gap: 4px;
    z-index: 200;
    white-space: nowrap;
}
.wall-quick-reactions.open { display: flex; }
.wall-quick-reaction-item {
    font-size: 22px;
    cursor: pointer;
    padding: 2px;
    border-radius: 6px;
    transition: transform 0.12s;
    line-height: 1;
}
.wall-quick-reaction-item:hover { transform: scale(1.35); }
.wall-react-wrap { position: relative; }

/* Follow button — uses common .btn .btn_sm .btn_outline_primary / .btn_primary
   Only need a flex-shrink override so it doesn't wrap oddly in the post header */
.wall-follow-btn { flex-shrink: 0; }

/* ── Comments ────────────────────────────────────────────────────────────────── */
.wall-comments-section {
    margin-top: 0.75rem;
    border-top: 1px solid var(--base_border_light);
    padding-top: 0.75rem;
}
.wall-comment {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: flex-start;
}
/* comment avatar uses common .avatar.avatar_sm — no extra wall CSS needed */
.wall-comment-bubble {
    background: var(--base_border_light, #f1f5f9);
    border-radius: 14px 14px 14px 4px;
    padding: 7px 12px;
    flex: 1;
    min-width: 0;
}
.wall-comment-bubble .wall-comment-user {
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 2px;
    color: var(--base_text_on_light);
}
.wall-comment-bubble .wall-comment-body {
    font-size: 0.875rem;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.45;
}
.wall-comment-bubble .wall-comment-body.deleted {
    font-style: italic;
    color: var(--base_text_muted);
}
.wall-comment-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 3px;
    flex-wrap: wrap;
    padding-left: 2px;
}
.wall-comment-time {
    font-size: 0.7rem;
    color: var(--base_text_muted);
}
.wall-comment-react-btn,
.wall-comment-delete-btn {
    background: none;
    border: none;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--base_text_muted);
    padding: 0;
}
.wall-comment-react-btn:hover { color: var(--base_primary); }
.wall-comment-delete-btn:hover { color: var(--base_danger); }
.wall-comment-reactions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 4px;
    padding-left: 2px;
}
.wall-comment-reaction-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 7px;
    border: 1px solid var(--base_border_light);
    border-radius: 999px;
    font-size: 11px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.12s;
}
.wall-comment-reaction-chip.mine { border-color: var(--base_primary); }

/* Comment compose */
.wall-comment-compose {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    align-items: flex-start;
}
.wall-comment-input {
    flex: 1;
    min-height: 36px;
    resize: none;
    border-radius: 20px !important;
    font-size: 0.875rem;
}

/* ── Empty / end states ──────────────────────────────────────────────────────── */
#wall-feed-empty,
#wall-feed-end {
    background: #fff;
    border: 1px solid var(--base_border_light);
    border-radius: 16px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--base_text_muted);
    font-size: 0.9rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
#wall-feed-end { padding: 1rem; font-size: 0.8rem; }

/* ── Admin ───────────────────────────────────────────────────────────────────── */
.wall-admin-post {
    border: 1px solid var(--base_border_light);
    border-radius: 12px;
    padding: var(--base_pad_md);
    margin-bottom: 8px;
    font-size: var(--text_sm);
    background: #fff;
}
.wall-admin-post.deleted {
    border-color: var(--base_danger);
    opacity: 0.7;
}
.wall-admin-post-header {
    display: flex;
    align-items: center;
    gap: var(--base_gap_sm);
    margin-bottom: 6px;
}
.wall-admin-post-user { font-weight: 700; }
.wall-admin-post-time { color: var(--base_text_muted); font-size: var(--text_xs); }
.wall-admin-post-body {
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--base_text_on_light);
    margin-bottom: 6px;
}
.wall-admin-badge {
    font-size: var(--text_xs);
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--base_danger);
    color: #fff;
    font-weight: 600;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Video embed ─────────────────────────────────────────────────────────────── */
.wall-video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}
.wall-video-thumb {
    position: absolute;
    inset: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.wall-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.wall-video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: background 0.15s, transform 0.15s;
}
.wall-video-thumb:hover .wall-video-play-btn {
    background: var(--base_primary, #a855f7);
    transform: translate(-50%, -50%) scale(1.08);
}
.wall-video-play-btn .material-symbols-outlined {
    font-size: 32px;
    color: #fff;
    margin-left: 3px;
}
.wall-video-provider-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    pointer-events: none;
    letter-spacing: 0.03em;
}
.wall-video-no-thumb {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #1a1a2e;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: background 0.15s;
}
.wall-video-no-thumb:hover { background: #252545; }
.wall-video-no-thumb .material-symbols-outlined {
    font-size: 52px;
    color: rgba(255, 255, 255, 0.65);
    transition: color 0.15s;
}
.wall-video-no-thumb:hover .material-symbols-outlined { color: #fff; }
.wall-video-no-thumb-label { font-size: var(--text_sm); font-weight: 500; }
.wall-video-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}
.wall-share-embed .wall-video-wrap {
    margin-top: 6px;
    margin-bottom: 0;
    border-radius: 8px;
}
.wall-share-embed .wall-video-play-btn { width: 40px; height: 40px; }
.wall-share-embed .wall-video-play-btn .material-symbols-outlined { font-size: 22px; }

/* ── Compose video input ─────────────────────────────────────────────────────── */
.wall-compose-video-row {
    display: flex;
    align-items: center;
    gap: var(--base_gap_sm);
    margin-bottom: 0.5rem;
}
.wall-compose-video-row input { flex: 1; }
.wall-compose-video-preview {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 220px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    position: relative;
    margin-bottom: 0.5rem;
}
.wall-compose-video-preview .wall-video-wrap {
    position: absolute;
    inset: 0;
    margin: 0;
    border-radius: 0;
}

/* ── Active video toolbar button ─────────────────────────────────────────────── */
#wall-compose-video-btn.active {
    background: rgba(168, 85, 247, 0.1);
    border-color: var(--base_primary);
    color: var(--base_primary);
}

/* ── Buddy sidebar — nav_tab overrides for narrow context ────────────────────── */
.wall-buddy-sidebar .nav_tabs {
    margin-bottom: 0;
}
.wall-buddy-sidebar .nav_tab {
    flex: 1;
    justify-content: center;
    padding: 8px 6px;
    font-size: 0.78rem;
    background: none;
    border: none;
}

/* ── Buddy sidebar row elements ──────────────────────────────────────────────── */
.buddy-row {
    padding: 8px 12px;
    border-bottom: 1px solid var(--base_border_light);
}
.buddy-row:last-child { border-bottom: none; }
.buddy-row-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--base_text_on_light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.buddy-row-sub {
    font-size: 0.7rem;
    color: var(--base_text_muted, #6b7280);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.buddy-section-label {
    padding: 5px 12px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--base_text_muted);
    background: var(--base_bg_hover, #f9fafb);
    border-bottom: 1px solid var(--base_border_light);
}
.buddy-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #ef4444;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
}
.buddy-btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--base_text_muted);
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 4px;
}
.buddy-btn-icon .material-symbols-outlined { font-size: 16px; }
.buddy-btn-icon:hover { background: var(--base_border_light); color: var(--base_text_on_light); }
.buddy-btn-icon.danger:hover { color: #ef4444; }

/* ── Profile widget ──────────────────────────────────────────────────────────── */
.wall-widget-section { width: 100%; }
.wall-widget-header {
    display: flex;
    align-items: center;
    gap: var(--base_gap_sm);
    font-size: var(--text_base);
    font-weight: 700;
    color: var(--base_text_on_light);
}
.wall-widget-header .material-symbols-outlined {
    font-size: 20px;
    color: var(--base_primary);
}
