/* ===================================================
   Profile Page — Discourse Flat Style
   =================================================== */

/* --- Profile Container & Nav --- */
.profile-page-container {
    background-color: transparent;
    font-family: var(--body-font), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.profile-nav {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.profile-nav-link {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 0;
    text-decoration: none !important;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.profile-nav-link:hover {
    color: var(--text-dark);
}

.profile-nav-link.active {
    color: var(--text-dark);
    border-bottom-color: var(--primary-color);
}

/* --- Left Column (Identity) --- */
.profile-identity-section {
    padding-right: 1.5rem;
    position: sticky;
    top: 80px;
    align-self: flex-start;
}

.profile-avatar-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.profile-avatar-container .avatar {
    width: 140px !important;
    height: 140px !important;
    box-shadow: none !important;
    border: none !important;
}

/* Fix status dot on profile avatar */
.profile-avatar-container .avatar-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar-container .status-dot {
    width: 20px !important;
    height: 20px !important;
    border: 3px solid var(--bg-body, #f3f4f6) !important;
    position: absolute !important;
    bottom: 8px !important;
    right: 12px !important;
    z-index: 2;
}

.profile-username {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0 0 0.2rem 0;
    line-height: 1.2;
}

.profile-fullname {
    text-align: center;
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.profile-primary-stats {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.profile-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.profile-stat-label {
    color: var(--text-muted);
}

.profile-stat-value {
    font-weight: 600;
    color: var(--text-dark);
}

.profile-stat-value a {
    color: inherit;
    text-decoration: none;
}

.profile-stat-value a:hover {
    color: var(--primary-color);
}

.profile-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}


.profile-btn {
    display: flex;
    align-items: center;
    padding: 0.45rem 0.65rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dark);
    background: transparent;
    border: none;
    border-radius: 6px;
    transition: all 0.15s ease;
    text-decoration: none !important;
    cursor: pointer;
    margin-bottom: 1px;
}

.profile-btn i {
    font-size: 0.85rem;
    width: 1.2rem;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.7;
    margin-right: 0.4rem;
}

.profile-btn:hover {
    color: var(--primary-color);
    background: var(--primary-light);
}

.profile-btn:hover i {
    opacity: 1;
}

/* Remove old primary/secondary overrides to let them all act like sidebar links, except maybe color hints */





.profile-social-links {
    justify-content: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.profile-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(0,0,0,0.05);
    color: var(--text-muted);
    transition: all 0.2s;
    text-decoration: none !important;
}

.profile-social-link:hover {
    background-color: var(--primary-color);
    color: white;
}

/* --- Right Column (Content) --- */
.profile-content-section {
    padding-left: 1rem;
}

.profile-section-heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.profile-about-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-dark);
    margin-bottom: 3rem;
}

/* Activity Feed - Timeline Style */
.profile-activity-list {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
    padding: 0;
    margin-left: 0;
}

.profile-activity-list::before {
    content: '';
    position: absolute;
    top: 18px;
    bottom: 18px;
    left: 17px;
    width: 2px;
    background-color: var(--border-color, #e5e7eb);
    z-index: 0;
}

.profile-activity-list.no-timeline::before {
    display: none;
}

.profile-activity-row {
    position: relative;
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    z-index: 1;
    margin: 0;
    padding: 0;
}

.profile-activity-avatar {
    flex-shrink: 0;
    width: 36px;
    display: flex;
    justify-content: center;
}

.profile-activity-avatar .avatar-container {
    margin-right: 0 !important;
}

.profile-activity-avatar .avatar {
    width: 36px !important;
    height: 36px !important;
    box-shadow: 0 0 0 4px var(--bg-body, #f4f6f9) !important;
    background-color: var(--bg-body, #f4f6f9) !important;
    border-radius: 50% !important;
    position: relative;
    z-index: 2;
}

.profile-activity-list.no-timeline .profile-activity-avatar .avatar {
    box-shadow: none !important;
}

.profile-activity-body {
    flex: 1;
    min-width: 0;
    padding-top: 0.2rem;
}

.profile-activity-meta {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.profile-activity-meta a {
    color: var(--text-dark);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
}

.profile-activity-meta a:hover {
    color: var(--primary-color);
}

.profile-activity-time {
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0.7;
    white-space: nowrap;
    margin-left: auto;
}

.profile-activity-snippet {
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.5;
    opacity: 0.85;
}


/* Moderation Section */
.profile-mod-section {
    margin-bottom: 3rem;
}

/* Responsive */
@media (max-width: 991.98px) {
    .profile-identity-section {
        margin-bottom: 2.5rem;
        position: static;
        max-height: none;
        overflow-y: visible;
    }
    .profile-content-section {
    }
    .profile-nav {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 0.5rem;
    }
    .profile-primary-stats {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .profile-stat-row {
        max-width: 100%;
    }
}

/* --- User Posts Page --- */
.user-posts-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.user-post-item {
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s ease;
}

.user-post-item:first-child {
    border-top: 1px solid var(--border-color);
}

.user-post-item.user-post-deleted {
    opacity: 0.6;
}

.user-post-header {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
}

.user-post-topic-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    flex-shrink: 0;
}

.user-post-topic-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    text-decoration: none !important;
    transition: color 0.15s ease;
    flex: 1;
    min-width: 0;
}

.user-post-topic-link:hover {
    color: var(--primary-color);
}

.user-post-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.7;
    white-space: nowrap;
    margin-left: auto;
}

.user-post-snippet {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.55;
    padding-left: 0.6rem;
    border-left: 2px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.user-post-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-post-forum {
    font-size: 0.78rem;
    color: var(--text-muted);
    opacity: 0.75;
}

/* --- Public Users List --- */
.public-users-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.public-users-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.public-users-select {
    width: auto;
    min-width: 130px;
}

.public-users-sort-group {
    display: flex;
    gap: 0.25rem;
}

.public-users-sort-btn {
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.25rem 0.6rem;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.public-users-sort-btn:hover,
.public-users-sort-btn.active {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.public-users-search {
    position: relative;
    flex: 1;
    min-width: 0;
    padding-top: 0.2rem;
}

.profile-activity-meta {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.profile-activity-meta a {
    color: var(--text-dark);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
}

.profile-activity-meta a:hover {
    color: var(--primary-color);
}

.profile-activity-time {
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0.7;
    white-space: nowrap;
    margin-left: auto;
}

.profile-activity-snippet {
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.5;
    opacity: 0.85;
}


/* Moderation Section */
.profile-mod-section {
    margin-bottom: 3rem;
}

/* Responsive */
@media (max-width: 991.98px) {
    .profile-identity-section {
        margin-bottom: 2.5rem;
        position: static;
        max-height: none;
        overflow-y: visible;
    }
    .profile-content-section {
    }
    .profile-nav {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 0.5rem;
    }
    .profile-primary-stats {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .profile-stat-row {
        max-width: 100%;
    }
}

/* --- User Posts Page --- */
.user-posts-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.user-post-item {
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s ease;
}

.user-post-item:first-child {
    border-top: 1px solid var(--border-color);
}

.user-post-item.user-post-deleted {
    opacity: 0.6;
}

.user-post-header {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
}

.user-post-topic-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    flex-shrink: 0;
}

.user-post-topic-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    text-decoration: none !important;
    transition: color 0.15s ease;
    flex: 1;
    min-width: 0;
}

.user-post-topic-link:hover {
    color: var(--primary-color);
}

.user-post-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.7;
    white-space: nowrap;
    margin-left: auto;
}

.user-post-snippet {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.55;
    padding-left: 0.6rem;
    border-left: 2px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.user-post-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-post-forum {
    font-size: 0.78rem;
    color: var(--text-muted);
    opacity: 0.75;
}

/* --- Public Users List --- */
.public-users-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.public-users-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.public-users-select {
    width: auto;
    min-width: 130px;
}

.public-users-sort-group {
    display: flex;
    gap: 0.25rem;
}

.public-users-sort-btn {
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.25rem 0.6rem;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.public-users-sort-btn:hover,
.public-users-sort-btn.active {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.public-users-search {
    position: relative;
    flex: 0 0 auto;
}

.public-users-search-icon {
    position: absolute;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.8rem;
    pointer-events: none;
}

.public-users-search-input {
    padding-left: 2rem;
    width: 200px;
}

/* Grid */
.public-users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.public-user-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.1rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: transparent;
    text-decoration: none !important;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    gap: 0.4rem;
}

.public-user-card:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    transform: translateY(-4px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.team-card {
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.team-card:hover {
    border-color: var(--primary-color) !important;
    background: var(--primary-light) !important;
    transform: translateY(-4px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
}

.public-user-avatar-wrap {
    position: relative;
    margin-bottom: 0.2rem;
}

.public-user-avatar-wrap .avatar {
    width: 64px !important;
    height: 64px !important;
    border-radius: 50% !important;
}

.public-user-online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid var(--bg-body);
}

.public-user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    width: 100%;
    text-align: center;
    min-width: 0;
}

.public-user-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.public-user-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-style: italic;
}

.public-user-role {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.public-user-dates {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    width: 100%;
    border-top: 1px solid var(--border-color);
    margin-top: 0.3rem;
    padding-top: 0.4rem;
}

.public-user-date-row {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.public-user-stats {
    margin-top: 0.1rem;
}

.public-user-stat {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

@media (max-width: 575.98px) {
    .public-users-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.75rem;
    }
    .public-users-search-input {
        width: 100%;
    }
    .public-users-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}
