/* Member profile refresh. Existing activity cards and social controls remain shared. */
.member-profile-v2 {
    --mp-bg: #F6FBFF;
    --mp-surface: #FFFFFF;
    --mp-alt: #F1F5F9;
    --mp-ink: #222222;
    --mp-secondary: #475569;
    --mp-muted: #64748B;
    --mp-border: #E0E0E0;
    --mp-accent: #0174B1;
    --mp-on-accent: #FFFFFF;
    min-height: 100vh;
    min-height: 100dvh;
    padding: calc(120px + var(--topnav-inset-top, 0px)) 40px 64px;
    background: var(--mp-bg);
    color: var(--mp-ink);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
body.dark-mode .member-profile-v2, html.dark-mode .member-profile-v2 {
    --mp-bg: #0F1620;
    --mp-surface: #1B2330;
    --mp-alt: #2E3A4A;
    --mp-ink: #F1F5F9;
    --mp-secondary: #CBD3DC;
    --mp-muted: #94A3B2;
    --mp-border: #2E3A4A;
    --mp-accent: #00B4FF;
    --mp-on-accent: #0F1620;
}
.member-profile-v2 *, .member-profile-v2 *::before, .member-profile-v2 *::after { box-sizing: border-box; }
.member-profile-v2 button { font-family: inherit; }
.member-profile-v2 :is(a, button):focus-visible { outline: 3px solid var(--mp-accent); outline-offset: 3px; }
.member-profile-v2 .user-profile-page { max-width: 1040px; margin: 0 auto; min-width: 0; }
.member-profile-v2 .user-profile-hero { padding: 24px; border: 1px solid var(--mp-border); border-radius: 14px; background: var(--mp-surface); box-shadow: 0 1px 2px rgb(2 6 23 / 5%); }
.member-profile-v2 .user-profile-hero-container { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; align-items: center; gap: 6px 24px; padding: 0; text-align: left; }
.member-profile-v2 .user-profile-avatar-section { grid-column: 1; grid-row: 1 / 3; }
.member-profile-v2 .user-profile-avatar-wrapper { position: relative; width: 88px; height: 88px; }
.member-profile-v2 .user-profile-avatar { display: block; width: 100%; height: 100%; border: 1px solid var(--mp-border); border-radius: 50%; object-fit: cover; }
.member-profile-v2 .user-profile-avatar-initials { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; border: 1px solid var(--mp-border); border-radius: 50%; background: var(--mp-alt); color: var(--mp-accent); font-size: 28px; font-weight: 700; }
.member-profile-v2 .user-profile-avatar-edit { position: absolute; right: -10px; bottom: -10px; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 6px solid transparent; border-radius: 50%; background: var(--mp-surface); background-clip: padding-box; color: var(--mp-ink); cursor: pointer; }
.member-profile-v2 .user-profile-info-section { display: contents; }
.member-profile-v2 .user-profile-name-row { grid-column: 2; grid-row: 1; display: flex; flex-wrap: wrap; align-items: center; align-self: end; gap: 6px 10px; min-width: 0; }
.member-profile-v2 .user-profile-name { margin: 0; color: var(--mp-ink); font-size: 28px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; overflow-wrap: anywhere; }
.member-profile-v2 .user-profile-badge { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 2px 10px; border-radius: 999px; background: #FFAA00; color: #222222; font-size: 12px; font-weight: 600; }
.member-profile-v2 .user-profile-meta { grid-column: 2; grid-row: 2; align-self: start; display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--mp-muted); font-size: 14px; line-height: 1.4; }
.member-profile-v2 .user-profile-meta-item { display: inline-flex; align-items: center; gap: 6px; }
.member-profile-v2 .user-profile-stats { grid-column: 1 / -1; grid-row: 3; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--mp-border); }
.member-profile-v2 .user-profile-stat { min-width: 0; padding: 0 20px; }
.member-profile-v2 .user-profile-stat + .user-profile-stat { border-left: 1px solid var(--mp-border); }
.member-profile-v2 .stat-value { display: block; color: var(--mp-ink); font-size: 20px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.member-profile-v2 .stat-label { color: var(--mp-muted); font-size: 13px; line-height: 1.3; }
.member-profile-v2 .user-profile-actions { grid-column: 3; grid-row: 1 / 3; display: flex; align-items: center; gap: 8px; }
.member-profile-v2 .user-profile-actions:empty { display: none; }
.member-profile-v2 .user-profile-action-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border: 1px solid var(--mp-border); border-radius: 10px; background: var(--mp-surface); color: var(--mp-ink); font-size: 15px; font-weight: 600; line-height: 1.3; cursor: pointer; }
.member-profile-v2 .user-profile-action-btn:hover { border-color: var(--mp-accent); }
.member-profile-v2 .user-profile-follow-btn.primary { border-color: var(--mp-accent); background: var(--mp-accent); color: var(--mp-on-accent); }
.member-profile-v2 .user-profile-action-btn:disabled { opacity: .5; cursor: default; }
.member-profile-v2 .user-profile-action-btn.primary:not(:first-child), .member-profile-v2 .user-profile-action-btn.following { color: var(--mp-accent); }
.member-profile-v2 .user-profile-actions .brm-trigger { width: 44px; height: 44px; border: 1px solid var(--mp-border); border-radius: 10px; color: var(--mp-ink); }
.member-profile-v2 .user-profile-private-notice { grid-column: 1 / -1; grid-row: 3; display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--mp-border); color: var(--mp-secondary); }
.member-profile-v2 .user-profile-tabs-container { position: sticky; top: var(--topnav-controls-top); z-index: 40; width: fit-content; max-width: 100%; margin-top: 16px; border: 1px solid var(--mp-border); border-radius: 10px; background: var(--mp-surface); }
.member-profile-v2 .user-profile-tabs { display: flex; gap: 4px; margin: 0; padding: 4px; }
.member-profile-v2 .user-profile-tab { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 44px; padding: 10px 16px; border: 0; border-radius: 6px; background: transparent; color: var(--mp-ink); font-size: 15px; font-weight: 500; line-height: 1.3; cursor: pointer; }
.member-profile-v2 .user-profile-tab:not(.active):hover { background: var(--mp-alt); }
.member-profile-v2 .user-profile-tab.active { background: var(--mp-accent); color: var(--mp-on-accent); font-weight: 600; }
.member-profile-v2 .user-profile-content { max-width: none; margin: 0; padding: 24px 0 0; }
.member-profile-v2 .user-profile-error, .member-profile-v2 .user-profile-loading { max-width: 720px; margin: 0 auto; padding: 28px; border: 1px solid var(--mp-border); border-radius: 14px; background: var(--mp-surface); color: var(--mp-secondary); }
.member-profile-v2 .user-profile-error-icon { margin-bottom: 12px; color: var(--mp-muted); font-size: 32px; }
.member-profile-v2 .user-profile-error-title { margin: 0 0 8px; color: var(--mp-ink); font-size: 24px; font-weight: 700; }
.member-profile-v2 .user-profile-error-text { margin: 0 0 20px; }
.member-profile-v2 .user-profile-error-button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 18px; border: 0; border-radius: 10px; background: var(--mp-accent); color: var(--mp-on-accent); font-weight: 600; cursor: pointer; }
.member-profile-v2 .user-profile-loading { display: flex; align-items: center; gap: 16px; }
.member-profile-v2 .user-profile-loading-text { margin: 0; }
.member-profile-v2 .user-profile-loading-spinner { width: 32px; height: 32px; border: 3px solid var(--mp-border); border-top-color: var(--mp-accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==============================================
   READING ACTIVITY COMPONENT
   ============================================== */

.user-reading-activity {
    width: 100%;
}

.activity-loading,
.activity-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.activity-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 180, 255, 0.2);
    border-top-color: #00b4ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

.activity-empty-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 50%;
    margin-bottom: 1rem;
}

