/* ============================================================
   BENED Research — Social Layer CSS
   Document posts, comments, sharing, profiles
   ============================================================ */

/* --- Document Post Layout --- */
.post-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
}
.post-nav-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    text-decoration: none;
    transition: all 0.15s;
    max-width: 40%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.post-nav-arrow:hover {
    border-color: var(--color-primary);
    color: var(--color-text);
    text-decoration: none;
}
.post-nav-arrow .arrow { font-size: 1.25rem; }
.post-nav-current {
    text-align: center;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}
.post-nav-current strong {
    display: block;
    color: var(--color-text);
    font-family: var(--font-mono);
}

/* --- Engagement Bar --- */
.engagement-bar {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    margin: 1rem 0;
}
.engage-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}
.engage-btn:hover {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text);
    text-decoration: none;
}
.engage-btn.active {
    color: var(--color-primary);
}
.engage-btn .engage-icon { font-size: 1.125rem; }
.engage-btn .engage-count { font-variant-numeric: tabular-nums; }
.engage-spacer { flex: 1; }

/* --- Share Dropdown --- */
.share-dropdown {
    position: relative;
    display: inline-block;
}
.share-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 0.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    min-width: 180px;
    z-index: 50;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.share-menu.open { display: block; }
.share-option {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: var(--color-text);
    font-size: 0.8125rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    font-family: inherit;
    transition: background 0.1s;
}
.share-option:hover {
    background: var(--color-surface-2);
    text-decoration: none;
}
.share-icon-fb { color: #1877f2; }
.share-icon-x { color: #e7e9ea; }
.share-icon-reddit { color: #ff4500; }
.share-icon-copy { color: var(--color-text-muted); }
.share-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-success);
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.share-toast.show { opacity: 1; }

/* --- Comments Section --- */
.comments-section {
    margin-top: 2rem;
}
.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}
.comments-header h2 {
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.comments-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.375rem;
    background: var(--color-primary);
    color: white;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Comment Form */
.comment-form {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.comment-form-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
    color: var(--color-text-muted);
}
.comment-form-body {
    flex: 1;
}
.comment-input {
    width: 100%;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.875rem;
    resize: vertical;
    min-height: 3rem;
    transition: border-color 0.15s;
}
.comment-input:focus {
    outline: none;
    border-color: var(--color-primary);
}
.comment-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
    display: none;
}
.comment-input:focus ~ .comment-form-actions,
.comment-form-body.active .comment-form-actions {
    display: flex;
}

/* Comment Card */
.comment-card {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-border);
}
.comment-card:last-child { border-bottom: none; }
.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
    color: var(--color-text-muted);
}
.comment-body { flex: 1; min-width: 0; }
.comment-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
    flex-wrap: wrap;
}
.comment-author {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--color-text);
}
.comment-handle {
    font-size: 0.75rem;
    color: var(--color-primary);
}
.comment-time {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}
.comment-text {
    font-size: 0.875rem;
    line-height: 1.5;
    word-wrap: break-word;
}
.comment-text .mention {
    color: var(--color-primary);
    font-weight: 500;
}
.comment-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
}
.vote-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    border-radius: 4px;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.1s;
    padding: 0;
}
.vote-btn:hover { background: var(--color-surface-2); }
.vote-btn.upvoted { color: var(--color-success); }
.vote-btn.downvoted { color: var(--color-error); }
.vote-score {
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 1.5rem;
    text-align: center;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}
.vote-score.positive { color: var(--color-success); }
.vote-score.negative { color: var(--color-error); }
.comment-reply-btn {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    margin-left: 0.5rem;
    font-family: inherit;
}
.comment-reply-btn:hover { color: var(--color-primary); }

/* Replies (nested) */
.comment-replies {
    margin-left: 2rem;
    border-left: 2px solid var(--color-border);
    padding-left: 1rem;
}

/* Login prompt */
.comment-login-prompt {
    text-align: center;
    padding: 1.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    color: var(--color-text-muted);
}
.comment-login-prompt a { font-weight: 500; }