.activity-empty-icon i {
    font-size: 1.75rem;
    color: #64748b;
}

.activity-empty h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
}

.activity-empty p {
    color: #64748b;
    margin: 0 0 1.5rem 0;
}

.activity-empty-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #00b4ff;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.activity-empty-btn:hover {
    background: var(--brand-secondary, #0174B1);
}

body.dark-mode .activity-empty-icon {
    background: #334155;
}

body.dark-mode .activity-empty h3 {
    color: #f1f5f9;
}

body.dark-mode .activity-empty p {
    color: #94a3b8;
}

/* Activity Sections */
.activity-section {
    margin-bottom: 2.5rem;
}

.activity-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.activity-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.activity-section-title i {
    color: #00b4ff;
}

.activity-section-count {
    background: #e2e8f0;
    color: #64748b;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
}

body.dark-mode .activity-section-title {
    color: #f1f5f9;
}

body.dark-mode .activity-section-count {
    background: #334155;
    color: #94a3b8;
}

/* Books Grid */
.activity-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.25rem;
}

.activity-book-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
}

.activity-book-card:hover,
.activity-book-card:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    outline: 2px solid var(--brand-primary, #00B4FF);
    outline-offset: 2px;
}

body.dark-mode .activity-book-card {
    background: #1e293b;
}