/* --- Profile Page --- */
.profile-header {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    padding: 2rem 0;
}
.profile-avatar-large {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--color-surface-2);
    border: 3px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--color-text-muted);
    flex-shrink: 0;
}
.profile-info { flex: 1; }
.profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.profile-handle {
    color: var(--color-primary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}
.profile-bio {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}
.profile-stats {
    display: flex;
    gap: 1.5rem;
}
.profile-stat {
    font-size: 0.875rem;
}
.profile-stat strong {
    font-weight: 600;
    color: var(--color-text);
}
.profile-stat span {
    color: var(--color-text-muted);
}
.profile-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Profile Tabs */
.profile-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 1.5rem;
}
.profile-tab {
    padding: 0.75rem 1.25rem;
    color: var(--color-text-muted);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    text-decoration: none;
    transition: all 0.15s;
}
.profile-tab:hover {
    color: var(--color-text);
    text-decoration: none;
}
.profile-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* Activity Feed */
.activity-item {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-border);
}
.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}
.activity-icon-comment { background: rgba(59,130,246,0.15); color: var(--color-primary); }
.activity-icon-bookmark { background: rgba(245,158,11,0.15); color: var(--color-accent); }
.activity-icon-share { background: rgba(34,197,94,0.15); color: var(--color-success); }
.activity-body { flex: 1; }
.activity-text { font-size: 0.875rem; }
.activity-time { font-size: 0.75rem; color: var(--color-text-muted); margin-top: 0.25rem; }

/* --- Settings Page --- */
.settings-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 2rem;
    padding: 2rem 0;
}
.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.settings-nav-item {
    padding: 0.625rem 1rem;
    border-radius: var(--radius);
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
}
.settings-nav-item:hover {
    background: var(--color-surface);
    color: var(--color-text);
    text-decoration: none;
}
.settings-nav-item.active {
    background: rgba(59,130,246,0.1);
    color: var(--color-primary);
}
.settings-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}
.settings-section h2 {
    font-size: 1.125rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
}
.setting-row:last-child { border-bottom: none; }
.setting-label h4 { font-size: 0.875rem; margin-bottom: 0.125rem; }
.setting-label p { font-size: 0.75rem; color: var(--color-text-muted); }

/* Toggle Switch */
.toggle {
    position: relative;
    width: 44px;
    height: 24px;
}
.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    transition: all 0.2s;
}
.toggle-slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    top: 2px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}
.toggle input:checked + .toggle-slider {
    background: var(--color-primary);
    border-color: var(--color-primary);
}
.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* Form inputs for settings */
.settings-input {
    width: 100%;
    max-width: 400px;
    padding: 0.625rem 0.875rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.875rem;
}
.settings-input:focus {
    outline: none;
    border-color: var(--color-primary);
}
.settings-textarea {
    resize: vertical;
    min-height: 4rem;
}

/* Security badge */
.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}
.security-badge-good {
    background: rgba(34,197,94,0.15);
    color: var(--color-success);
    border: 1px solid rgba(34,197,94,0.25);
}
.security-badge-warn {
    background: rgba(245,158,11,0.15);
    color: var(--color-accent);
    border: 1px solid rgba(245,158,11,0.25);
}

/* Question pills (shared with doc/search, duplicated for standalone pages) */
.q-pill {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 100px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.25px;
    text-decoration: none;
    transition: opacity 0.15s;
}
.q-pill:hover { opacity: 0.8; text-decoration: none; }
.q-pill-d { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.25); }
.q-pill-v { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.25); }
.q-pill-p { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.25); }

/* Responsive */
@media (max-width: 768px) {
    .profile-header { flex-direction: column; align-items: center; text-align: center; }
    .profile-stats { justify-content: center; }
    .settings-layout { grid-template-columns: 1fr; }
    .settings-nav { flex-direction: row; overflow-x: auto; }
    .engagement-bar { flex-wrap: wrap; }
    .post-nav-arrow { padding: 0.375rem 0.625rem; font-size: 0.75rem; }
}