.activity-book-cover {
    position: relative;
    flex-shrink: 0;
    width: 80px;
    height: 120px;
    border-radius: 0.5rem;
    overflow: hidden;
}

.activity-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.activity-progress-ring {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-progress-text {
    font-size: 0.6rem;
    font-weight: 700;
    color: white;
}

.activity-completed-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.7rem;
}

.activity-book-info {
    flex: 1;
    min-width: 0;
}

.activity-book-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.25rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-book-author {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0 0 0.75rem 0;
}

.activity-progress-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.activity-progress-fill {
    height: 100%;
    background: #00b4ff;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.activity-time-spent {
    font-size: 0.75rem;
    color: #94a3b8;
}

.activity-book-rating {
    display: flex;
    gap: 0.125rem;
    margin-bottom: 0.5rem;
}

.activity-book-rating i {
    font-size: 0.75rem;
    color: #fbbf24;
}

.activity-completion-date {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

body.dark-mode .activity-book-title {
    color: #f1f5f9;
}

body.dark-mode .activity-book-author {
    color: #94a3b8;
}

body.dark-mode .activity-progress-bar {
    background: #334155;
}

/* Load More */
.activity-load-more {
    text-align: center;
    margin-top: 1.5rem;
}

.activity-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: #00b4ff;
    border: 2px solid #00b4ff;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.activity-load-more-btn:hover {
    background: #00b4ff;
    color: white;
}

/* ==============================================
   SOCIAL FEED COMPONENT
   ============================================== */

.user-social-feed {
    width: 100%;
}

.social-loading,
.social-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.social-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 180, 255, 0.2);
    border-top-color: #00b4ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

.social-empty-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 50%;
    margin-bottom: 1rem;
}

.social-empty-icon i {
    font-size: 1.75rem;
    color: #64748b;
}

.social-empty h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
}

.social-empty p {
    color: #64748b;
    margin: 0;
}

.social-empty-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #00b4ff;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-top: 0.5rem;
}

.social-empty-action-btn:hover {
    background: var(--brand-secondary, #0174B1);
}

body.dark-mode .social-empty-icon {
    background: #334155;
}

body.dark-mode .social-empty h3 {
    color: #f1f5f9;
}

body.dark-mode .social-empty p {
    color: #94a3b8;
}

/* Social Posts */
.social-posts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ==============================================
   SOCIAL TAB - ACTIVITY FEED
   ============================================== */

.user-social-feed {
    padding: 1.5rem 0;
}

/* Loading/Empty States */
.social-loading,
.social-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.social-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e9ecef;
    border-top-color: #00b4ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

.social-empty svg {
    opacity: 0.6;
    margin-bottom: 1rem;
    stroke: #94a3b8;
}

.social-empty h4 {
    margin: 0 0 0.5rem 0;
    color: #1e293b;
    font-weight: 700;
    font-size: 1.25rem;
}

body.dark-mode .social-empty h4 {
    color: #f1f5f9;
}

.social-empty p {
    margin: 0 0 1rem 0;
    color: #64748b;
}

.social-empty-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #00b4ff;
    color: white !important;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.social-empty-action-btn:hover {
    background: var(--brand-secondary, #0174B1);
}

/* Posts List */
.social-posts-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Post Card */
.social-post-card {
    background: white;
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.2s;
}

.social-post-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

body.dark-mode .social-post-card {
    background: #1e293b;
    border-color: #334155;
}

.social-post-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.social-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00b4ff, #0174B1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
    overflow: hidden;
}

.social-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.social-post-meta {
    display: flex;
    flex-direction: column;
}

.social-post-author {
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    font-size: 0.95rem;
}

.social-post-author:hover {
    color: #00b4ff;
}

body.dark-mode .social-post-author {
    color: #f1f5f9;
}

.social-post-time {
    font-size: 0.8rem;
    color: #94a3b8;
}

.social-post-content {
    margin-bottom: 0;
}

/* Activity Styles */
.social-post-activity {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.social-activity-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}

.social-activity-icon.reading { background: #e3f2fd; color: #1976d2; }
.social-activity-icon.completed { background: #e8f5e9; color: #388e3c; }
.social-activity-icon.follow { background: #fff3e0; color: #f57c00; }
.social-activity-icon.rating { background: #fffde7; color: #fbc02d; }
.social-activity-icon.comment { background: #f3e5f5; color: #7b1fa2; }
.social-activity-icon.favorite { background: #fce4ec; color: #c2185b; }
.social-activity-icon.audio { background: #e0f7fa; color: #0097a7; }
.social-activity-icon.listening { background: #e0f7fa; color: #0097a7; }
.social-activity-icon.published { background: #e8f5e9; color: #388e3c; }

.social-activity-text {
    font-size: 1rem;
    color: #334155;
}

body.dark-mode .social-activity-text {
    color: #e2e8f0;
}

.social-book-link {
    color: #00b4ff;
    font-weight: 700;
    text-decoration: none;
}

.social-book-link:hover {
    text-decoration: underline;
}

.social-rating-stars {
    color: #f7b500;
    font-weight: 700;
    margin-left: 0.5rem;
}

/* Book Row - Horizontal Layout */
.social-post-book-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-top: 0.75rem;
}

.social-post-cover {
    flex-shrink: 0;
    cursor: pointer;
}

.social-post-cover img {
    width: 100px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.social-post-cover:hover img {
    transform: scale(1.02);
}

.social-post-cover.small img {
    width: 70px;
}

/* Comment/Review Text */
.social-post-comment-text,
.social-post-review {
    flex: 1;
    background: #f8fafc;
    padding: 0.875rem 1rem;
    border-radius: 10px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #334155;
}

body.dark-mode .social-post-comment-text,
body.dark-mode .social-post-review {
    background: #0f172a;
    color: #e2e8f0;
}

.social-post-review {
    font-style: italic;
    border-left: 3px solid #00b4ff;
}

.social-post-usertext {
    background: #f8fafc;
    padding: 0.875rem 1rem;
    border-radius: 10px;
    font-size: 1rem;
    line-height: 1.6;
    color: #334155;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

body.dark-mode .social-post-usertext {
    background: #0f172a;
    color: #e2e8f0;
}

/* Author Follow Card */
.social-author-follow-card {
    display: flex;
    gap: 1.25rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    margin-top: 0.75rem;
}

.social-author-follow-card:hover {
    border-color: #00b4ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 180, 255, 0.15);
}

body.dark-mode .social-author-follow-card {
    background: linear-gradient(135deg, #1e3a5f 0%, #1a2942 100%);
}

.social-author-avatar-large {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #00b4ff, #0174B1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.social-author-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.social-author-avatar-large svg {
    opacity: 0.8;
}

.social-author-info-large {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.social-author-name-large {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

body.dark-mode .social-author-name-large {
    color: #f1f5f9;
}

.social-author-meta-text {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.social-author-bio {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.5;
    margin: 0;
}

body.dark-mode .social-author-bio {
    color: #cbd5e1;
}

.social-author-view-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #00b4ff;
    font-weight: 700;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.social-author-view-link svg {
    transition: transform 0.2s;
}

.social-author-follow-card:hover .social-author-view-link svg {
    transform: translateX(3px);
}

/* Load More */
.social-load-more {
    text-align: center;
    padding: 1rem 0;
}

.social-load-more-btn {
    padding: 0.75rem 2rem;
    background: white;
    color: #00b4ff;
    border: 2px solid #00b4ff;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.social-load-more-btn:hover {
    background: #00b4ff;
    color: white;
}

body.dark-mode .social-load-more-btn {
    background: #1e293b;
    color: #00b4ff;
    border-color: #00b4ff;
}

body.dark-mode .social-load-more-btn:hover {
    background: #00b4ff;
    color: white;
}

.social-loading-more {
    text-align: center;
    padding: 1.5rem 0;
}

/* ==============================================
    flex: 1;
}

.social-post-author {
    display: block;
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
}

.social-post-time {
    font-size: 0.8rem;
    color: #94a3b8;
}

.social-post-book-link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: #f1f5f9;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    color: #64748b;
    text-decoration: none;
    transition: background 0.2s ease;
}

.social-post-book-link:hover {
    background: #e2e8f0;
}

body.dark-mode .social-post-author {
    color: #f1f5f9;
}

body.dark-mode .social-post-book-link {
    background: #334155;
    color: #94a3b8;
}

body.dark-mode .social-post-book-link:hover {
    background: #475569;
}

.social-post-content {
    color: #334155;
    line-height: 1.6;
    margin-bottom: 1rem;
}

body.dark-mode .social-post-content {
    color: #e2e8f0;
}

.social-post-actions {
    display: flex;
    gap: 1.5rem;
}

.social-post-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: #64748b;
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.social-post-action:hover {
    color: #00b4ff;
}

.social-post-action i.liked {
    color: #ef4444;
}

/* Load More */
.social-load-more {
    text-align: center;
    margin-top: 1.5rem;
}

.social-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: #00b4ff;
    border: 2px solid #00b4ff;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.social-load-more-btn:hover {
    background: #00b4ff;
    color: white;
}

.social-loading-more {
    text-align: center;
    padding: 1rem;
}

.social-loading-more .social-loading-spinner {
    width: 32px;
    height: 32px;
    margin: 0 auto;
}

/* ==============================================
   READING STATS COMPONENT
   ============================================== */

.user-reading-stats {
    width: 100%;
}

.stats-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

.stats-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 180, 255, 0.2);
    border-top-color: #00b4ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

/* Stats Cards Grid */
.stats-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stats-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body.dark-mode .stats-card {
    background: #1e293b;
}

.stats-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    font-size: 1.5rem;
}

.stats-card-icon.reading {
    background: rgba(0, 180, 255, 0.1);
    color: #00b4ff;
}

.stats-card-icon.time {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.stats-card-icon.chapters {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.stats-card-icon.streak {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.stats-card-content {
    flex: 1;
}

.stats-card-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
}

.stats-card-label {
    font-size: 0.85rem;
    color: #64748b;
}

body.dark-mode .stats-card-value {
    color: #f1f5f9;
}

body.dark-mode .stats-card-label {
    color: #94a3b8;
}

/* Stats Sections */
.stats-section {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body.dark-mode .stats-section {
    background: #1e293b;
}

.stats-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 1.25rem 0;
}

.stats-section-title i {
    color: #00b4ff;
}

body.dark-mode .stats-section-title {
    color: #f1f5f9;
}

/* Category Stats */
.stats-category-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stats-category-item {
    /* container */
}

.stats-category-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.375rem;
}

.stats-category-name {
    font-weight: 500;
    color: #334155;
    font-size: 0.9rem;
}

.stats-category-count {
    font-size: 0.8rem;
    color: #64748b;
}

body.dark-mode .stats-category-name {
    color: #e2e8f0;
}

body.dark-mode .stats-category-count {
    color: #94a3b8;
}

.stats-category-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.stats-category-fill {
    height: 100%;
    background: linear-gradient(90deg, #00b4ff 0%, #0066cc 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

body.dark-mode .stats-category-bar {
    background: #334155;
}

/* Monthly Activity */
.stats-monthly-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.75rem;
}

.stats-month-cell {
    padding: 1rem 0.5rem;
    text-align: center;
    border-radius: 0.5rem;
    transition: transform 0.2s ease;
}

.stats-month-cell:hover {
    transform: scale(1.05);
}

.stats-month-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: inherit;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.stats-month-value {
    font-size: 0.9rem;
    font-weight: 700;
}

.stats-month-cell.intensity-0 {
    background: #f1f5f9;
    color: #94a3b8;
}

.stats-month-cell.intensity-1 {
    background: rgba(0, 180, 255, 0.15);
    color: #0284c7;
}

.stats-month-cell.intensity-2 {
    background: rgba(0, 180, 255, 0.3);
    color: #0369a1;
}

.stats-month-cell.intensity-3 {
    background: rgba(0, 180, 255, 0.5);
    color: white;
}

.stats-month-cell.intensity-4 {
    background: #00b4ff;
    color: white;
}

body.dark-mode .stats-month-cell.intensity-0 {
    background: #334155;
    color: #64748b;
}

/* Achievements */
.stats-achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.stats-achievement-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.75rem;
    border: 2px solid #e2e8f0;
    transition: all 0.2s ease;
}

.stats-achievement-card.unlocked {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.stats-achievement-card.locked {
    opacity: 0.6;
}

body.dark-mode .stats-achievement-card {
    border-color: #334155;
}

body.dark-mode .stats-achievement-card.unlocked {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.stats-achievement-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 0.75rem;
    font-size: 1.5rem;
    color: #64748b;
}

.stats-achievement-card.unlocked .stats-achievement-icon {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

body.dark-mode .stats-achievement-icon {
    background: #334155;
}

.stats-achievement-info {
    flex: 1;
}

.stats-achievement-name {
    display: block;
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
}

.stats-achievement-desc {
    font-size: 0.8rem;
    color: #64748b;
}

body.dark-mode .stats-achievement-name {
    color: #f1f5f9;
}

body.dark-mode .stats-achievement-desc {
    color: #94a3b8;
}

.stats-achievement-check {
    color: #10b981;
    font-size: 1.25rem;
}

/* ==============================================
   RESPONSIVE
   ============================================== */

@media (max-width: 768px) {
    .user-profile-hero-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .user-profile-info-section {
        width: 100%;
    }

    .user-profile-content {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .user-profile-avatar {
        width: 120px;
        height: 120px;
    }

    .user-profile-name {
        font-size: 1.5rem;
    }

    .user-profile-meta {
        justify-content: center;
    }

    .user-profile-stats {
        justify-content: center;
        gap: 1rem;
        flex-wrap: wrap;
    }

    .user-profile-actions {
        justify-content: center;
    }

    .user-profile-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .user-profile-tab {
        white-space: nowrap;
    }

    .activity-books-grid {
        grid-template-columns: 1fr;
    }

    .stats-monthly-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .stats-achievements-grid {
        grid-template-columns: 1fr;
    }
}

/* Keep the activity card and its hover/focus, cover size, progress and completion treatment. */
.member-profile-v2 .activity-book-title { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.35; }
.member-profile-v2 .activity-book-author { overflow-wrap: anywhere; }
.member-profile-v2 .activity-section-header { gap: 10px; margin-bottom: 14px; }
.member-profile-v2 .activity-section-title { color: var(--mp-ink); font-size: 20px; }
.member-profile-v2 .activity-section-title i { display: none; }
.member-profile-v2 .activity-section-count { padding: 0; border-radius: 0; background: transparent; color: var(--mp-muted); font-size: 14px; }
.member-profile-v2 .activity-section { margin-bottom: 36px; }
.member-profile-v2 .activity-empty, .member-profile-v2 .social-empty { max-width: 720px; align-items: flex-start; padding: 28px; border: 1px solid var(--mp-border); border-radius: 14px; background: var(--mp-surface); text-align: left; }
.member-profile-v2 :is(.activity-empty-btn, .activity-load-more-btn, .social-load-more-btn, .social-empty-action-btn) { min-height: 44px; border: 1px solid var(--mp-border); border-radius: 10px; background: var(--mp-surface); color: var(--mp-accent); font-weight: 600; }
.member-profile-v2 .user-social-feed { max-width: 720px; margin: 0; }
.member-profile-v2 .user-social-feed .social-posts-list { gap: 12px; }
.member-profile-v2 .user-reading-stats .stats-cards-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 32px; }
.member-profile-v2 .user-reading-stats .stats-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px; border: 1px solid var(--mp-border); border-radius: 14px; background: var(--mp-surface); box-shadow: 0 1px 2px rgb(2 6 23 / 5%); }
.member-profile-v2 .user-reading-stats .stats-card-icon { width: auto; height: auto; border-radius: 0; background: transparent; color: var(--mp-accent); font-size: 20px; }
.member-profile-v2 .user-reading-stats .stats-card-value { color: var(--mp-ink); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.member-profile-v2 .user-reading-stats .stats-card-label { color: var(--mp-muted); font-size: 13px; }
.member-profile-v2 .user-reading-stats .stats-section { padding: 0; background: transparent; box-shadow: none; }
.member-profile-v2 .user-reading-stats .stats-section-title { color: var(--mp-ink); font-size: 20px; }
.member-profile-v2 .user-reading-stats .stats-section-title > i { display: none; }
.member-profile-v2 .user-reading-stats .stats-achievements-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.member-profile-v2 .user-reading-stats .stats-achievement-card { gap: 12px; padding: 16px; border: 1px solid var(--mp-border); border-radius: 10px; background: var(--mp-surface); opacity: 1; }
.member-profile-v2 .user-reading-stats .stats-achievement-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--mp-alt); color: var(--mp-muted); font-size: 20px; }
.member-profile-v2 .user-reading-stats .stats-achievement-card.unlocked .stats-achievement-icon { background: var(--mp-alt); color: var(--mp-accent); }
.member-profile-v2 .user-reading-stats .stats-achievement-info { min-width: 0; }
.member-profile-v2 .user-reading-stats .stats-achievement-name { color: var(--mp-ink); font-size: 14px; overflow-wrap: anywhere; }
.member-profile-v2 .user-reading-stats .stats-achievement-desc { color: var(--mp-muted); font-size: 12px; }
.member-profile-v2 .user-reading-stats .stats-achievement-status { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px; margin-left: auto; color: var(--mp-muted); font-size: 11px; }
.member-profile-v2 .user-reading-stats .unlocked .stats-achievement-status { color: var(--mp-accent); }
@media (max-width: 900px) {
    .member-profile-v2 .user-reading-stats .stats-achievements-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .member-profile-v2 { padding: calc(104px + var(--topnav-inset-top, 0px)) 16px calc(112px + env(safe-area-inset-bottom, 0px)); }
    .member-profile-v2 .user-profile-hero { padding: 20px 16px; }
    .member-profile-v2 .user-profile-hero-container { grid-template-columns: 72px minmax(0, 1fr); gap: 6px 16px; }
    .member-profile-v2 .user-profile-avatar-wrapper { width: 72px; height: 72px; }
    .member-profile-v2 .user-profile-name { font-size: 24px; }
    .member-profile-v2 .user-profile-actions { grid-column: 1 / -1; grid-row: 3; margin-top: 10px; }
    .member-profile-v2 .user-profile-action-btn { flex: 1; padding-inline: 12px; }
    .member-profile-v2 .user-profile-stats { grid-row: 4; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; padding: 0; border: 0; }
    .member-profile-v2 .user-profile-stat { padding: 10px 12px; border: 0; border-radius: 10px; background: var(--mp-alt); }
    .member-profile-v2 .user-profile-stat + .user-profile-stat { border: 0; }
    .member-profile-v2 .user-profile-private-notice { grid-row: 4; }
    .member-profile-v2 .user-profile-tabs-container { width: 100%; }
    .member-profile-v2 .user-profile-tabs { overflow: visible; }
    .member-profile-v2 .user-profile-tab { flex: 1 1 auto; padding-inline: 8px; font-size: 14px; }
    .member-profile-v2 .user-profile-tab > i { display: none; }
    .member-profile-v2 .user-profile-content { padding-top: 20px; }
    .member-profile-v2 .activity-books-grid { grid-template-columns: minmax(0, 1fr); }
    .member-profile-v2 .activity-section-title { font-size: 19px; }
    .member-profile-v2 .user-reading-stats .stats-cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .member-profile-v2 .user-reading-stats .stats-achievements-grid { grid-template-columns: minmax(0, 1fr); }
    .member-profile-v2 .user-profile-error, .member-profile-v2 .activity-empty, .member-profile-v2 .social-empty { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
    .member-profile-v2 *, .member-profile-v2 *::before, .member-profile-v2 *::after { animation: none !important; transition: none !important; }
}
